/* ====== WebComms & Pay — demo styles ====== */
:root {
  --bg: #0f1729;
  --bg-soft: #15203a;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --ink: #0f1729;
  --ink-soft: #475069;
  --muted: #8a93ab;
  --line: #e3e8f2;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --amber: #d97706;
  --amber-soft: #fdf0db;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 41, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 41, 0.18);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

#demo-banner {
  background: #111a30;
  color: #cbd4ec;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid #243150;
}
#demo-banner strong { color: #ffd166; letter-spacing: 0.5px; }

/* ====== buttons ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ====== badges ====== */
.badge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:3px 9px; border-radius:999px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red   { background: var(--red-soft);   color: var(--red); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* ====== landing ====== */
.landing { background: radial-gradient(1200px 600px at 70% -10%, #1d2b50 0%, var(--bg) 55%); color: #eef1fb; }
.nav { max-width: 1080px; margin: 0 auto; padding: 20px 24px; display:flex; align-items:center; justify-content:space-between; }
.brand-mark { display:flex; align-items:center; gap:10px; font-weight:800; font-size:18px; color:#fff; }
.brand-mark .dot { width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,#6366f1,#22d3ee); display:grid;place-items:center;color:#fff;font-size:14px; }
.hero { max-width: 1080px; margin: 0 auto; padding: 48px 24px 64px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; margin: 18px 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 18px; color: #c5cdec; max-width: 640px; line-height: 1.6; margin: 0 0 28px; }
.kicker { display:inline-block; font-size:13px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:#8fa2ff; }
.hero-actions { display:flex; gap:12px; flex-wrap: wrap; }
.hero-actions .btn-ghost { color:#dfe5ff; border-color:#34406a; }
.hero-actions .btn-ghost:hover { background:#1c294a; }

.features { max-width:1080px; margin: 0 auto; padding: 0 24px 72px; display:grid; gap:18px; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
.feature { background:#152037; border:1px solid #233156; border-radius: var(--radius); padding:22px; }
.feature .ic { font-size:22px; }
.feature h3 { margin:12px 0 6px; font-size:16px; color:#fff; }
.feature p { margin:0; color:#aab4d6; font-size:14px; line-height:1.55; }

.footer-note { max-width:1080px; margin:0 auto; padding: 0 24px 48px; color:#7e89ad; font-size:13px; }
.footer-note a { color:#9fb0ff; }

/* ====== auth ====== */
.auth-wrap { min-height: calc(100vh - 39px); display:grid; place-items:center; padding:40px 16px; background: var(--surface-2); }
.auth-card { width:100%; max-width:420px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:30px; }
.auth-card h2 { margin:6px 0 4px; font-size:22px; }
.auth-card .sub { color:var(--ink-soft); font-size:14px; margin:0 0 22px; }
.field { margin-bottom:14px; }
.field label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink-soft); }
.input { width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px; font:inherit; font-size:15px; background:#fff; }
.input:focus { outline:2px solid var(--brand-soft); border-color:var(--brand); }
.otp-input { letter-spacing:.4em; text-align:center; font-size:22px; font-weight:700; }
.hint { font-size:12px; color:var(--muted); margin-top:8px; }
.persona-grid { display:grid; gap:10px; margin-top:8px; }
.persona { text-align:left; border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:#fff; cursor:pointer; display:flex; align-items:center; gap:12px; transition:border .15s, background .15s; }
.persona:hover { border-color:var(--brand); background:var(--brand-soft); }
.persona .avi { width:36px;height:36px;border-radius:9px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;font-weight:700; }
.persona .meta strong { display:block; font-size:14px; }
.persona .meta span { font-size:12px; color:var(--muted); }
.back-link { background:none;border:none;color:var(--ink-soft);cursor:pointer;font:inherit;font-size:13px;padding:0;margin-bottom:14px; }

/* ====== app frame (portal/admin) ====== */
.frame { min-height: calc(100vh - 39px); display:flex; flex-direction:column; background:var(--surface-2); }
.topbar { background:var(--surface); border-bottom:1px solid var(--line); padding:0 20px; height:60px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:39px; z-index:5; }
.topbar .left { display:flex; align-items:center; gap:14px; }
.tenant-pill { display:flex; align-items:center; gap:9px; font-weight:700; font-size:15px; }
.tenant-pill .logo { width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:#fff;font-weight:800;font-size:13px; }
.role-tag { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); border:1px solid var(--line); padding:3px 8px; border-radius:999px; }
.topbar .right { display:flex; align-items:center; gap:12px; }
.who { font-size:13px; color:var(--ink-soft); text-align:right; }
.who strong { display:block; color:var(--ink); }

.tenant-switch { display:flex; align-items:center; gap:8px; }
.tenant-switch select { font:inherit; font-size:13px; padding:7px 10px; border-radius:9px; border:1px solid var(--line); background:#fff; }

.tabs { display:flex; gap:4px; padding:12px 20px 0; background:var(--surface); border-bottom:1px solid var(--line); overflow-x:auto; }
.tab { font:inherit; font-size:14px; font-weight:600; color:var(--ink-soft); background:none; border:none; padding:10px 14px; cursor:pointer; border-bottom:2px solid transparent; white-space:nowrap; }
.tab:hover { color:var(--ink); }
.tab.active { color:var(--brand); border-bottom-color:var(--brand); }

.content { padding:24px 20px 60px; max-width:1000px; margin:0 auto; width:100%; }
.page-title { font-size:22px; margin:0 0 4px; }
.page-sub { color:var(--ink-soft); font-size:14px; margin:0 0 22px; }

.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.card + .card { margin-top:16px; }
.card-head { padding:16px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.card-head h3 { margin:0; font-size:16px; }
.card-body { padding:18px; }

.summary-grid { display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); margin-bottom:20px; }
.stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); }
.stat .label { font-size:13px; color:var(--muted); }
.stat .value { font-size:26px; font-weight:800; margin-top:4px; letter-spacing:-0.02em; }

/* tables / lists */
.row-list { display:flex; flex-direction:column; }
.line { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px; border-bottom:1px solid var(--line); }
.line:last-child { border-bottom:none; }
.line .info strong { display:block; font-size:15px; }
.line .info span { font-size:13px; color:var(--muted); }
.line .amt { font-weight:700; font-size:15px; }
.line .trailing { display:flex; align-items:center; gap:12px; }

/* calendar */
.cal { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.cal-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--line); }
.cal-head h3 { margin:0; font-size:16px; }
.cal-nav { display:flex; gap:6px; }
.cal-nav button { width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:#fff;cursor:pointer;font-size:16px; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); }
.cal-dow { font-size:12px; font-weight:700; color:var(--muted); text-align:center; padding:10px 0; border-bottom:1px solid var(--line); }
.cal-cell { min-height:84px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:6px; position:relative; }
.cal-cell:nth-child(7n) { border-right:none; }
.cal-cell .num { font-size:12px; color:var(--ink-soft); }
.cal-cell.out .num { color:#c7cee0; }
.cal-cell.today .num { background:var(--brand); color:#fff; border-radius:50%; width:22px;height:22px; display:grid;place-items:center; }
.ev { font-size:11px; font-weight:600; border-radius:6px; padding:2px 6px; margin-top:4px; color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.legend { display:flex; gap:14px; flex-wrap:wrap; padding:12px 18px; font-size:12px; color:var(--ink-soft); }
.legend .lg { display:inline-flex; align-items:center; gap:6px; }
.legend .sw { width:12px;height:12px;border-radius:3px; }

/* slots */
.slot-grid { display:grid; gap:10px; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
.slot { border:1px solid var(--line); border-radius:10px; padding:12px; background:#fff; text-align:left; cursor:pointer; transition:border .15s, background .15s; }
.slot:hover:not(:disabled) { border-color:var(--brand); background:var(--brand-soft); }
.slot strong { display:block; font-size:14px; }
.slot span { font-size:12px; color:var(--muted); }
.slot:disabled { opacity:.45; cursor:not-allowed; background:var(--surface-2); }
.slot.booked { border-color:var(--green); }

/* notices */
.notice { padding:16px 18px; border-bottom:1px solid var(--line); }
.notice:last-child { border-bottom:none; }
.notice .nhead { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.notice h4 { margin:0; font-size:15px; }
.notice .body { color:var(--ink-soft); font-size:14px; margin:6px 0 12px; line-height:1.55; }
.notice .date { font-size:12px; color:var(--muted); }

/* isolation banner */
.iso { display:flex; gap:12px; align-items:flex-start; background:var(--brand-soft); border:1px solid #d6dafc; color:#3730a3; border-radius:var(--radius); padding:14px 16px; font-size:13px; line-height:1.5; margin-bottom:20px; }
.iso .ic { font-size:18px; }

/* empty state */
.empty { text-align:center; color:var(--muted); padding:40px 20px; font-size:14px; }

/* modal */
.modal-host { position:fixed; inset:0; background:rgba(15,23,41,.5); display:grid; place-items:center; padding:20px; z-index:50; }
.modal { background:#fff; border-radius:var(--radius); box-shadow:var(--shadow-lg); width:100%; max-width:420px; padding:24px; }
.modal h3 { margin:0 0 6px; font-size:19px; }
.modal p { color:var(--ink-soft); font-size:14px; margin:0 0 18px; line-height:1.5; }
.modal .pay-line { display:flex; justify-content:space-between; font-size:14px; padding:8px 0; border-bottom:1px solid var(--line); }
.modal .pay-total { display:flex; justify-content:space-between; font-weight:800; font-size:17px; padding:12px 0 18px; }
.modal-actions { display:flex; gap:10px; }
.stripe-note { font-size:12px; color:var(--muted); text-align:center; margin-top:14px; }

/* toast */
#toast-host { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; gap:8px; z-index:80; }
.toast { background:#111a30; color:#fff; padding:12px 16px; border-radius:10px; font-size:14px; box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:10px; animation:rise .25s ease; }
.toast.ok { background:#15803d; }
@keyframes rise { from { opacity:0; transform:translateY(10px);} to {opacity:1; transform:none;} }

@media (max-width:560px){
  .who { display:none; }
  .cal-cell { min-height:60px; }
}
