/*
 * Customer app styles (layout from the Barberia Tranese Figma design). Colours and fonts are tokens:
 * /api/theme.css overrides them from each salon's Aspetto settings.
 * Every salon-specific value is a token below: re-theme another salon by changing only :root.
 */
:root {
  --bg: #202020;            /* page background */
  --header-bg: #000000;     /* top bar with the logo */
  --ink: #ffffff;           /* text on the page background */
  --muted: rgba(255, 255, 255, 0.62);
  --header-ink: #ffffff;    /* back arrow and text logo on the top bar */
  --accent: #d2c47e;        /* headings, links, primary buttons */
  --accent-ink: #1c1a14;    /* text on accent buttons */
  --accent-dark: #7d6d25;   /* accent text on white surfaces */
  --surface: #ffffff;       /* cards, inputs, chips */
  --surface-ink: #202020;
  --surface-muted: #8a8a8a;
  --line: #e6e6e6;          /* borders on light surfaces */
  --rule: #d2c47e;          /* separators on the dark page */
  --danger: #ff8a7a;
  --ok: #9fd8a8;
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --display: 'Instrument Serif', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.light-page { background: var(--surface); color: var(--surface-ink); }

a { color: var(--accent); text-decoration: none; font-weight: 500; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: 0; }
h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 22px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.shell { max-width: 520px; margin: 0 auto; padding: 0 24px calc(40px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: calc(70px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--header-bg);
}
.topbar .logo { height: 37px; width: auto; display: block; grid-column: 2; }
.topbar .logo-text { height: auto; font: 400 26px var(--display); color: var(--header-ink, #fff); white-space: nowrap; }
.topbar .back {
  grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 2px;
  color: var(--header-ink); background: none; border: 0; padding: 8px 4px; font: 500 15px var(--font); cursor: pointer;
}

.page-title { font-size: 36px; margin: 26px 0 22px; }
.eyebrow { font: 600 12px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mt { margin-top: 20px; }
.mt-lg { margin-top: 36px; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; opacity: .8; }

/* ---------- Welcome ---------- */
.welcome { margin: 0 -24px; }
.welcome-hero { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; filter: var(--hero-filter, grayscale(1)); }
.welcome-hero.placeholder { background: var(--hero-bg, #000); }
.welcome-body { padding: 26px 24px 0; text-align: center; display: flex; flex-direction: column; gap: 40px; }
.welcome-body h1 { font-size: 40px; }
.welcome-actions { display: flex; flex-direction: column; gap: 22px; padding: 0 30px; }
.welcome-actions .btn { min-height: 64px; font-size: 26px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  border: 2px solid var(--accent); background: transparent; color: var(--ink);
  font: 500 18px var(--font); cursor: pointer; text-align: center;
  transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; border-width: 1.5px; }
.btn.ghost { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.dark { border-color: var(--surface-ink); color: var(--surface-ink); }
.link-btn { background: none; border: 0; color: var(--accent); font: 500 15px var(--font); cursor: pointer; padding: 6px 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; color: var(--muted); padding-left: 18px; }
.field input, .field select, .input {
  font: 400 16px var(--font); color: var(--surface-ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 22px; height: 47px; width: 100%;
}
.field input::placeholder, .input::placeholder { color: var(--surface-muted); }
.field input:focus, .input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.field .hint { font-size: 13px; color: var(--danger); padding-left: 18px; }
.otp-input { font: 400 30px var(--display) !important; letter-spacing: .4em; text-align: center; height: 64px !important; }
.or { text-align: center; margin: -6px 0; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.segmented button { font: 500 15px var(--font); border: 0; border-radius: 999px; padding: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--surface-ink); }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; }
.notice.error { background: rgb(255 138 122 / 14%); color: var(--danger); }
.notice.ok { background: rgb(159 216 168 / 14%); color: var(--ok); }
.notice.info { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* ---------- White cards on the dark page ---------- */
.card { background: var(--surface); color: var(--surface-ink); border-radius: var(--radius); padding: 18px 20px; }
.card .muted, .choice .muted, .appt .muted { color: var(--surface-muted); }

/* Operators: photo tiles with gold frame */
.operators { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 190px)); justify-content: center; gap: 28px 24px; }
.operator { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: center; font: inherit; }
.operator .photo {
  width: 100%; aspect-ratio: 1 / 1.03; border-radius: var(--radius); border: 2px solid var(--accent);
  object-fit: cover; display: grid; place-items: center; background: var(--header-bg);
  font: 400 64px var(--display); color: var(--accent);
}
.operator strong { display: block; font: 400 34px var(--display); font-weight: 400; margin-top: 8px; }
.operator small { color: var(--muted); font-size: 14px; }
.operator.on .photo { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Services: white cards, name left, price right */
.choices { display: grid; gap: 18px; }
.choice {
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px 12px;
  background: var(--surface); color: var(--surface-ink); border: 2px solid transparent; border-radius: var(--radius);
  padding: 20px 22px 14px; text-align: left; cursor: pointer; font: inherit; width: 100%; min-height: 110px;
}
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.choice h3 { font-size: 22px; color: var(--surface-ink); }
.choice .price { font: 400 30px var(--display); white-space: nowrap; align-self: center; grid-row: span 2; }
.choice .meta { font-size: 11px; color: var(--surface-muted); align-self: end; }

/* Date strip and time slots */
.days { display: flex; gap: 16px; overflow-x: auto; margin: 0 -24px; padding: 4px 24px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 110px; height: 110px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); color: var(--surface-ink); border: 2px solid transparent; border-radius: var(--radius);
  font: inherit; cursor: pointer;
}
.day small { font-size: 11px; color: var(--surface-muted); text-transform: capitalize; }
.day strong { font: 400 38px var(--display); line-height: 1.1; }
.day:disabled { opacity: .3; cursor: default; }
.day.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.month-label { font-size: 14px; color: var(--muted); text-transform: capitalize; }
.gold-rule { border: 0; border-top: 1px solid var(--rule); margin: 12px 0 20px; opacity: .7; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot {
  height: 46px; border-radius: 12px; border: 2px solid transparent;
  background: var(--surface); color: var(--surface-ink); font: 400 22px var(--display); cursor: pointer; padding: 0;
}
@media (max-width: 360px) { .slots { grid-template-columns: repeat(3, 1fr); } }
.slot.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.slot.queue { background: transparent; color: var(--ink); border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); height: 56px; font-size: 20px; }
.slot.queue small { display: block; font: 500 11px var(--font); color: var(--muted); }
.slot-group-label { font-size: 14px; color: var(--muted); margin: 6px 0 2px; }

/* White summary panel at the bottom of the date step */
.summary-panel {
  background: var(--surface); color: var(--surface-ink);
  margin: 30px -24px calc(-40px - env(safe-area-inset-bottom)); padding: 26px 32px calc(30px + env(safe-area-inset-bottom));
}
.summary-panel h2 { font-size: 36px; margin-bottom: 16px; }
.summary { display: grid; gap: 14px; margin: 0; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.summary dd { margin: 0; text-align: right; }
.summary .total { font-size: 20px; margin-top: 8px; }
.summary .total dd { font-weight: 700; }
.summary-panel .btn.primary { margin-top: 20px; }
.summary-panel .muted { color: var(--surface-muted); }

/* Confirmation page on white */
.light .page-title { color: var(--surface-ink); }
.light .rule { border-color: var(--accent); }
.light .btn:not(.primary) { color: var(--surface-ink); border-color: var(--surface-ink); }
.light .muted { color: var(--surface-muted); }
.light .ad-label, .summary-panel .ad-label { color: var(--surface-muted); }

/* ---------- Appointments ---------- */
.appt {
  position: relative; display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px;
  background: var(--surface); color: var(--surface-ink); border-radius: var(--radius); padding: 12px 34px 12px 12px; min-height: 85px;
}
.appt .when-day { text-align: center; line-height: 1; }
.appt .when-day small { display: block; font-size: 11px; color: var(--surface-muted); text-transform: capitalize; }
.appt .when-day strong { display: block; font: 400 42px var(--display); margin: 2px 0; }
.appt .what { font: 400 18px var(--display); text-align: center; line-height: 1.15; }
.appt .what span { display: block; }
.appt .when-time { text-align: center; line-height: 1; }
.appt .when-time small { display: block; font-size: 10px; color: var(--surface-muted); }
.appt .when-time strong { display: block; font: 400 32px var(--display); margin: 3px 0; }
.appt .x {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--surface-ink); background: none; color: var(--surface-ink);
  font-size: 11px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.appt .x:disabled { opacity: .35; }
.appt .status-tag {
  position: absolute; right: 10px; bottom: 8px; font: 600 10px var(--font); letter-spacing: .08em;
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
.appt .recurring-tag { display: block; margin-top: 4px; font: 600 9px var(--font); letter-spacing: .08em; color: var(--accent-dark); text-transform: uppercase; }
.appt-list { display: flex; flex-direction: column; gap: 14px; }
.appt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: -4px; }
.tag { display: inline-block; font: 600 11px var(--font); padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); }
.section-title { font-size: 34px; margin: 6px 0 18px; }

/* ---------- Misc ---------- */
.success-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-dark); }
.loader { display: grid; place-items: center; padding: 40px; }
.spinner { width: 24px; height: 24px; border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.test-banner { font-size: 14px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--accent); color: var(--accent); }
.test-banner code { font-size: 18px; font-weight: 700; letter-spacing: .15em; }

/* Advertising space */
.ad { margin: 24px 0 4px; }
.ad-label { display: block; font: 600 10px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 4px; }
.ad-body { display: flex; gap: 14px; align-items: center; background: var(--surface); color: var(--surface-ink); border: 2px solid var(--ad-border, #000); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; font-weight: 400; overflow: hidden; }
.ad.has-image .ad-body { flex-direction: column; align-items: stretch; padding: 0; }
.ad-body img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; display: block; }
.ad-text { display: flex; flex-direction: column; gap: 4px; }
.ad.has-image .ad-text { padding: 12px 16px 16px; }
.ad-text strong { font: 400 22px var(--display); }
.ad-text p { font-size: 14px; color: var(--surface-muted); }
.ad-cta { color: var(--accent-dark); font-weight: 600; font-size: 14px; margin-top: 2px; }

/* Full-screen ad between booking steps */
.interstitial {
  position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 24px calc(20px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; animation: ad-in .25s ease;
}
@media (min-width: 521px) { .interstitial { box-shadow: 0 0 0 100vmax rgb(0 0 0 / 60%); } }
@keyframes ad-in { from { opacity: 0; transform: scale(.98); } }
.interstitial-top { display: flex; align-items: center; justify-content: space-between; }
.interstitial-top .ad-label { margin: 0; }
.interstitial-close { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--accent); background: transparent; color: var(--ink); font: 600 15px var(--font); cursor: pointer; }
.interstitial-close:disabled { color: var(--muted); border-color: color-mix(in srgb, var(--ink) 25%, transparent); cursor: default; }
.interstitial-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; min-height: 0; }
.interstitial-body img { width: 100%; max-height: 55vh; object-fit: contain; border-radius: var(--radius); }
.interstitial-body h2 { font-size: 36px; }
.interstitial-actions { display: flex; flex-direction: column; gap: 12px; }

.push-card { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px 18px; }
.push-card h3 { font-size: 22px; margin-bottom: 2px; }
.push-card .btn.ghost { color: var(--surface-ink); border-color: var(--line); }

.offer-card { cursor: pointer; border: 2px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.offer-card h3 { font-size: 24px; }
.offer-card .eyebrow, .offer-card .ad-cta { color: var(--accent-dark); }

.waitlist-box { border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); border-radius: var(--radius); padding: 16px; }
.waitlist-box h3 { font-size: 24px; }

/* Chips (recurring form) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 15px var(--font); padding: 9px 16px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent); background: transparent; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:disabled { opacity: .3; cursor: default; }

/* Floating action bar pinned to the bottom of the screen (area riservata) */
/* Anchored bottom menu: Impostazioni | Punti | Prenota */
.shell.has-nav { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.topbar .logo.link { cursor: pointer; }
.tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 8px max(16px, calc(50% - 244px)) calc(8px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 6px;
  background: var(--nav-bg, rgb(0 0 0 / 92%)); backdrop-filter: blur(12px);
  border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.tabbar > button:not(.btn) {
  flex: none; min-width: 76px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 6px 4px; color: var(--muted); font: 500 12px var(--font); cursor: pointer;
}
.tabbar > button.on { color: var(--accent); }
.tabbar .btn { flex: 1; min-height: 52px; font-size: 19px; margin-left: 8px; }

/* Profile */
.profile-card { display: flex; flex-direction: column; gap: 4px; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-row p { font-size: 17px; }
.profile-sep { border: 0; border-top: 1px solid var(--line); margin: 12px 0; width: 100%; }

/* Razor rating and loyalty */
.razor-rating { display: flex; gap: 6px; }
.razor-rating button { background: none; border: 0; padding: 4px; cursor: pointer; color: #c9c9c9; line-height: 0; }
.razor-rating button.on { color: var(--accent-dark); }
.textarea { font: 400 16px var(--font); color: var(--surface-ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; resize: vertical; }
.points-hero { display: flex; align-items: baseline; justify-content: center; gap: 10px; color: var(--accent); margin: 20px 0 6px; }
.points-hero svg { align-self: center; }
.points-hero strong { font: 400 72px var(--display); line-height: 1; color: var(--ink); }
.points-hero span { font-size: 18px; color: var(--muted); }
.reward { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reward-code { font: 600 34px var(--font); letter-spacing: .25em; color: var(--surface-ink); margin: 4px 0; }
.points-card { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; color: var(--surface-ink); }
.points-card svg { color: var(--accent-dark); flex: none; }
.points-card .grow { flex: 1; font-size: 18px; }
.points-card strong { font: 400 28px var(--display); }
.points-earn { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 15px; margin-top: 16px; }
.points-earn.light { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--surface-ink); }
.points-earn.light svg { color: var(--accent-dark); }

/* Password with show/hide */
.password-field { position: relative; }
.password-field input { padding-right: 92px; }
.password-field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent-dark); font: 600 13px var(--font); padding: 8px 12px; cursor: pointer; }
