/* PAULSAVZ HOTSPOT - customer captive portal. Mobile first. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #15181d;
  --muted: #5c6470;
  --dim: #8b93a1;
  --line: #e2e5ea;
  --brand: #f07300;
  --brand-ink: #17120c;
  --ok: #0f9d58;
  --warn: #b8860b;
  --bad: #c62828;
  --radius: 0.8rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a20;
    --text: #e8eaed;
    --muted: #9aa3af;
    --dim: #6b7280;
    --line: #262b33;
    --ok: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 0 0 2rem;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

main { max-width: 27rem; margin: 0 auto; padding: 0 1rem; }

header {
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1rem 1.1rem;
  text-align: center;
}
header h1 { margin: 0; font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
header h1 span { color: var(--brand); }
header p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.85rem; }

.testbar {
  background: #f07300;
  color: var(--brand-ink);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  padding-top: calc(0.4rem + env(safe-area-inset-top, 0px));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 0.85rem;
}

h2 { font-size: 0.95rem; margin: 0 0 0.75rem; }

/* ---------- packages ---------- */

.pkg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 3.5rem;
}
.pkg:hover, .pkg:focus-visible { border-color: var(--brand); outline: none; }
.pkg .name { font-weight: 650; }
.pkg .meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.pkg .price { font-size: 1.05rem; font-weight: 700; color: var(--brand); white-space: nowrap; }

/* ---------- forms ---------- */

label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
input[type=tel], input[type=text] {
  width: 100%;
  padding: 0.75rem 0.8rem;
  font-size: 1.05rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-bottom: 0.9rem;
}
input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  min-height: 3rem;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 500;
  margin-top: 0.5rem;
}

.error {
  background: #fdecea;
  color: #8b1a1a;
  border-left: 3px solid var(--bad);
  padding: 0.7rem 0.8rem;
  border-radius: 0 0.4rem 0.4rem 0;
  font-size: 0.87rem;
  margin-bottom: 0.9rem;
}
@media (prefers-color-scheme: dark) { .error { background: #2a1414; color: #fca5a5; } }

.notice {
  background: #fff8ec;
  border-left: 3px solid var(--brand);
  padding: 0.7rem 0.8rem;
  border-radius: 0 0.4rem 0.4rem 0;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  color: var(--text);
}
@media (prefers-color-scheme: dark) { .notice { background: #1b1409; color: #f3d3ae; } }

/* ---------- status / usage ---------- */

.big { text-align: center; padding: 0.5rem 0 0.25rem; }
.big .v { font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.big .k { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.stat { text-align: center; padding: 0.6rem; background: var(--bg); border-radius: 0.5rem; }
.stat .v { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.track { height: 0.6rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: 0.6rem 0 0.35rem; }
.track > i { display: block; height: 100%; background: var(--ok); transition: width 0.4s; }
.track.warn > i { background: var(--warn); }
.track.bad > i { background: var(--bad); }

.rowline { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.rowline:last-child { border-bottom: 0; }
.rowline span:first-child { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill.ok { background: #e6f4ea; color: #0b6b3a; }
.pill.warn { background: #fff4d6; color: #7a5b00; }
.pill.bad { background: #fdecea; color: #8b1a1a; }
@media (prefers-color-scheme: dark) {
  .pill.ok { background: #0e2a20; color: var(--ok); }
  .pill.warn { background: #2a2109; color: var(--warn); }
  .pill.bad { background: #2a1414; color: var(--bad); }
}

.spinner {
  width: 2.1rem; height: 2.1rem; margin: 0.5rem auto 0.9rem;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

footer { text-align: center; color: var(--dim); font-size: 0.75rem; padding: 1.25rem 1rem 0; }
footer .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.7rem; }
footer nav { display: flex; gap: 1.1rem; justify-content: center; margin-bottom: 0.6rem; }
footer nav a { color: var(--muted); }
