/* VoiceComet hosted pages (Firebase Hosting).
   Tokens are copied from receiver/web/styles.css so the page reads as the same
   product the user just left. Single dark theme, locked: these pages are only
   ever reached from a mail link, never embedded in another site's chrome.
   Design dials (taste-skill): VARIANCE 3 / MOTION 3 / DENSITY 3, trust-first. */

:root {
  --bg:        #08090A;
  --bg-side:   #0F1012;
  --bg-card:   #141517;
  --bg-hover:  #1C1D21;
  --border:    #242628;
  --border2:   #2E2F32;
  --border3:   #3E4045;
  --accent:    #5E6AD2;   /* brand indigo, same as the desktop app */
  --accent-hi: #6B77E0;
  --danger:    #D2445E;
  --ok:        #3FA96B;
  --t1: #EBEBEB;
  --t2: #D4D4D4;
  --t3: #8A8F98;
  --t4: #5F6268;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
          "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--t2);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* One quiet radial glow so the canvas is not a dead flat black. Fixed and
   inert so it never costs a repaint on scroll. */
.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(600px 400px at 50% 30%,
              rgba(94, 106, 210, 0.07), transparent 70%);
}

/* ---- Brand ---- */

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 0 14px rgba(94, 106, 210, 0.35);
}
.brand__mark svg { width: 15px; height: 15px; }
.brand__name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--t1);
}

/* ---- Card ---- */

.card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-side);
  padding: 28px;
}

.card h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t1);
  line-height: 1.45;
  margin-bottom: 8px;
}
.card h1.is-ok { color: var(--ok); }
.card h1.is-error { color: var(--danger); }

.card p { font-size: 13px; color: var(--t3); }
.card p + p { margin-top: 10px; }
.card p b { color: var(--t2); font-weight: 600; }

/* The account address under attack/recovery. Monospace like the app's URL
   display: an address is data to verify, not prose. */
.addr {
  display: block;
  margin: 14px 0 18px;
  padding: 9px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

/* ---- Form ---- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--t1);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:hover { border-color: var(--border3); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field input.is-invalid,
.field input.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.field .hint { font-size: 12px; color: var(--t4); margin-top: 6px; }

.form-error {
  font-size: 12px;
  color: var(--danger);
  line-height: 1.6;
  margin: -4px 0 14px;
  min-height: 0;
}
.form-error:empty { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(94, 106, 210, 0.2);
}
.btn--primary:hover { background: var(--accent-hi); }
.btn--primary:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.btn--secondary {
  background: var(--bg-hover);
  color: var(--t2);
  border-color: var(--border2);
  margin-top: 10px;
}
.btn--secondary:hover { border-color: var(--border3); }

/* ---- Loading skeleton (shaped like the form it becomes) ---- */

.skel { display: block; border-radius: var(--radius); background: var(--bg-card); }
.skel--title { height: 20px; width: 60%; margin-bottom: 14px; }
.skel--line { height: 12px; width: 90%; margin-bottom: 22px; }
.skel--input { height: 38px; margin-bottom: 16px; }
.skel--btn { height: 40px; }

/* ---- State switching ---- */

.state[hidden] { display: none; }
/* .btn sets display, which would defeat the hidden attribute (UA rules lose
   to author rules) — the recovery-only reset button leaked into every done
   screen without this. */
.btn[hidden] { display: none; }

/* ---- Footer ---- */

.foot {
  margin-top: 26px;
  font-size: 12px;
  color: var(--t4);
  text-align: center;
}

/* ---- Landing ---- */

.landing { max-width: 420px; text-align: center; }
.landing .brand { justify-content: center; }
.landing h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--t1);
  line-height: 1.4;
  margin-bottom: 12px;
}
.landing p { font-size: 13px; color: var(--t3); }
.landing p + p { margin-top: 10px; }

/* ---- Motion (dial 3: one entrance, brief state fades, nothing looping) ---- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .state { transition: opacity 0.24s ease; }
  .state[hidden] { opacity: 0; }
}
