/* RevuAI: Liquid Glass. Frosted translucent panels over a soft colour field.
   Native system font, no external assets (CSP). Fits one phone screen. */

:root {
  --text: #10131f;
  --text-muted: #3f4566;
  --brand: #1b2140;          /* ink */
  --brand-text: #ffffff;
  --accent: #5a4bff;         /* the "AI" violet */
  --star: #f5a800;
  --star-off: rgb(16 19 31 / 0.18);
  --danger: #b42318;
  --success-text: #1e6b2f;
  --warning-text: #8a5300;
  --focus: #3d5afe;
  --mark-star: #ffc94d;

  --glass-bg: rgb(255 255 255 / 0.42);
  --glass-border: rgb(255 255 255 / 0.65);
  --glass-highlight: rgb(255 255 255 / 0.85);
  --glass-shadow: 0 8px 24px rgb(30 40 80 / 0.12);
  --glass-blur: blur(22px) saturate(180%);
  --solid-surface: #f7f8fc;  /* fallback when blur/transparency isn't available */
  --input-border: rgb(16 19 31 / 0.15);

  --field-base: #eef0f8;
  --blob-1: rgb(255 170 90 / 0.75);
  --blob-2: rgb(120 140 255 / 0.70);
  --blob-3: rgb(80 200 190 / 0.55);
  --blob-4: rgb(240 120 200 / 0.50);

  --radius-sm: 14px;
  --radius: 18px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 150ms;
  color-scheme: light;
}

/* Dark mode is off for now (light for everyone). To turn it back on, set <html data-theme="auto"> in _Layout. */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --text: #eef0fa;
    --text-muted: #b9bfda;
    --brand: #ffffff;
    --brand-text: #10131f;
    --accent: #a99cff;
    --star-off: rgb(255 255 255 / 0.22);
    --danger: #f97066;
    --success-text: #9fdcab;
    --warning-text: #f5c26b;
    --focus: #9db0ff;
    --mark-star: #10131f;

    --glass-bg: rgb(28 32 52 / 0.48);
    --glass-border: rgb(255 255 255 / 0.14);
    --glass-highlight: rgb(255 255 255 / 0.18);
    --glass-shadow: 0 8px 28px rgb(0 0 0 / 0.35);
    --solid-surface: #1b1f33;
    --input-border: rgb(255 255 255 / 0.18);

    --field-base: #0c0f1d;
    --blob-1: rgb(255 140 60 / 0.35);
    --blob-2: rgb(100 110 255 / 0.40);
    --blob-3: rgb(40 170 160 / 0.30);
    --blob-4: rgb(220 90 180 / 0.30);
  }
}

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

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

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--field-base);
  -webkit-font-smoothing: antialiased;
}

/* Soft colour field behind the glass. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 30% at 15% 12%, var(--blob-1), transparent 70%),
    radial-gradient(45% 35% at 90% 25%, var(--blob-2), transparent 70%),
    radial-gradient(50% 40% at 20% 85%, var(--blob-3), transparent 70%),
    radial-gradient(45% 35% at 85% 90%, var(--blob-4), transparent 70%),
    var(--field-base);
}

h1 { text-wrap: balance; }

a { color: var(--brand); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.skip-link { position: absolute; left: 8px; top: -48px; padding: 8px 12px; background: var(--solid-surface); color: var(--text); border-radius: 10px; z-index: 100; }
.skip-link:focus { top: 8px; }

/* ---------- Glass material ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

/* No blur support, or the user asked for less transparency: use solid surfaces. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--solid-surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--solid-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Shell ---------- */
.topbar { display: flex; justify-content: center; padding: calc(12px + env(safe-area-inset-top)) 16px 0; }
.logo-pill { display: inline-flex; padding: 6px 14px; border-radius: 999px; }

