/* Titan Fitness OS — shared onboarding/auth theme.
   Tokens copied 1:1 from the dashboard (index.html) so these pages
   are visually the same product. Supports the same titan-theme
   dark/light toggle. */

:root {
  color-scheme: dark;
  --bg: #080b0c;
  --bg-soft: #0b0f10;
  --surface: #101516;
  --surface-2: #151c1d;
  --surface-3: #1b2324;
  --line: rgba(235, 246, 239, .08);
  --line-strong: rgba(235, 246, 239, .14);
  --text: #f2f7f3;
  --muted: #91a09a;
  --faint: #83918b;
  --accent: #b8f34a;
  --accent-2: #79d8ff;
  --accent-ink: #172100;
  --accent-soft: rgba(184, 243, 74, .12);
  --green: #63e69c;
  --green-soft: rgba(99, 230, 156, .12);
  --amber: #ffc163;
  --red: #ff737d;
  --red-soft: rgba(255, 115, 125, .12);
  --shadow: 0 26px 80px rgba(0, 0, 0, .34);
  --radius: 22px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2ec;
  --bg-soft: #f5f7f3;
  --surface: #ffffff;
  --surface-2: #f7f9f5;
  --surface-3: #edf1eb;
  --line: rgba(19, 28, 22, .08);
  --line-strong: rgba(19, 28, 22, .14);
  --text: #162019;
  --muted: #66736c;
  --faint: #59665f;
  --accent: #6ea700;
  --accent-2: #217da2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(110, 167, 0, .11);
  --green: #16864b;
  --green-soft: rgba(22, 134, 75, .10);
  --amber: #a76300;
  --red: #c5444f;
  --red-soft: rgba(197, 68, 79, .10);
  --shadow: 0 22px 64px rgba(28, 41, 32, .12);
}

* { box-sizing: border-box; }
button { min-height: 44px; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 520px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(121, 216, 255, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(clamp(16px, 4vw, 48px), env(safe-area-inset-top))
    max(clamp(16px, 4vw, 48px), env(safe-area-inset-right))
    max(clamp(16px, 4vw, 48px), env(safe-area-inset-bottom))
    max(clamp(16px, 4vw, 48px), env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 44px);
}
.auth-card.wide { max-width: 660px; }

.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: #080b0c url("/assets/titan-mark.png") center / cover no-repeat;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark span { display: none; }
.brand-copy strong { display: block; font-size: 15px; letter-spacing: .14em; }
.brand-copy small { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }

h1 { font-size: clamp(24px, 3.4vw, 30px); margin: 0 0 6px; letter-spacing: -.01em; }
.question-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; line-height: 1.4; margin: 20px 0 8px; text-transform: uppercase; }
p.sub { color: var(--muted); margin: 0 0 26px; font-size: clamp(14px, 1.8vw, 15.5px); line-height: 1.55; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 20px 0 8px; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 14px 16px;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px; /* prevents iOS zoom-on-focus */
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.row { display: flex; gap: 14px; }
.row > div { flex: 1; }

.options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.opt {
  padding: 13px 18px;
  min-height: 48px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px; font-weight: 500; font-family: inherit; text-align: left;
  cursor: pointer; user-select: none;
  transition: all .15s ease;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.opt:focus-visible, .btn:focus-visible, .theme-corner:focus-visible, .pw-eye:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.limitation-fieldset { border: 0; margin: 20px 0 0; padding: 0; }
.limitation-fieldset legend { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; line-height: 1.4; margin-bottom: 8px; text-transform: uppercase; }
.check-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.check-options label { align-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 13px; color: var(--text); cursor: pointer; display: flex; font-size: 14.5px; font-weight: 600; gap: 10px; letter-spacing: 0; margin: 0; min-height: 48px; padding: 10px 13px; text-transform: none; }
.check-options input { accent-color: var(--accent); height: 20px; margin: 0; width: 20px; }

.btn {
  border: none; border-radius: 14px;
  padding: 15px 26px; min-height: 52px;
  font-size: 15.5px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; margin-top: 26px; }
.btn-ghost { background: transparent; color: var(--muted); }

.nav-btns { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; gap: 12px; }
.nav-btns .btn-primary { width: auto; margin-top: 0; flex: 1; }

.progress { height: 5px; background: var(--surface-3); border-radius: 5px; margin-bottom: 28px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; border-radius: 5px; }

.msg { margin-top: 16px; font-size: 14px; min-height: 20px; line-height: 1.5; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green); }

.foot { text-align: center; margin-top: 26px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.skip { text-align: center; margin-top: 18px; }
.skip a { color: var(--faint); font-size: 13px; text-decoration: none; }

.theme-corner {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding:
      max(28px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .row { flex-direction: column; gap: 0; }
  .nav-btns { flex-direction: row; }
}

/* Password visibility toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--faint); cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.pw-eye:hover { color: var(--text); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye .slash { display: none; }
.pw-eye.showing .slash { display: block; }

@media (max-width: 420px) {
  .check-options { grid-template-columns: 1fr; }
}
