/* "The" EVA Platform v0.2 — shared public stylesheet
   Mobile-first. Tenant branding flows through three CSS custom properties:
     --eva-primary  (tenant primary token / palette primary)
     --eva-accent   (tenant accent token / palette accent)
     --eva-surface  ("dark" | "light" keyword from the tenant doc)
   Derived tokens (--bg, --card, --ink, --muted, --line, --on-primary)
   are computed from --eva-surface / --eva-primary so a tenant switch
   re-themes the whole shell. The landing page uses the default noir-gold
   theme below until a tenant doc replaces it.
   No emojis anywhere in UI chrome. Safe-area support for notched phones. */

/* The `hidden` attribute must win over any component display rules. */
[hidden] { display: none !important; }

:root {
  /* Default theme: noir-gold (the EVA master brand look) */
  --eva-primary: #1a1512;
  --eva-accent: #c9a227;
  --eva-surface: dark;

  --bg: #0e0b08;
  --bg-raised: #171209;
  --card: #191410;
  --ink: #f3ead8;
  --muted: #a89d86;
  --line: #2c251c;
  --on-primary: #f3ead8;   /* text color over --eva-primary */
  --on-accent: #16120a;    /* text color over --eva-accent */
  --danger: #c0392b;
  --ok: #3e9e5f;
  --radius: 14px;
  --radius-sm: 9px;
  --tap: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* Light-surface tenant variant */
[data-surface="light"] {
  --bg: #faf8f3;
  --bg-raised: #f2ede1;
  --card: #ffffff;
  --ink: #221c14;
  --muted: #6f6552;
  --line: #e3dccb;
}

/* Square-corner tenant variant */
[data-corners="square"] { --radius: 4px; --radius-sm: 2px; }

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

/* Full-viewport branded gradient backdrop */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--eva-accent) 16%, transparent), transparent 70%),
    var(--bg);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(16px + var(--sat)) 16px calc(96px + var(--sab));
}

/* ---------- Typography ---------- */
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; letter-spacing: .01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

.brand-mark {
  display: inline-block;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-mark .the {
  color: var(--eva-accent);
}
.brand-mark .the::before { content: "\201C"; }
.brand-mark .the::after { content: "\201D"; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 6px;
}
.site-header .logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
  flex: none;
}
.site-header .salon-name { font-size: 1.35rem; font-weight: 800; margin: 0; }
.powered-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 10px 0 0;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.powered-badge .brand-mark { letter-spacing: .02em; }

/* ---------- Hero (landing) ---------- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero .kicker {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--eva-accent);
  border: 1px solid color-mix(in srgb, var(--eva-accent) 45%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.1rem, 8.5vw, 3.1rem); margin-bottom: 10px; }
.hero .tagline { font-size: 1.12rem; color: var(--muted); max-width: 34ch; margin: 0 auto 26px; }
.cta-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 4px;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--eva-accent);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, opacity .15s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--eva-accent);
  color: var(--on-accent);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-block { width: 100%; }
.btn-warn {
  background: #b45309;
  color: #fff;
  border-color: #b45309;
}
.btn-danger {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.lifecycle { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.lifecycle h4 { margin: 0 0 4px; }
.badge.st-suspended { background: #fef3c7; color: #92400e; }
.badge.st-closed { background: #fee2e2; color: #991b1b; }
.badge.st-active { background: #d1fae5; color: #065f46; }
.badge.st-configuring { background: #e0e7ff; color: #3730a3; }

/* ---------- Forms ---------- */
.field { margin: 12px 0; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
  letter-spacing: .03em;
}
.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--eva-accent) 60%, transparent);
  outline-offset: 1px;
  border-color: var(--eva-accent);
}
.textarea { resize: vertical; min-height: 84px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  cursor: pointer;
}
.check-row input { width: 20px; height: 20px; accent-color: var(--eva-accent); flex: none; }
.check-row .price { margin-left: auto; color: var(--muted); font-size: .9rem; white-space: nowrap; }

