/* Cary Studio — Realizat de Petri Data Consult SRL | Suport: 0743 982 420 | office@petridataconsult.ro */

/* ─── Calendar Container ─── */
.booking-calendar {
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

/* ─── Step Content Transitions ─── */
.step-content {
  animation: stepFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Premium Steps Timeline ─── */
.booking-steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
  padding: 0 8px;
}
.booking-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.step-indicator {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: #f3f4f6;
  color: #9ca3af;
  border: 2px solid #e5e7eb;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.step-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-align: center;
  transition: color 0.4s ease;
  letter-spacing: 0.01em;
}
.step-sublabel {
  font-size: 11px;
  font-weight: 400;
  color: transparent;
  text-align: center;
  transition: color 0.4s ease;
  margin-top: -4px;
}

/* Step connector lines */
.booking-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(50% + 28px);
  width: calc(100% - 56px);
  height: 2px;
  background: #e5e7eb;
  transition: background 0.5s ease;
}

/* Active step */
.booking-step.active .step-indicator {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100), 0 4px 12px rgba(34, 197, 94, 0.15);
  animation: stepPulse 2.5s ease-in-out infinite;
}
.booking-step.active .step-label {
  color: var(--brand-700);
}
.booking-step.active .step-sublabel {
  color: var(--brand-500);
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-100), 0 4px 12px rgba(34, 197, 94, 0.15); }
  50% { box-shadow: 0 0 0 8px var(--brand-50), 0 4px 16px rgba(34, 197, 94, 0.25); }
}

/* Done step */
.booking-step.done .step-indicator {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.booking-step.done .step-label {
  color: var(--brand-600);
}
.booking-step.done .step-sublabel {
  color: var(--brand-400);
}
.booking-step.done::after {
  background: var(--brand-500);
}

/* ─── Calendar Header ─── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.cal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.cal-nav button:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
  transform: scale(1.05);
}
.cal-nav button:active {
  transform: scale(0.95);
}
.cal-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* ─── Calendar Grid ─── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #b0b5bf;
  padding: 8px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  user-select: none;
}
.cal-day.empty {
  background: transparent;
}
.cal-day.unavailable {
  color: #d1d5db;
  background: transparent;
}
.cal-day.available {
  color: var(--brand-800);
  background: var(--brand-50);
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
}
.cal-day.available:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}
.cal-day.available:active {
  transform: scale(0.95);
}
.cal-day.selected {
  background: var(--brand-500) !important;
  color: white !important;
  border-color: var(--brand-600) !important;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
  transform: scale(1.08);
}
.cal-day.today {
  font-weight: 700;
}
.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-500);
}
.cal-day.today.selected::after {
  background: white;
}

/* Day entrance animation */
.cal-day.available {
  animation: dayPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cal-day.available:nth-child(7n+1) { animation-delay: 0.02s; }
.cal-day.available:nth-child(7n+2) { animation-delay: 0.04s; }
.cal-day.available:nth-child(7n+3) { animation-delay: 0.06s; }
.cal-day.available:nth-child(7n+4) { animation-delay: 0.08s; }
.cal-day.available:nth-child(7n+5) { animation-delay: 0.10s; }
.cal-day.available:nth-child(7n+6) { animation-delay: 0.12s; }
.cal-day.available:nth-child(7n)   { animation-delay: 0.14s; }

@keyframes dayPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Legend ─── */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}
.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.cal-legend-dot.available {
  background: var(--brand-100);
  border: 1px solid var(--brand-300);
}
.cal-legend-dot.unavailable {
  background: #f3f4f6;
}
.cal-legend-dot.today {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-500);
}

/* ─── Time Slots ─── */
.slots-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.slots-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  margin-bottom: 12px;
  transition: color 0.2s;
}
.slots-back:hover {
  color: var(--brand-600);
}
.slots-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
}
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.slot-btn {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: white;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.slot-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--brand-500);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: inherit;
}
.slot-btn:hover {
  border-color: var(--brand-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.12);
  color: var(--brand-800);
  background: var(--brand-50);
}
.slot-btn:active {
  transform: translateY(0) scale(0.97);
}
.slot-btn.selected {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-600);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
  transform: translateY(-2px);
}
.slot-btn .slot-icon {
  display: block;
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
  font-weight: 400;
}

