/* Booking wizard — marketing visual system (shared/tokens.css): ink chrome,
   paper content, square gold buttons, Cormorant display, uppercase Jost UI. */

:root {
  --bg-primary: var(--ha-paper);
  --bg-card: #FFFFFF;
  --bg-elevated: var(--ha-paper-2);
  --bg-disabled: var(--ha-paper-2);
  --text-primary: var(--ha-text);
  --text-secondary: var(--ha-text-muted);
  --text-muted: #8A8076;
  --text-disabled: #C4BAAE;
  --accent: var(--ha-gold-deep);
  --accent-hover: var(--ha-accent-hover);
  --accent-fill: var(--ha-gold);
  --accent-fill-hover: var(--ha-gold-hover);
  --accent-muted: rgba(217, 177, 128, 0.16);
  --accent-glow: rgba(217, 177, 128, 0.35);
  --ink: var(--ha-ink);
  --ink-2: var(--ha-ink-2);
  --ink-3: var(--ha-ink-3);
  --ivory: var(--ha-ivory);
  --muted-light: var(--ha-muted-light);
  --line-dark: var(--ha-line-dark);
  --green: #4A9B6E;
  --green-bg: rgba(74, 155, 110, 0.12);
  --red: #C45C4A;
  --border: var(--ha-border);
  --radius: 0;
  --radius-lg: 0;
  --transition: 0.2s ease;
  --font-display: var(--ha-font-display);
  --font-body: var(--ha-font-body);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }

.header {
  background: var(--ink);
  border-bottom: 1px solid var(--line-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  color: var(--ivory);
}
.header-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}
.header-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-light);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.header-nav-btn:hover {
  color: var(--ivory);
  border-bottom-color: var(--accent-fill);
}
.header-spacer {
  justify-self: end;
  min-width: 1px;
}

/* Step header: title + language */
.step-header-bar {
  max-width: 500px;
  margin: 0 auto 4px;
  padding: 28px 16px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.step-header-bar .step-title {
  flex: 1;
  min-width: 0;
  margin: 0 0 16px;
}
.step-header-bar .lang-selector-wrapper {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 6px;
}

/* Language selector */
.lang-selector-wrapper {
  position: relative;
}
.lang-selected-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  transition: var(--transition);
  pointer-events: none;
}
.lang-selector-wrapper:hover .lang-selected-btn {
  border-color: var(--accent);
  color: var(--accent);
}
.lang-selector-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}
.lang-chevron {
  font-size: 10px;
}
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px -20px rgba(35, 30, 25, 0.4);
  list-style: none;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  z-index: 200;
  overflow: hidden;
  padding: 4px 0;
  margin: 0;
}
.lang-selector-wrapper:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.lang-option {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  color: var(--text-secondary);
  text-decoration: none;
}
.lang-option:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.lang-option.active {
  color: var(--accent);
  font-weight: 600;
}
.lang-flag {
  font-size: 15px;
}
@media (hover: none) {
  .lang-selector-wrapper.lang-open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }
  .lang-selector-wrapper.lang-open .lang-selected-btn {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.logo {
  display: flex;
  align-items: center;
  justify-self: center;
}
.logo-img {
  width: 168px;
  height: auto;
  display: block;
}

.progress-bar {
  height: 2px;
  background: var(--ink-3);
}
.progress-fill {
  height: 100%;
  background: var(--accent-fill);
  width: 0;
  transition: width 0.4s ease;
}

.main {
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
  padding: 0 16px;
}
.wizard-track {
  display: flex;
  width: 500%;
  transition: transform 0.3s ease;
  will-change: transform;
}
.wizard-step {
  width: 20%;
  flex-shrink: 0;
  padding: 24px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.wizard-step.active { opacity: 1; }

.step-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Audience tabs: the marketing price-menu tabs */
.tab-row {
  display: flex;
  margin-bottom: 20px;
  border: 1px solid var(--ink);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}
.tab + .tab { border-left: 1px solid var(--ink); }
.tab:hover { background: var(--bg-elevated); }
.tab.active {
  background: var(--ink);
  color: var(--ivory);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text-primary);
}
.card:hover { border-color: var(--accent-fill); }
.card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 20px 40px -30px rgba(35, 30, 25, 0.45);
}
.card-hero {
  border-left: 3px solid var(--accent-fill);
  padding: 18px;
}
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; line-height: 1.2; }
.card:disabled, .card.is-unbookable { opacity: 0.85; cursor: default; }
.card-badge {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 4px 8px;
  border: 1px solid rgba(138, 102, 57, 0.35);
  color: var(--accent);
  white-space: nowrap;
}
.card-duration { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.card-meta { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.card-shop-note { font-size: 12px; letter-spacing: 0.04em; color: var(--accent); margin-top: 8px; }
.card-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.card .sticky-price { color: var(--text-primary); font-weight: 500; font-variant-numeric: tabular-nums; }
.card .barber-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--accent-fill);
  flex-shrink: 0;
}

