/* echoem web — shared styles (mirrors theme/colors.ts + app components) */
:root {
  --bg: #000000;
  --surface: #0B0B0D;
  --surface-2: #121215;
  --surface-3: #19191D;
  --text: #F0F0F2;
  --text-2: #A1A1AA;
  --text-3: #71717A;
  --border: #2A2A31;
  --border-subtle: #1B1B20;
  --brand: #8070FF;
  --brand-pressed: #6F5EEA;
  --brand-soft: #1A1633;
  --brand-subtle: #100D22;
  --input-bg: #101013;
  --input-bg-focus: #141419;
  --input-border: #292930;
  --placeholder: #666670;
  --error: #F06A72;
  --error-soft: #2B1215;
  --success: #4DD9A0;
  --success-soft: #10281F;
  --warning: #F2B84B;
  --track: #242429;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100dvh; overflow-x: hidden; }

/* Starfield — pitch black with faint white stars, like the app backdrop */
#sky { position: fixed; inset: 0; z-index: 0; }

.page {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px 88px;
}

/* ── Brand ── */
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.mark { display: flex; align-items: center; gap: 4px; height: 32px; }
.mark i { display: block; width: 4px; border-radius: 100px; background: var(--brand); }
.wordmark { font-family: var(--sans); font-weight: 700; font-size: 30px; letter-spacing: -0.5px; color: var(--text); }
.tagline { font-weight: 700; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }

/* ── Card ── */
.card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 20px;
}

.state { display: none; flex-direction: column; gap: 20px; }
.state.active { display: flex; }
.state.centered { align-items: center; text-align: center; }
.state.centered .disc { align-self: center; }

.eyebrow { font-weight: 700; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.headline { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1.15; letter-spacing: -0.5px; color: var(--text); }
.sub { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 20px; line-height: 1.4; color: var(--text-2); }
.body { font-weight: 500; font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* ── Input well (mirrors InputField) ── */
.field {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  transition: border-color .2s, background .2s;
}
.field:focus-within { border-color: var(--brand); background: var(--input-bg-focus); }
.field.invalid { border-color: var(--error); }
.field svg.lead { width: 18px; height: 18px; color: var(--brand); flex: none; opacity: .85; }
.field:focus-within svg.lead { opacity: 1; }
.field input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: none;
  color: var(--text); font-family: var(--sans); font-weight: 600; font-size: 16px;
  caret-color: var(--brand);
}
.field input::placeholder { color: var(--placeholder); }
.eye {
  flex: none; width: 32px; height: 32px; border: 0; border-radius: 100px;
  background: transparent; color: var(--text-2); cursor: pointer;
  display: grid; place-items: center;
}
.eye:hover { color: var(--text); }
.eye.on { color: var(--brand); }
.eye svg { width: 18px; height: 18px; }

.hint { font-weight: 600; font-size: 13px; color: var(--text-3); margin: -8px 0 0 4px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ── Strength meter ("fill the page", like the app's meter) ── */
.meter { height: 6px; border-radius: 100px; background: var(--track); overflow: hidden; margin: -6px 0 0; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 100px; background: var(--brand); transition: width .25s ease, background .25s; }

/* ── Buttons (mirrors PrimaryButton / OutlineButton) ── */
.btn {
  width: 100%; height: 56px; border: 0; border-radius: 16px;
  background: var(--brand); color: #FFFFFF;
  font-family: var(--sans); font-weight: 800; font-size: 16px; letter-spacing: .2px;
  cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--brand-pressed); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .8s linear infinite; display: none;
}
.btn.loading .spin { display: block; }
.btn.loading .label { display: none; }

.btn-outline { background: transparent; color: var(--brand); border: 1px solid var(--brand); font-weight: 700; }
.btn-outline:hover { background: var(--brand-subtle); }

/* ── Alert ── */
.alert {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(240,106,114,.35); background: var(--error-soft);
  color: var(--error); font-weight: 600; font-size: 14px; line-height: 1.5;
}
.alert.show { display: flex; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ── Status disc for end states ── */
.disc {
  width: 64px; height: 64px; border-radius: 100px;
  display: grid; place-items: center; align-self: flex-start;
  background: var(--brand-soft); color: var(--brand);
}
.disc.ok { background: var(--success-soft); color: var(--success); }
.disc.bad { background: var(--error-soft); color: var(--error); }
.disc svg { width: 26px; height: 26px; }

footer {
  position: fixed; left: 0; right: 0; bottom: 24px; z-index: 1;
  text-align: center;
  font-weight: 700; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-3); opacity: .7;
}

/* rise-in, same feel as the app's Stagger */
.rise { opacity: 0; animation: rise .42s ease-out forwards; }
.rise:nth-child(2) { animation-delay: .09s; }
.rise:nth-child(3) { animation-delay: .18s; }
.rise:nth-child(4) { animation-delay: .27s; }
.rise:nth-child(5) { animation-delay: .36s; }
.rise:nth-child(6) { animation-delay: .45s; }
.rise:nth-child(7) { animation-delay: .54s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; opacity: 1; } }