/* Slot entrance stagger */
.slot-btn {
  animation: slotSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slot-btn:nth-child(1) { animation-delay: 0.03s; }
.slot-btn:nth-child(2) { animation-delay: 0.06s; }
.slot-btn:nth-child(3) { animation-delay: 0.09s; }
.slot-btn:nth-child(4) { animation-delay: 0.12s; }
.slot-btn:nth-child(5) { animation-delay: 0.15s; }
.slot-btn:nth-child(6) { animation-delay: 0.18s; }
.slot-btn:nth-child(7) { animation-delay: 0.21s; }
.slot-btn:nth-child(8) { animation-delay: 0.24s; }
.slot-btn:nth-child(9) { animation-delay: 0.27s; }
.slot-btn:nth-child(10) { animation-delay: 0.30s; }
.slot-btn:nth-child(n+11) { animation-delay: 0.33s; }

@keyframes slotSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Empty Slots Warning ─── */
.slots-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 20px;
}
.slots-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.slots-empty-text {
  font-size: 14px;
  color: #92400e;
  font-weight: 500;
  line-height: 1.5;
}

/* ─── Booking Form ─── */
.form-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--brand-50) 0%, #ecfdf5 100%);
  border: 1px solid var(--brand-200);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 28px;
}
.form-summary-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--brand-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.form-summary-details {
  flex: 1;
}
.form-summary-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-800);
}
.form-summary-hint {
  font-size: 13px;
  color: var(--brand-600);
  margin-top: 2px;
}

/* Floating label input groups */
.form-group {
  position: relative;
  margin-bottom: 6px;
}
.form-field {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 16px 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: #1f2937;
  background: #fafafa;
  outline: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-appearance: none;
  appearance: none;
}
.form-field:focus {
  border-color: var(--brand-500);
  background: white;
  box-shadow: 0 0 0 4px var(--brand-50);
}
.form-field:not(:placeholder-shown),
.form-field:focus {
  padding: 24px 16px 8px;
}
.form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}
textarea ~ .form-label {
  top: 20px;
  transform: translateY(0);
}
.form-field:focus ~ .form-label,
.form-field:not(:placeholder-shown) ~ .form-label {
  top: 10px;
  transform: translateY(0) scale(0.78);
  color: var(--brand-600);
  font-weight: 600;
}
textarea.form-field:focus ~ .form-label,
textarea.form-field:not(:placeholder-shown) ~ .form-label {
  top: 6px;
  transform: scale(0.78);
}
select.form-field {
  padding: 14px 16px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select.form-field ~ .form-label {
  top: -8px;
  transform: scale(0.78);
  color: var(--brand-600);
  font-weight: 600;
  background: linear-gradient(to bottom, transparent 45%, #fafafa 45%);
  padding: 0 4px;
  left: 12px;
}
select.form-field:focus ~ .form-label {
  background: linear-gradient(to bottom, transparent 45%, white 45%);
}
textarea.form-field {
  resize: none;
  min-height: 90px;
  padding-top: 24px;
}

/* ─── Submit Button ─── */
.booking-submit {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  margin-top: 8px;
}
.booking-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}
.booking-submit:hover::before {
  left: 100%;
}
.booking-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.35);
}
.booking-submit:active {
  transform: translateY(0) scale(0.98);
}
.booking-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Success State ─── */
.success-container {
  text-align: center;
  padding: 32px 16px;
  animation: stepFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.success-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-50) 0%, #dcfce7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}
.success-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--brand-200);
  animation: successRingExpand 0.8s ease-out both;
}
.success-check {
  font-size: 36px;
  color: var(--brand-500);
  animation: successPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
.success-title {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.success-text {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.6;
}
.success-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 24px;
}
.success-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--brand-600);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s;
}
.success-new:hover {
  color: var(--brand-800);
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes successRingExpand {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

/* Confetti particles */
.success-confetti {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: confettiBurst 0.8s ease-out both;
}
@keyframes confettiBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: var(--confetti-end) scale(0); }
}

/* ─── Error Toast ─── */
.booking-error {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #991b1b;
  color: white;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90vw;
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.booking-error.hide {
  animation: toastOut 0.3s ease-in both;
}
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to { transform: translateX(-50%) translateY(100px); opacity: 0; }
}

/* ─── Loading ─── */
.cal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 12px;
}
.cal-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand-500);
  animation: spin 0.7s linear infinite;
}
.cal-loading-text {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .booking-steps {
    gap: 0;
  }
  .booking-step:not(:last-child)::after {
    left: calc(50% + 24px);
    width: calc(100% - 48px);
  }
  .step-label {
    font-size: 11px;
  }
  .step-sublabel {
    display: none;
  }
  .step-indicator {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
  .slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .cal-grid {
    gap: 4px;
  }
  .cal-day {
    border-radius: 10px;
    font-size: 13px;
  }
  .form-summary {
    padding: 14px 16px;
    gap: 12px;
  }
  .form-summary-icon {
    width: 44px;
    height: 44px;
  }
}
