/* Carvia's own pages: sign-in, account, people.

   The look is the car app's own (..\sienna-remote\web\app.css), which Aaron chose to keep (21 Nov 2026:
   "I want to stay with this color theme"): deep navy, glass cards with a thin blue edge, blue light on
   what you press, bold titles. The colours, the page's light and the sizes of titles, cards and fields
   below are the car app's; Carvia adds its logo. If the car app's colours change, change them here too. */
:root {
  color-scheme: dark;
  --bg: #050a14;
  --card: #0c1628;
  --card-2: #13213a;
  --line: rgba(124, 168, 255, 0.13);
  --line-2: rgba(124, 168, 255, 0.24);
  --glass: linear-gradient(180deg, rgba(23, 39, 66, 0.74), rgba(10, 20, 37, 0.78));
  --glass-2: rgba(30, 48, 78, 0.5);
  --edge: rgba(124, 168, 255, 0.17);
  --edge-hi: rgba(255, 255, 255, 0.07);
  --text: #eef3fb;
  --text-2: #d3ddee;
  --muted: #8e9eb7;
  --faint: #5c6a82;
  --accent: #3d9cff;
  --accent-2: #1f6bff;
  --accent-soft: rgba(61, 156, 255, 0.16);
  --accent-glow: rgba(61, 156, 255, 0.55);
  --on-accent: #ffffff;
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.15);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.15);
  --radius: 22px;
  --radius-s: 14px;
  --shadow: inset 0 1px 0 var(--edge-hi), 0 18px 44px rgba(0, 0, 0, 0.38);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: transparent; /* the page's light (below) sits behind everything: a colour here would cover it */
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* the page's light, as in the car app: a blue haze up top, a glow low on the left, a thin curve of light */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
body::before {
  inset: 0;
  background:
    radial-gradient(60vw 46vh at 74% -8%, rgba(38, 104, 255, 0.26), transparent 70%),
    radial-gradient(52vw 44vh at -6% 104%, rgba(36, 118, 255, 0.24), transparent 70%),
    radial-gradient(90vw 70vh at 34% 44%, rgba(18, 40, 82, 0.5), transparent 72%);
}
body::after {
  width: 150vw; height: 110vh; left: 28vw; top: -96vh; border-radius: 50%;
  border-bottom: 2px solid rgba(96, 166, 255, 0.5);
  box-shadow: 0 26px 70px -24px rgba(56, 128, 255, 0.45);
  transform: rotate(-9deg); filter: blur(0.6px);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons, fields */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--glass-2);
  box-shadow: inset 0 1px 0 var(--edge-hi);
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text);
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary {
  background: linear-gradient(180deg, #4aa6ff, var(--accent-2)); border-color: rgba(140, 196, 255, 0.55);
  color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 22px -4px var(--accent-glow);
}
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); }
.btn.google { background: #ffffff; color: #1f1f1f; border-color: #dadce0; box-shadow: none; }
.btn.google svg { width: 20px; height: 20px; }

.field { display: grid; gap: 6px; text-align: left; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-s);
  background: var(--card-2); border: 1px solid var(--line-2);
}
.field input::placeholder { color: var(--faint); }
/* the box being typed in, as in the car app: a blue edge and a soft ring, not a second frame around it */
.field input:focus-visible, .field select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i {
  flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2);
  position: relative; transition: background 0.2s ease, border-color 0.2s ease;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--text); transition: transform 0.2s ease;
}
.switch input:checked + i { background: var(--accent-2); border-color: rgba(140, 196, 255, 0.55); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.02em; background: var(--accent-soft); color: var(--accent);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plain { background: rgba(142, 158, 183, 0.14); color: var(--muted); }

.message { font-size: 14px; color: var(--muted); }
.message:empty { display: none; }
.message.bad { color: var(--bad); }
.message.good { color: var(--ok); }

/* ---------------------------------------------------------------- signing in */

/* the card in the middle of the screen, built like the car app's own sign-in card */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 28px; padding: 36px 28px 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px; text-align: center;
}
/* Carvia's own logo files, cut from Aaron's logo and never redrawn (brand/make_assets.py): his app icon
   (icon.png), the roof line over the name (logo.png), the name alone (wordmark.png) */
