/* ============================================================
   Shared styling for the account pages.
   Matches the Skylar & Rafael landing page palette.
   ============================================================ */
:root {
  --bg: #0e1326;
  --bg-2: #141b36;
  --panel: #1a2244;
  --line: #2b355f;
  --ink: #f4eedc;
  --ink-dim: #bfc4dd;
  --muted: #8b93b8;
  --star: #ffd873;
  --sky: #7ec8f0;
  --fire: #ff8a3d;
  --mint: #7fe0b4;
  --rose: #ff7a8a;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 50% -12%, #24305e 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a { color: var(--sky); }
a:hover { color: var(--star); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.12;
  text-wrap: balance;
}

:focus-visible { outline: 3px solid var(--star); outline-offset: 3px; border-radius: 8px; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1;
}
.wrap--wide { max-width: 760px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}
.brand img { width: 30px; height: 30px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.card + .card { margin-top: 18px; }

.card h1 { font-size: 26px; margin-bottom: 6px; }
.card h2 { font-size: 19px; margin-bottom: 10px; }
.lede { color: var(--ink-dim); margin: 0 0 22px; font-size: 15.5px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;               /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: #0d132a;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #6c749a; }
.field input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(126,200,240,.18);
  outline: none;
}
.field .hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.checkline input { margin-top: 4px; accent-color: var(--star); width: 17px; height: 17px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }

.btn--primary { background: var(--star); color: #221a05; }
.btn--primary:hover { filter: brightness(1.07); color: #221a05; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { background: #202a52; color: var(--ink); }

.btn--social { background: #fff; color: #1a1a1a; }
.btn--social:hover { filter: brightness(.95); color: #1a1a1a; }
.btn--facebook { background: #1877f2; color: #fff; }
.btn--facebook:hover { filter: brightness(1.08); color: #fff; }
.btn--passkey {
  background: #202a52;
  border-color: var(--line);
  color: var(--ink);
}
.btn--passkey:hover { background: #26325f; color: var(--ink); }
.btn svg, .btn img { width: 20px; height: 20px; flex: none; }

.btn-stack > * + * { margin-top: 10px; }

/* ---------- divider ---------- */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- messages ---------- */
.msg {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  margin-bottom: 18px;
  display: none;
}
.msg.show { display: block; }
.msg--error { background: rgba(255,122,138,.12); border: 1px solid rgba(255,122,138,.4); color: #ffc3cb; }
.msg--ok    { background: rgba(127,224,180,.12); border: 1px solid rgba(127,224,180,.4); color: #bff3da; }
.msg--info  { background: rgba(126,200,240,.10); border: 1px solid rgba(126,200,240,.32); color: #cbe7f7; }

.foot {
  text-align: center;
  margin-top: 20px;
  font-size: 15px;
  color: var(--ink-dim);
}
.foot a { font-weight: 700; }

.legal {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 26px;
  line-height: 1.55;
}

/* ---------- account page bits ---------- */
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); margin: 0; }
.row dd { margin: 0; text-align: right; font-weight: 700; }

.pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .03em;
}
.pill--active { background: rgba(127,224,180,.16); color: var(--mint); }
.pill--none   { background: rgba(139,147,184,.16); color: var(--ink-dim); }
.pill--warn   { background: rgba(255,138,61,.16); color: var(--fire); }

.booklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.booklist a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #0d132a;
  transition: border-color .15s, transform .1s;
}
.booklist a:hover { border-color: var(--star); transform: translateY(-2px); color: var(--ink); }
.booklist img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 35%; }
.booklist .t { padding: 9px 10px; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.booklist .locked { opacity: .48; }
.booklist .badge {
  display: block;
  padding: 0 10px 9px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.passkey-row:last-of-type { border-bottom: 0; }
.linkbtn {
  background: none;
  border: 0;
  color: var(--rose);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
}

.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-note { text-align: center; color: var(--ink-dim); padding: 48px 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