.date-strip-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }
.date-strip { display: flex; gap: 6px; padding: 4px 0; }
.date-pill {
  flex-shrink: 0;
  width: 58px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  font-family: inherit;
  color: var(--text-primary);
}
.date-pill:hover { border-color: var(--accent-fill); }
.date-pill.selected { border-color: var(--ink); background: var(--ink); }
.date-pill.selected .pill-day { color: var(--accent-fill); }
.date-pill.selected .pill-num { color: var(--ivory); }
.date-pill.dimmed { opacity: 0.35; cursor: default; }
.date-pill .pill-day { font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-secondary); }
.date-pill .pill-num { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.1; color: var(--text-primary); }
.date-pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; margin: 4px auto 0; }
.pill-dot.high { background: var(--green); }
.pill-dot.mid { background: #D4A843; }
.pill-dot.low { background: var(--text-muted); }

.date-display {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 14px;
}

.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-slot {
  padding: 11px 6px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}
.time-slot:hover:not(.unavailable):not(.outside-hours) { border-color: var(--accent); }
.time-slot.available { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.time-slot.selected { background: var(--accent-fill); color: var(--ink); border-color: var(--accent-fill); }
.time-slot.continue-slot { background: var(--accent-muted); border-color: var(--accent-fill); color: var(--accent); }
.time-slot.unavailable { background: var(--bg-disabled); color: var(--text-disabled); cursor: default; border-color: transparent; }
.time-slot.outside-hours { background: var(--bg-primary); color: var(--text-disabled); cursor: default; border-color: transparent; opacity: 0.3; }

.barbers-ctx { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* Summary reads like the marketing price card: white, gold inner frame */
.summary-card {
  position: relative;
  background: var(--bg-card);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 var(--border), 0 30px 60px -40px rgba(35, 30, 25, 0.35);
}
.summary-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(217, 177, 128, 0.55);
  pointer-events: none;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-secondary); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; align-self: center; }
.summary-value { color: var(--text-primary); font-weight: 500; text-align: right; }
.summary-price { font-family: var(--font-display); color: var(--text-primary); font-weight: 500; font-size: 26px; margin-left: auto; }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.phone-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* Sticky book bar: ink, like the marketing phone action bar */
.wizard-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--ink);
  border-top: 1px solid var(--line-dark);
  color: var(--ivory);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wizard-footer-inner {
  max-width: 500px;
  margin: 0 auto;
}

.sticky-bar {
  max-width: 500px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sticky-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sticky-price {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-fill);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.sticky-actions {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px 14px;
}

/* Marketing .btn / .btn--gold */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.btn:disabled { cursor: not-allowed; }
.btn-primary {
  background: var(--accent-fill);
  color: var(--ink);
  width: 100%;
  border-color: var(--accent-fill);
}
.btn-primary:not(:disabled):hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.btn-primary:disabled {
  opacity: 1;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}
.wizard-footer .btn-primary:disabled {
  background: var(--ink-3);
  color: var(--muted-light);
  border-color: var(--ink-3);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--ivory); }
.btn-full { width: 100%; }

.loader { display: flex; justify-content: center; padding: 40px; }
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-fill);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg { font-size: 14px; color: var(--red); text-align: center; padding: 16px; }
.info-msg { font-size: 14px; color: var(--text-muted); text-align: center; padding: 24px; }

.confirm-content { text-align: center; padding: 40px 0; }
.confirm-check { width: 80px; height: 80px; margin: 0 auto 24px; display: block; }
.confirm-check circle { stroke-dasharray: 226; stroke-dashoffset: 226; animation: drawCircle 0.6s ease forwards; stroke: var(--green); }
.confirm-check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: drawCheck 0.4s 0.4s ease forwards; stroke: var(--green); }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.confirm-content .summary-card { text-align: left; }
.confirm-sms { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.notification-result {
  margin: -12px 0 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
}
.notification-ok { color: var(--green); background: rgba(45, 122, 78, 0.1); }
.notification-warning { color: var(--red); background: rgba(179, 62, 62, 0.1); }
.confirm-actions { margin-bottom: 12px; }
.confirm-actions .btn { width: 100%; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .logo { justify-self: end; }
  .header-spacer { display: none; }
  .step-header-bar .step-title { font-size: 28px; }
  .logo-img { width: 136px; }
  .header-nav-btn { min-height: 40px; font-size: 10px; letter-spacing: 0.12em; }
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 14px 16px; }
  .card-name { font-size: 20px; }
  .wizard-step { padding: 20px 0; }
}

@media (min-width: 501px) {
  .wizard-footer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    border-left: 1px solid var(--line-dark);
    border-right: 1px solid var(--line-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .confirm-check circle, .confirm-check path { stroke-dashoffset: 0; }
}
