:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #10201c;
  --ink-2: #4a5a55;
  --line: #dbe4e0;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #d7f0ec;
  --accent: #e8a33d;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #0f766e;
  --warn: #a15c07;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 28, 0.06), 0 8px 24px rgba(16, 32, 28, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1412;
    --surface: #121d1a;
    --surface-2: #17241f;
    --ink: #e7efec;
    --ink-2: #9db0aa;
    --line: #23332e;
    --brand: #4fd1c0;
    --brand-ink: #062521;
    --brand-soft: #123a35;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 460px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.section { padding: 72px 0; }
.page { padding: 32px 0 64px; }

/* Header */
.header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: var(--brand-ink); font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a.navlink { color: var(--ink-2); padding: 8px 10px; border-radius: 8px; font-size: 0.95rem; }
.nav a.navlink.active, .nav a.navlink:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 500; cursor: pointer; transition: transform 0.05s ease, background 0.15s ease; text-decoration: none; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Cards & forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.95rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--brand-soft); color: var(--ink); }

.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 999px; font: inherit; font-size: 0.92rem; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--brand); }
.chip.selected { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-confirmed { background: var(--brand-soft); color: var(--ok); }
.badge-completed { background: var(--surface-2); color: var(--ink-2); }
.badge-cancelled, .badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-pending_payment { background: #fdf3e2; color: var(--warn); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--ink-2); font: inherit; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 40vh; }

/* Landing */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.mock { position: relative; background: linear-gradient(160deg, #123a35, #0b1f1c); border-radius: 22px; aspect-ratio: 4 / 5; box-shadow: var(--shadow); overflow: hidden; }
.mock-remote { position: absolute; inset: 0; display: grid; place-items: center; }
.mock-avatar { width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4fd1c0, #0f766e); opacity: 0.9; }
.mock-self { position: absolute; right: 16px; top: 16px; width: 28%; aspect-ratio: 3 / 4; border-radius: 12px; background: linear-gradient(160deg, #2b4b45, #1a2f2b); border: 2px solid rgba(255, 255, 255, 0.15); }
.mock-label { position: absolute; left: 18px; top: 18px; color: #e7efec; font-size: 0.9rem; }
.mock-label strong { display: block; font-size: 1rem; }
.mock-controls { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.mock-controls span { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.mock-controls span.end { background: #dc2626; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer { padding: 32px 0 48px; color: var(--ink-2); font-size: 0.9rem; }

/* Call */
.call { position: fixed; inset: 0; background: #0b1220; color: #fff; display: flex; flex-direction: column; }
.call video { background: #0b1220; }
.call-remote { flex: 1; width: 100%; height: 100%; object-fit: contain; }
.call-self { position: absolute; right: 16px; top: 16px; width: min(26vw, 220px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; transform: scaleX(-1); border: 2px solid rgba(255, 255, 255, 0.2); }
.call-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; padding: 24px; }
.call-top { position: absolute; left: 16px; top: 16px; }
.call-controls { position: absolute; left: 0; right: 0; bottom: 24px; display: flex; justify-content: center; gap: 14px; }
.round { width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 0.8rem; cursor: pointer; }
.round.off { background: #fff; color: #0b1220; }
.round.end { background: #dc2626; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .mock { max-width: 360px; margin: 0 auto; width: 100%; }
  .section { padding: 48px 0; }
  .hide-sm { display: none; }
}

/* PHP version additions */
.m0 { margin: 0; }
.inline { display: inline; margin: 0; }
.flashes { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.alert-success { background: var(--brand-soft); color: var(--ink); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.slot-radio { position: absolute; opacity: 0; pointer-events: none; }
.slot-radio:checked + .chip { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.slot-radio:focus-visible + .chip { outline: 2px solid var(--brand); outline-offset: 2px; }
a.chip { text-decoration: none; display: inline-block; }
.table { width: 100%; border-collapse: collapse; }
.table td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
body.bare { background: #0b1220; }

/* PWA: respect notches and home indicators when installed */
.header { padding-top: env(safe-area-inset-top); }
.footer { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.call-top { top: calc(16px + env(safe-area-inset-top)); }
.call-self { top: calc(16px + env(safe-area-inset-top)); }
.call-controls { bottom: calc(24px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}