.logo { margin: 6px 0 6px; }
.logo img { display: block; width: min(250px, 80%); height: auto; margin: 0 auto; }
.logo.small img { width: min(170px, 60%); }
.gate-card h1 { font-size: 26px; font-weight: 700; }
.gate-card .lead { color: var(--muted); margin-top: -8px; }
.gate-card form { display: grid; gap: 12px; }
.gate-card section { display: grid; gap: 14px; }
.gate-card .lead b { color: var(--text-2); font-weight: 600; }
.gate-card .lead + .lead { margin-top: -4px; }
.gate-card .switch { text-align: left; }
.break { overflow-wrap: anywhere; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.fine { font-size: 13px; color: var(--faint); }

/* ---------------------------------------------------------------- the account and people pages */

.page { width: min(980px, 100%); margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.brand { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 700; font-size: 18px; }
.brand { min-height: 40px; }
.brand .wordmark { display: block; height: 16px; width: auto; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* An owner has two buttons up here. On a phone they wouldn't fit beside the name and would drop under it,
   so there they are their pictures alone (the words stay for a screen reader and as the hint). */
@media (max-width: 520px) {
  .top-actions:has(> .btn:not([hidden]) ~ .btn:not([hidden])) .btn { width: 40px; min-height: 40px; padding: 0; }
  .top-actions:has(> .btn:not([hidden]) ~ .btn:not([hidden])) .btn span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

.card {
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; align-content: start;
}
.card h2 { font-size: 19px; font-weight: 700; }
.card .lead { color: var(--muted); font-size: 15px; }
.card form { display: grid; gap: 12px; }
/* One column on a phone, two on a tablet or a computer. Cards in a row are the same height, so every
   edge lines up; a card marked "wide" takes the whole row. */
.cards { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards > .wide { grid-column: 1 / -1; }
}
/* inside the wide card: the number and the words on the left, the facts on the right */
.split { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-items: start; }
}
.stack { display: grid; gap: 14px; align-content: start; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 26px; }
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.14; }
.hero .lead { color: var(--muted); margin-top: 6px; }
.hero .btn { min-height: 54px; padding: 0 28px; font-size: 17px; }

.big { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
/* the words to text: an even grid, four to a row, so they line up on every screen */
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 34px; padding: 0 6px; border-radius: 999px;
  background: rgba(5, 10, 20, 0.5); border: 1px solid var(--line-2); font-size: 13px; font-weight: 650;
  letter-spacing: 0.04em; color: var(--text-2);
}
.rows { display: grid; }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows dt, .rows .k { color: var(--muted); white-space: nowrap; }
.rows dd, .rows .v { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row.end > * { flex: 0 0 auto; min-width: 150px; }
/* two buttons with long words: side by side where they fit on one line each, one under the other on a phone */
.row.long > * { flex-basis: 190px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.note { font-size: 14px; color: var(--muted); }
.note b { color: var(--text-2); font-weight: 650; }

.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-s); background: rgba(5, 10, 20, 0.45); border: 1px solid var(--line);
}
.item .what { display: grid; gap: 2px; min-width: 0; }
.item .what small { color: var(--muted); font-size: 13px; }

/* the people page */
.page > .message { padding: 0 6px; font-size: 15px; }
.asking { border-color: rgba(251, 191, 36, 0.38); }
.item.ask { flex-wrap: wrap; padding: 14px 16px; }
.item.ask .what { gap: 4px; }
.item.ask .what span { font-weight: 650; font-size: 16px; }
.item.ask .what small { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.item.ask .what small b { font-weight: 400; white-space: nowrap; }
.item.ask .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.item.ask .actions .btn { min-width: 104px; }
@media (max-width: 520px) { .item.ask .actions { width: 100%; } }

/* Every person's card is built the same way, so the cards line up across a row: the name with the
   state on its right, one line of tags, the facts, and two buttons at the bottom. */
.people { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; }
.person { display: flex; flex-direction: column; gap: 14px; }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.person-head h2 { font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-head .badge { flex: none; }
.person .tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-top: -6px; }
.person .tags .plain-word { color: var(--muted); font-size: 13px; line-height: 24px; }
.person .rows { margin: 0; }
.person .actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.person .actions .btn { width: 100%; padding: 0 10px; }
/* "More" opens exactly over the card's own facts: the card keeps its size, so the cards beside it
   don't move, and no line of the facts is left half covered. */
.person .body { position: relative; }
.person .menu {
  position: absolute; inset: -8px -10px; z-index: 5;
  display: grid; gap: 8px; padding: 12px; border-radius: 18px; align-content: start; overflow: auto;
  background: #101c33; border: 1px solid var(--line-2); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}
.person .menu .btn { width: 100%; justify-content: flex-start; padding: 0 16px; }
.person .menu .field { margin-bottom: 2px; }
.person.open .actions .btn:last-child { border-color: rgba(140, 196, 255, 0.55); color: var(--accent); }
.add-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
/* the link to join, shown whole so it can be read and checked (a long link wraps; one tap selects all of it) */
.linkbox {
  padding: 12px 14px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line-2);
  font-size: 15px; color: var(--text-2); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}

@media (max-width: 520px) {
  .hero { padding: 22px; }
  .hero h1 { font-size: 27px; }
  .hero .btn { width: 100%; }
  .card { padding: 18px; }
  .big { font-size: 24px; }
}
