/* ============================================================
   FlowNails - Booking Flow (booking.css)
   App-like step-by-step animated UI
   ============================================================ */
@import url('./variables.css');

/* ── Layout ── */
.booking-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gradient-hero);
}

.booking-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsl(0 0% 100% / 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 14px var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topbar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-cta);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topbar-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.topbar-logo-text span { color: var(--primary-deep); }

/* ── Progress Bar ── */
.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.progress-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ps-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  transition: var(--transition-smooth);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.ps-dot.active {
  background: var(--gradient-cta);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-sm);
  animation: pulse-soft 2s infinite;
}

.ps-dot.done {
  background: var(--success);
  border-color: var(--success-dark);
  color: var(--success-dark);
}

.ps-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: var(--transition-base);
}

.ps-line.done { background: var(--success-dark); }

/* ── Main Content Area ── */
.booking-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px var(--space-lg);
  gap: var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── Summary Sidebar ── */
.booking-summary {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.summary-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeInUp 0.4s ease both;
}

.summary-item:last-child { border-bottom: none; }

.summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}

.summary-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.summary-value.price {
  color: var(--primary-deep);
  font-size: 20px;
  font-weight: 800;
}

.summary-empty {
  text-align: center;
  padding: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 13px;
}

.summary-empty .empty-icon { font-size: 40px; display: block; margin-bottom: 8px; }

/* ── Step Cards ── */
.step-container {
  flex: 1;
  min-width: 0;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
  display: none;
  position: relative;
  overflow: hidden;
}

.step-card.active {
  display: block;
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.step-card.exit-left {
  animation: slideInLeft 0.3s ease reverse both;
}

.step-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.step-header { margin-bottom: var(--space-xl); }

.step-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-deep);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

.step-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.step-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* ── Service Grid ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.service-option {
  background: var(--bg-alt);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.service-option::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-base);
  z-index: 0;
}

.service-option:hover {
  border-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.service-option.selected {
  border-color: var(--primary-dark);
  background: var(--primary);
  box-shadow: var(--shadow-md);
}

.service-option.selected::after { opacity: 0.15; }

.service-option > * { position: relative; z-index: 1; }

.service-icon {
  font-size: 36px;
  line-height: 1;
}

.service-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.service-duration {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.service-price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-deep);
  margin-top: 4px;
}

.service-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 24px; height: 24px;
  background: var(--gradient-cta);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  animation: fadeIn 0.25s ease;
}

.service-option.selected .service-check { display: flex; }

/* ── Date/Time Selector ── */
.date-picker-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.calendar-mini {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.calendar-month {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.calendar-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
}

.calendar-nav:hover { background: var(--primary); color: var(--primary-deep); }

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-day-name {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-display);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-display);
}

.cal-day:hover:not(.empty):not(.past):not(.full) {
  background: var(--primary);
  color: var(--primary-deep);
}

.cal-day.selected {
  background: var(--gradient-cta);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.cal-day.today {
  border: 2px solid var(--primary-dark);
  font-weight: 700;
}

.cal-day.past,
.cal-day.full {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.cal-day.empty { cursor: default; }

/* ── Time Slots ── */
.time-slots-wrapper { }
.time-slots-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.time-slot {
  padding: 12px;
  background: var(--bg-alt);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition-smooth);
}

.time-slot:hover:not(.unavailable) {
  border-color: var(--primary-dark);
  background: var(--primary);
  color: var(--primary-deep);
  transform: scale(1.03);
}

.time-slot.selected {
  background: var(--gradient-cta);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-sm);
}

.time-slot.unavailable {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.time-slots-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 30px;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

/* ── Contact Form ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 480px;
}

/* ── Confirmation Step ── */
.confirm-booking-summary {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.confirm-booking-summary h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-on-primary);
  margin-bottom: var(--space-lg);
}

.confirm-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-on-primary);
}

.confirm-item span:first-child {
  opacity: 0.7;
  font-size: 13px;
}

.confirm-item span:last-child {
  font-weight: 700;
  font-family: var(--font-display);
}

.confirm-divider {
  height: 1px;
  background: hsl(340 35% 18% / 0.2);
  margin: var(--space-sm) 0;
}

.confirm-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
}

.confirm-total-label {
  font-size: 14px;
  color: var(--text-on-primary);
  opacity: 0.8;
}