/* ---------- Services list ---------- */
.svc-cat { margin-top: 18px; }
.svc-cat > h3 {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--eva-accent);
  margin-bottom: 8px;
}
.svc {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 10px 0;
  background: color-mix(in srgb, var(--card) 85%, var(--bg));
}
.svc-head { display: flex; align-items: baseline; gap: 10px; }
.svc-name { font-weight: 700; margin: 0; font-size: 1rem; }
.svc-price { margin-left: auto; font-weight: 800; color: var(--eva-accent); white-space: nowrap; }
.svc-desc { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.svc-meta { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.svc-modes { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mode-chip {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
}
.mode-chip.on { border-color: var(--eva-accent); color: var(--eva-accent); }

/* ---------- Availability: day picker + slot grid ---------- */
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 10px 0 14px;
}
.day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 58px;
  padding: 8px 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.day-btn .dow { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day-btn .dom { font-size: 1.02rem; font-weight: 800; }
.day-btn.active {
  background: var(--eva-primary);
  color: var(--on-primary);
  border-color: var(--eva-accent);
}
.day-btn.active .dow { color: inherit; opacity: .75; }
.day-btn:disabled { opacity: .35; cursor: not-allowed; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}
.slot {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}
.slot:hover { border-color: var(--eva-accent); }
.slot.selected {
  background: var(--eva-accent);
  border-color: var(--eva-accent);
  color: var(--on-accent);
}

/* ---------- States ---------- */
.state-block {
  text-align: center;
  padding: 44px 18px;
  color: var(--muted);
}
.state-block h2 { color: var(--ink); margin-bottom: 8px; }
.state-block .btn { margin-top: 14px; }
.spinner {
  width: 34px; height: 34px;
  margin: 40px auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--eva-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
}
.notice {
  border-left: 3px solid var(--eva-accent);
  background: color-mix(in srgb, var(--eva-accent) 10%, var(--card));
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  font-size: .92rem;
}
.notice.err { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--card)); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--sab));
  transform: translateX(-50%) translateY(12px);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--eva-accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: .92rem;
  font-weight: 600;
  max-width: min(92vw, 480px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Receipt / confirmation ---------- */
.receipt { text-align: center; padding: 12px 0 4px; }
.receipt .big-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--eva-accent);
  line-height: 1;
  margin: 8px 0;
}
.receipt .kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.receipt .kv span:first-child { color: var(--muted); }

/* ---------- Chat widget ---------- */
.chat-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--sab));
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--eva-accent);
  color: var(--on-accent);
  border: none;
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-fab .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--on-accent);
  opacity: .75;
}
.chat-panel {
  position: fixed;
  right: 12px;
  left: 12px;
  bottom: calc(84px + var(--sab));
  max-width: 480px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(560px, calc(100dvh - 140px));
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--eva-primary);
  color: var(--on-primary);
}
.chat-head h3 { margin: 0; font-size: .95rem; }
.chat-head .close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
}
.chat-box {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  max-height: 340px;
}
.cmsg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: .93rem;
  line-height: 1.45;
  word-break: break-word;
}
.cmsg.me {
  align-self: flex-end;
  background: var(--eva-accent);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}
.cmsg.them {
  align-self: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.chat-input-row .input { flex: 1; min-height: 46px; }
.chat-input-row .btn { min-height: 46px; padding: 10px 16px; flex: none; }
.unread-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--eva-accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- Steps (how it works) ---------- */
.steps { display: grid; gap: 12px; margin: 18px 0; }
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.step .num {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--eva-accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 1.05rem;
}
.step h3 { margin: 2px 0 4px; font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Demo tenant cards (landing) ---------- */
.demo-grid { display: grid; gap: 12px; margin: 14px 0; }
.demo-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, transform .08s ease;
}
.demo-card:hover { border-color: var(--eva-accent); }
.demo-card:active { transform: scale(.99); }
.demo-swatch {
  flex: none;
  width: 54px; height: 54px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.demo-card h3 { margin: 0 0 2px; font-size: 1.02rem; }
.demo-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.demo-card .go { margin-left: auto; color: var(--eva-accent); font-weight: 800; flex: none; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 26px 0 calc(26px + var(--sab));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.site-footer .fine { margin-top: 10px; font-size: .75rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; }
  .demo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
