/* Keenetic captive portal — shared styles.
   Tokens and metrics are taken verbatim from design/Captive Portal Hi-Fi.dc.html. */

:root {
  /* Always light: no device dark mode, and no "auto dark" forced by Chrome / Samsung Internet. */
  color-scheme: only light;
  --page: #eee9e0;
  --card: #f7f3ea;
  --surface: #fffdf8;
  --ink: #22303a;
  --ink-body: #2b241a;
  --muted: #5d6b72;
  --muted-2: #7c898f;
  --muted-3: #93a1a0;
  --line: #b9c6c4;
  --line-soft: #dde4e0;
  --line-faint: #edf0ea;
  --divider: #d5ddd8;
  --accent: #3a7d8c;
  --accent-deep: #2e6371;
  --accent-tint: #e7eee9;
  --accent-shadow: rgba(58, 125, 140, .35);
  --ok: #33735a;
  --ok-tint: #e7f0e9;
  --ok-line: #9db8a4;
  --err: #a94f38;
  --err-text: #8c3a29;
  --err-tint: #fbf1ec;
  --err-line: #cf8672;
  --err-line-soft: #ecc9bf;
  --err-line-faint: #e3c0b6;
  --chip-grey: #eef0e9;
  --bar-muted: #c3d3d2;
  --avatar: #dfe7e2;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --sans: Karla, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

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

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--card);
  font-family: var(--sans);
  color: var(--ink-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: #9a5a32; }
a:hover { color: #7c4526; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Anything that acts like a button gets a hand cursor, not the text I-beam. */
[role="button"], [role="link"], label.field, .field__value { cursor: pointer; }

[hidden] { display: none !important; }

/* App shell ------------------------------------------------------------
   Full-bleed on every screen size: below the desktop breakpoint (960px) the
   phone layout fills the viewport with no card frame around it; from 960px up
   the desktop layouts in guest.css / staff.css take over. */

.card {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen--center {
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

/* Typography ---------------------------------------------------------- */

.eyebrow {
  font: 600 12px var(--sans);
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.eyebrow--muted { color: var(--muted-2); }
.eyebrow--sm { font-size: 11px; }
.eyebrow::before { content: "\2726\00a0\00a0"; }

.title {
  font: 600 32px/1.12 var(--serif);
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-body);
}
.title--xl { font-size: 46px; line-height: 1.05; margin-top: 14px; }
.title--lg { font-size: 36px; line-height: 1.15; margin-top: 14px; }
.title--page { font-size: 28px; line-height: 1.15; margin: 0; text-align: left; }
.title--sheet { font-size: 24px; line-height: 1.2; margin: 0; text-align: left; }

.lead { font: 400 14.5px var(--sans); color: var(--muted); margin-top: 8px; text-align: center; }
.lead--lg { font-size: 15px; margin-top: 14px; }
.lead b, .lead strong { color: var(--ink); font-weight: 700; }
.lead .mono { font-family: var(--mono); font-weight: 600; }

.note { font: 400 12.5px var(--sans); color: var(--muted-2); text-align: center; }
.note--left { text-align: left; }
.subtitle { font: 400 13.5px var(--sans); color: var(--muted-2); margin-top: 4px; }

.mono { font-family: var(--mono); }

/* Buttons ------------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  border-radius: 14px;
  padding: 16px 20px;
  text-align: center;
  font: 700 16px var(--sans);
  transition: transform .08s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-shadow);
}
.btn--primary:hover { filter: brightness(1.04); }
.btn--secondary {
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--line);
  padding: 14px;
  font-weight: 600;
  font-size: 15px;
}
.btn--sm {
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  box-shadow: none;
}
.btn[disabled] { opacity: .55; cursor: default; }

/* Segmented duration picker ------------------------------------------ */

.seg { display: flex; gap: 10px; }
.seg__opt {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 0;
  text-align: center;
  font: 600 14px var(--sans);
  background: var(--surface);
  color: var(--muted);
}
.seg__opt[aria-pressed="true"] {
  border: 2px solid var(--accent);
  padding: 11.5px 0;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 700;
}
.seg--sheet .seg__opt { padding: 11px 0; background: var(--card); }
.seg--sheet .seg__opt[aria-pressed="true"] { padding: 10.5px 0; background: var(--accent-tint); }

/* Fields -------------------------------------------------------------- */

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
  text-align: left;
}
.field__icon { font: 400 16px var(--sans); }
.field__body { display: block; flex: 1; min-width: 0; }
.field__label { display: block; font: 400 11.5px var(--sans); color: var(--muted-2); }
.field__value { display: block; font: 600 14.5px var(--sans); color: var(--ink); }
.field__chev { color: var(--muted-2); }
.field input[type="datetime-local"] {
  font: 600 14.5px var(--sans);
  color: var(--ink);
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
}

.search {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  font: 400 14px var(--sans);
  color: var(--ink);
}
.search::placeholder { color: var(--muted-3); }

.input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 13px 16px;
  font: 700 16px var(--sans);
  color: var(--ink-body);
}

.label { font: 600 12.5px var(--sans); color: var(--muted-2); margin-bottom: 6px; }
.section-label { font: 600 14px var(--sans); color: var(--muted); }

/* Chips --------------------------------------------------------------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 14px;
  font: 600 12.5px var(--sans);
}
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 700;
}

/* Lists --------------------------------------------------------------- */

.list {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-faint);
  width: 100%;
  text-align: left;
  position: relative;
  background: var(--surface);
  transition: transform .18s ease;
}
.row:last-child { border-bottom: 0; }
.row { cursor: default; }
.row[role="button"] { cursor: pointer; }
.row__body { flex: 1; min-width: 0; }
.row__title { font: 700 14.5px var(--sans); color: var(--ink-body); }
.row__code { font: 700 15px var(--mono); color: var(--ink-body); }
.row__meta { font: 400 12px var(--sans); color: var(--muted-2); margin-top: 2px; }
.row--expired .row__code, .row--expired .row__meta { color: var(--muted-3); }
.row--empty { justify-content: center; font: 400 13px var(--sans); color: var(--muted-3); }

.pill {
  border-radius: 12px;
  padding: 4px 10px;
  font: 700 11.5px var(--sans);
  white-space: nowrap;
}
.pill--active { background: var(--ok-tint); color: var(--ok); }
.pill--unused { background: var(--chip-grey); color: var(--muted); }
.pill--expired { background: var(--chip-grey); color: var(--muted-3); }

.kick {
  border: 1.5px solid var(--err-line-faint);
  color: var(--err);
  border-radius: 12px;
  padding: 5px 12px;
  font: 700 12px var(--sans);
  background: var(--err-tint);
}

/* Trash button on voucher rows */
.row__delete {
  width: 34px;
  height: 34px;
  margin: -6px -8px -6px 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 15px var(--sans);
  color: var(--line);
  flex: none;
  transition: color .12s ease, background .12s ease;
}
.row__delete:hover, .row__delete:focus-visible { color: var(--err); background: var(--err-tint); }
.btn--danger {
  background: var(--err-tint);
  color: var(--err);
  border: 1.5px solid var(--err-line-faint);
  padding: 13px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  box-shadow: none;
}

/* Tab bar ------------------------------------------------------------- */

.tabbar {
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex;
  justify-content: space-around;
  padding: 14px 0 18px;
}
.tabbar__item {
  font: 600 12px/1.35 var(--sans);
  color: var(--muted-3);
  text-align: center;
  min-width: 60px;
}
.tabbar__item[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabbar__icon { display: block; }

/* Stats --------------------------------------------------------------- */

.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px 16px;
}
.stat__value { font: 600 30px/1.15 var(--serif); color: var(--ink-body); }
.stat__label { font: 400 12px var(--sans); color: var(--muted-2); }

.chart {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px;
}
.chart__title { font: 600 13px var(--sans); color: var(--muted); }
.chart__bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; margin-top: 14px; }
.chart__bar { flex: 1; background: var(--bar-muted); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart__bar--hi { background: var(--accent); }
.chart__note { font: 400 11.5px var(--sans); color: var(--muted-2); margin-top: 10px; }

/* Bottom sheet -------------------------------------------------------- */

.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(207, 214, 203, .92);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn .18s ease;
}
.sheet {
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 22px 26px 30px;
  box-shadow: 0 -8px 24px rgba(34, 48, 58, .16);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideUp .22s ease;
}
.sheet__handle { width: 40px; height: 4px; border-radius: 2px; background: var(--divider); margin: 0 auto; }

@media (min-width: 960px) {
  .sheet-backdrop { justify-content: center; align-items: center; }
  .sheet { width: 440px; border-radius: 22px; padding: 26px 30px 30px; box-shadow: 0 16px 40px rgba(34, 48, 58, .22); }
  .sheet__handle { display: none; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* Toast --------------------------------------------------------------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font: 600 13px var(--sans);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.toast.is-visible { opacity: 1; }

/* Utilities ----------------------------------------------------------- */

.spacer { flex: 1; }
@media (max-width: 959.98px) { .desktop-only { display: none !important; } }
@media (min-width: 960px) { .mobile-only { display: none !important; } }
.hr-short { width: 56px; border-top: 1px solid var(--divider); margin: 16px 0; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-22 { margin-top: 22px; }
.mt-26 { margin-top: 26px; } .mt-36 { margin-top: 36px; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: 0s !important; }
}