.brand { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.brand-mark { color: var(--brand); }
.brand-mark-star { fill: var(--mark-star); }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.brand-ai { color: var(--accent); }

.container { width: 100%; max-width: 480px; margin: 0 auto; padding: 10px 16px 6px; flex: 1; }
.container:focus { outline: none; }

.footer { text-align: center; padding: 4px 16px calc(10px + env(safe-area-inset-bottom)); color: var(--text-muted); font-size: 0.75rem; }
.footer p { margin: 0; }

/* ---------- Review page ---------- */
.hero { margin-bottom: 12px; padding: 14px 16px; border-radius: var(--radius-lg); text-align: center; }

.eyebrow { margin: 0; color: var(--text-muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.business { margin: 3px 0 4px; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }

.lead { margin: 0 auto; max-width: 36ch; color: var(--text-muted); font-size: 0.84rem; }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.option {
  position: relative;
  display: block;
  padding: 10px 40px 10px 14px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.option:active { transform: scale(0.985); }
@media (hover: hover) { .option:hover { border-color: var(--accent); } }

.option-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stars { display: inline-flex; gap: 2px; }
.star.on { color: var(--star); }
.star.off { color: var(--star-off); }
.rating-label { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }

.option-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 3px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.chevron { position: absolute; right: 12px; top: 50%; margin-top: -9px; color: var(--text-muted); }

.button-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  touch-action: manipulation;
}

.trust { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 10px 0 0; color: var(--text-muted); font-size: 0.75rem; }
.trust svg { flex: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgb(16 19 31 / 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  z-index: 40;
}
.toast svg { color: #ffc94d; }
.toast[hidden] { display: none; }

/* Short phones (e.g. iPhone SE): tighten so everything still fits without scrolling. */
@media (max-height: 740px) {
  .hero { margin-bottom: 8px; padding: 10px 14px; }
  .lead { display: none; }
  .options { gap: 6px; }
  .option { padding: 8px 40px 8px 12px; }
  .option-text { -webkit-line-clamp: 1; line-clamp: 1; }
  .button-secondary { margin-top: 8px; min-height: 44px; }
  .trust { margin-top: 6px; }
}

/* ---------- Notice pages ---------- */
.notice { margin-top: 10vh; padding: 32px 24px; text-align: center; border-radius: var(--radius-lg); }
.notice-icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-muted); }
.notice h1 { margin: 0 0 6px; font-size: 1.3rem; }
.notice p { margin: 0; color: var(--text-muted); }

/* ---------- Admin (solid, readable surfaces on the same field) ---------- */
.admin h1 { font-size: 1.4rem; margin: 6px 0 14px; }
.admin h2 { font-size: 1.0625rem; margin: 26px 0 8px; }
.admin code { background: var(--glass-bg); padding: 2px 6px; border-radius: 6px; font-size: 0.95em; }
.crumbs { margin: 0; font-size: 0.875rem; }
.crumbs a { text-decoration: none; }
.muted { color: var(--text-muted); }

.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats li { padding: 12px; background: var(--solid-surface); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); text-align: center; color: var(--text-muted); font-size: 0.8125rem; }
.stats strong { display: block; font-size: 1.5rem; color: var(--text); }

.form { display: grid; gap: 6px; }
.form label { font-weight: 600; margin-top: 12px; font-size: 0.9375rem; }
.form input, .form select { font: inherit; min-height: 46px; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--solid-surface); color: var(--text); }
.form small { color: var(--text-muted); font-size: 0.8125rem; }
.or { color: var(--text-muted); margin: 14px 0 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; margin-top: 14px; padding: 10px 20px;
  border: 0; border-radius: 12px;
  background: var(--brand); color: var(--brand-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.button.secondary { background: var(--solid-surface); color: var(--text); border: 1px solid var(--input-border); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }

.link { font: inherit; background: none; border: 0; color: var(--brand); padding: 8px 0; margin-top: 24px; cursor: pointer; }

.error { color: var(--danger); font-size: 0.9375rem; }
.error ul { margin: 0; padding-left: 18px; }
.success { background: var(--solid-surface); color: var(--success-text); border-radius: var(--radius); padding: 2px 16px 16px; }
.success strong { color: inherit; }
.confirm { background: var(--solid-surface); border-radius: var(--radius); padding: 2px 16px 16px; }

.small { font-size: 0.8125rem; }
.attention { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--danger); background: var(--solid-surface); border-radius: 6px; font-size: 0.9375rem; }
.attention a { color: var(--text); font-weight: 600; }

/* Stand status: coloured text, no badges */
.status { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.status-active { color: var(--success-text); }
.status-expiringsoon { color: var(--warning-text); }
.status-expired { color: var(--danger); }
.status-paused, .status-unassigned { color: var(--text-muted); }

.filter { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem auto; gap: 6px; margin-bottom: 10px; }
.filter input, .filter select { font: inherit; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--solid-surface); color: var(--text); }
.admin .filter .button { margin: 0; min-height: 44px; padding: 8px 14px; }

.rows { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--input-border); }
.rows li { border-bottom: 1px solid var(--input-border); }
.rows a { display: grid; gap: 2px; padding: 10px 2px; color: var(--text); text-decoration: none; }
.rows a:hover .row-name { text-decoration: underline; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--text-muted); font-size: 0.8125rem; }

.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notice-line { margin: 0 0 10px; padding: 10px 12px; background: var(--solid-surface); border-left: 3px solid var(--success-text); border-radius: 6px; font-size: 0.9375rem; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 12px 14px; background: var(--solid-surface); border-radius: var(--radius-sm); }
.facts dt { color: var(--text-muted); font-size: 0.875rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.inline-form { display: grid; gap: 4px; margin-top: 12px; }
.inline-form label { font-size: 0.875rem; color: var(--text-muted); }
.inline-fields { display: flex; gap: 6px; }
.inline-fields input { flex: 1; font: inherit; min-height: 46px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--solid-surface); color: var(--text); }
.inline-fields .button { margin: 0; }
.admin form > .button { margin-top: 4px; }

.mini-table { border-collapse: collapse; margin: 8px 0 0; min-width: 160px; font-size: 0.9375rem; }
.mini-table caption { text-align: left; padding-bottom: 4px; }
.mini-table th { text-align: left; font-weight: 500; padding: 2px 24px 2px 0; }
.mini-table td { text-align: right; font-variant-numeric: tabular-nums; }

.edit { margin-top: 12px; background: var(--solid-surface); border-radius: var(--radius-sm); padding: 4px 14px; }
.edit summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--brand); }
.edit .form { padding-bottom: 12px; }
.edit .form label { margin-top: 6px; }

.history { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--input-border); }
.history .muted { font-size: 0.8125rem; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
