/* Shared styling for the app-flow pages (/login, /welcome, /onboarding,
   /account) — same design tokens and type as index.html/legal.css, extended
   with the form/card/button components those pages need. Keep this in sync
   with index.html's inline <style> tokens if either changes. */
:root {
  --ink: #0E1216;
  --panel: #151B21;
  --panel-2: #1A222A;
  --line: #2A333C;
  --text: #E9E6DE;
  --muted: #8B95A0;
  --tally: #FF4438;
  --tally-dim: #7A2620;
  --preview: #35D07F;
  --radius: 10px;
}

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

body {
  background: var(--ink);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--tally); color: #fff; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--preview);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ---------- header / footer (matches privacy.html) ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.wordmark {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 800; letter-spacing: 0.06em; font-size: 17px; color: var(--text);
}
.tally-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tally); flex: none; }

.site-header nav { display: flex; align-items: center; gap: 18px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.site-footer .wrap {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-decoration-color: transparent; }
.site-footer a:hover { text-decoration-color: var(--tally); }
.site-footer .copyright { color: var(--muted); font-size: 15px; }

/* ---------- page shells ---------- */

/* Centered single-card layout for /login, /welcome */
.auth-shell {
  min-height: calc(100vh - 64px - 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-shell .card { width: 100%; max-width: 420px; }

/* Wider single-column layout for /onboarding, /account */
.app-shell { padding: 56px 0 80px; }
.app-shell .card { max-width: 620px; margin: 0 auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.card h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.card .subhead { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

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

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 11px 13px;
}

.field input::placeholder { color: var(--muted); opacity: 0.7; }

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

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--tally);
  flex: none;
}
.checkbox-row label { font-size: 15px; color: var(--text); }
.checkbox-row a { text-decoration: underline; text-decoration-color: var(--muted); }
.checkbox-row a:hover { text-decoration-color: var(--tally); }

/* ---------- buttons ---------- */

.btn {
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; display: block; }

.btn-primary { background: var(--tally); color: #fff; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--tally) 88%, #fff); }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--muted); }

.btn-danger { background: transparent; color: var(--tally); border-color: var(--tally-dim); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--tally) 12%, transparent); }

.btn-google {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-google:hover:not(:disabled) { border-color: var(--muted); }
.btn-google svg { flex: none; }

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  padding: 0;
  cursor: pointer;
}
.btn-link:hover { color: var(--text); text-decoration-color: var(--tally); }

/* ---------- divider ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- alerts ---------- */

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-error { background: color-mix(in srgb, var(--tally) 14%, transparent); border-color: var(--tally-dim); color: var(--text); }
.alert-warn { background: color-mix(in srgb, #E0A100 14%, transparent); border-color: #6B5000; color: var(--text); }
.alert-info { background: color-mix(in srgb, var(--preview) 12%, transparent); border-color: color-mix(in srgb, var(--preview) 45%, var(--line)); color: var(--text); }

/* ---------- spinner ---------- */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { display: flex; align-items: center; color: var(--muted); font-size: 15px; padding: 8px 0; }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  background: color-mix(in srgb, var(--preview) 16%, transparent);
  color: var(--preview);
  border: 1px solid color-mix(in srgb, var(--preview) 45%, var(--line));
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 4px 10px;
  margin: 8px 0 14px;
}

/* ---------- pricing / plan cards ---------- */

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.plan-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px 24px;
  text-align: left;
}
.plan-card-current { border-color: var(--preview); box-shadow: 0 0 0 1px var(--preview); }

.plan-card-name { color: var(--muted); margin-bottom: 12px; }
.plan-card-price { font-size: 30px; font-weight: 800; font-stretch: 115%; }
.plan-card-interval { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan-card .btn { margin-top: 16px; }

.pricing-status { color: var(--muted); text-align: center; padding: 20px 0; }

/* ---------- account dashboard ---------- */

.dash-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.dash-section:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }
.dash-section h2 { font-size: 18px; margin-bottom: 6px; }
.dash-section .subhead { margin-bottom: 16px; }

.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.download-list { display: flex; flex-direction: column; gap: 10px; }
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.download-item .platform { font-weight: 600; }
.download-item .meta { color: var(--muted); font-size: 13px; }

/* term toggle (monthly/yearly switch on account dashboard) */
.term-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px;
  gap: 3px;
}
.term-toggle button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 99px;
  padding: 7px 16px;
  cursor: pointer;
}
.term-toggle button.active { background: var(--tally); color: #fff; }
.term-toggle button:disabled { cursor: not-allowed; opacity: 0.6; }

/* policy acceptance progress */
.policy-progress { color: var(--preview); margin-bottom: 10px; }
.policy-body { color: var(--text); margin: 16px 0; }
.policy-view-link { display: inline-block; margin-bottom: 4px; }

/* ---------- modal (delete-account confirm) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 75%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 440px;
  width: 100%;
}
.modal-card h3 { font-size: 19px; margin-bottom: 12px; }
.modal-card p { color: var(--text); margin-bottom: 14px; font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .auth-shell { padding: 32px 16px; }
  .card { padding: 24px; }
  .plan-grid { grid-template-columns: 1fr; }
  .dash-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