.confirm-total-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-deep);
}

/* ── Pix Payment Card ── */
.pix-card {
  background: var(--surface);
  border: 2px solid var(--primary-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.pix-icon { font-size: 48px; margin-bottom: var(--space-md); }

.pix-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.pix-amount-due {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-deep);
  margin: var(--space-md) 0;
}

.pix-key-wrapper {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.pix-key-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.pix-copy-btn {
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-deep);
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.pix-copy-btn:hover {
  background: var(--primary-dark);
  color: white;
}

.pix-copy-btn.copied {
  background: var(--success);
  color: var(--success-dark);
}

.pix-instruction {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── Step Navigation ── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* ── Success Screen ── */
.success-screen {
  display: none;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  animation: fadeInUp 0.6s ease both;
}

.success-screen.show { display: block; }

.success-icon-wrap {
  width: 100px;
  height: 100px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  margin: 0 auto var(--space-xl);
  box-shadow: var(--shadow-lg);
  animation: pulse-soft 3s infinite;
}

.success-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.success-desc {
  font-size: 16px;
  color: var(--text-mid);
  max-width: 400px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.success-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Loading Spinner ── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.spinner-overlay.show { display: flex; }

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--text);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transform: translateY(80px);
  opacity: 0;
  transition: var(--transition-slide);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success-dark); }
.toast.error   { background: var(--danger-dark); }

/* ── My Bookings Screen ── */
.my-bookings-screen {
  display: none;
  animation: fadeInUp 0.45s ease both;
}

.my-bookings-screen.show { display: block; }

/* ── Pre-step choice screen ── */
.pre-step {
  display: block;
  animation: fadeInUp 0.5s ease both;
}

.pre-step.hidden { display: none; }

.pre-step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.pre-step-option {
  background: var(--gradient-surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.pre-step-option:hover {
  border-color: var(--primary-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pre-step-option.primary {
  background: var(--gradient-primary);
  border-color: var(--primary-dark);
}

.pre-step-icon {
  font-size: 52px;
  line-height: 1;
}

.pre-step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.pre-step-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Phone lookup card ── */
.phone-lookup-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
  max-width: 480px;
  margin: 0 auto;
  animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.phone-lookup-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.phone-lookup-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.phone-lookup-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ── Booking history list ── */
.my-bookings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.my-bookings-greeting {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.my-bookings-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.payment-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: var(--warning);
  border: 1px solid var(--warning-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  animation: pulse-soft 2.5s infinite;
}

.payment-warning-icon { font-size: 24px; flex-shrink: 0; }

.payment-warning-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: hsl(42, 70%, 25%);
  line-height: 1.5;
}

.payment-warning-text strong { display: block; font-size: 15px; margin-bottom: 4px; }

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: var(--transition-base);
  animation: fadeInUp 0.4s ease both;
}

.history-card:hover { box-shadow: var(--shadow-sm); }

.history-card.pending-payment {
  border-color: var(--warning-dark);
  background: hsl(42 80% 97%);
}

.history-card.cancelled {
  opacity: 0.55;
}

.history-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.history-card-info { flex: 1; min-width: 0; }

.history-service {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.history-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.history-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-deep);
  margin-right: var(--space-md);
  white-space: nowrap;
}

.badge-cancelled {
  background: hsl(0 20% 90%);
  color: hsl(0 35% 40%);
}

.history-empty {
  text-align: center;
  padding: 48px var(--space-lg);
  color: var(--text-muted);
}

.history-empty-icon { font-size: 48px; margin-bottom: var(--space-md); }

.history-empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .booking-main {
    flex-direction: column;
    padding: 20px var(--space-md);
  }

  .booking-summary {
    width: 100%;
    position: static;
    order: -1;
  }

  .summary-card {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .summary-item {
    border-bottom: none;
    padding: 0;
    border-right: 1px solid var(--border-light);
    padding-right: var(--space-md);
    margin-right: var(--space-md);
  }

  .summary-item:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .step-card { padding: var(--space-lg); }
  .services-grid { grid-template-columns: 1fr; }
  .date-picker-wrapper { grid-template-columns: 1fr; }
  .progress-steps .ps-line { width: 16px; }
  .ps-dot { width: 24px; height: 24px; font-size: 10px; }
  .pre-step-grid { grid-template-columns: 1fr; }
}
