/* Reader accounts: auth pages + dashboard */

/* Nav account button (loaded on every page via base.html) lives in site.css */

/* ---------- Auth (sign in / sign up / reset) ---------- */
.auth-wrap { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; background: var(--ivory); }
.auth-art {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 40px) 64px 64px;
  background: radial-gradient(800px 500px at 70% 30%, #1d3665, transparent 60%), var(--ink);
  color: #fff;
}
.auth-art > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.14; z-index: -2; mix-blend-mode: luminosity; }
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--ink) 10%, transparent 70%); }
.auth-art .hero-helix { opacity: 0.6; }
.auth-book { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -62%); z-index: 1; }
.auth-quote { position: relative; z-index: 2; max-width: 460px; }
.auth-quote p { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; line-height: 1.5; color: #fff; margin-bottom: 14px; }
.auth-quote span { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: calc(var(--nav-h) + 30px) 24px 50px; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: clamp(2.1rem, 4vw, 2.8rem); margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); margin-bottom: 30px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field label { display: flex; justify-content: space-between; }
.auth-form .field label a { font-weight: 600; color: var(--gold-deep); font-size: 12.5px; }
.pw-wrap { position: relative; }
.pw-wrap .field-input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.pw-toggle:hover { color: var(--ink); background: var(--paper); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.auth-switch { margin-top: 26px; text-align: center; color: var(--muted); font-size: 14.5px; }
.auth-switch a { color: var(--ink); font-weight: 800; border-bottom: 1px solid var(--gold); }
.form-alert { padding: 14px 18px; border-radius: 14px; background: rgba(192, 57, 43, 0.08); color: var(--danger); font-weight: 600; font-size: 14px; border: 1px solid rgba(192, 57, 43, 0.2); }
.form-alert.ok { background: rgba(31, 138, 91, 0.08); color: var(--success); border-color: rgba(31, 138, 91, 0.2); }
.perks { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.perks .icon { color: var(--ink); background: var(--gold-2); border-radius: 50%; padding: 4px; }
.pw-meter { height: 4px; border-radius: 4px; background: var(--sand); margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.3s, background 0.3s; }
.helptext, .field .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Dashboard ---------- */
.acct-head { position: relative; padding: calc(var(--nav-h) + 40px) 0 110px; background: radial-gradient(700px 400px at 85% 0%, rgba(201, 164, 92, 0.25), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(59, 130, 246, 0.15), transparent 60%), var(--ink); color: #fff; overflow: hidden; }
.acct-head .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.acct-avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold-2), var(--gold-deep)); color: var(--ink); font-family: var(--font-display); font-size: 30px; font-weight: 700; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08); overflow: hidden; flex-shrink: 0; }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-head h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 4px; }
.acct-head p { margin: 0; color: var(--muted-light); }
.acct-head .btn { margin-left: auto; }

.acct-body { position: relative; margin-top: -70px; padding-bottom: 60px; }
.acct-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.acct-nav { position: sticky; top: 96px; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px; display: grid; gap: 4px; }
.acct-nav a, .acct-nav button { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; font-weight: 700; font-size: 14.5px; color: var(--muted); border: 0; background: none; cursor: pointer; width: 100%; text-align: left; transition: background 0.25s, color 0.25s; }
.acct-nav a:hover, .acct-nav button:hover { background: var(--ivory); color: var(--ink); }
.acct-nav a.active { background: var(--ink); color: #fff; }
.acct-nav a.active .icon { color: var(--gold-2); }
.acct-nav .count { margin-left: auto; font-size: 12px; background: var(--paper); color: var(--ink); padding: 2px 9px; border-radius: 999px; }
.acct-nav a.active .count { background: rgba(255, 255, 255, 0.14); color: #fff; }
.acct-nav hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.acct-nav form { margin: 0; }
.acct-main { display: grid; gap: 24px; min-width: 0; }

.panel { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 30px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.5rem; margin: 0; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--paper); color: var(--ink); margin-bottom: 16px; }
.kpi strong { display: block; font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--ink); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.dark { background: linear-gradient(145deg, var(--gold-2), var(--gold) 55%, var(--gold-deep)); border-color: transparent; box-shadow: var(--shadow-gold); }
.kpi.dark .ic { background: rgba(10, 20, 38, 0.12); color: var(--ink); }
.kpi.dark strong { color: var(--ink); }
.kpi.dark span { color: rgba(10, 20, 38, 0.72); }

.continue { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; padding: 26px 30px; border-radius: var(--radius-lg); background: radial-gradient(500px 300px at 100% 0%, rgba(201, 164, 92, 0.3), transparent 60%), var(--ink); color: rgba(255, 255, 255, 0.75); }
.continue img { width: 76px; border-radius: 4px; box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.7); transform: rotate(-4deg); }
.continue h3 { color: #fff; font-size: 1.35rem; margin: 6px 0 4px; }
.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.progress.light { background: var(--sand); }

.order-list { display: grid; gap: 12px; }
.order-row { display: grid; grid-template-columns: 54px 1fr auto auto; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--ivory); transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; }
.order-row:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.order-row img { width: 54px; border-radius: 4px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18); }
.order-row strong { display: block; color: var(--ink); }
.order-row small { color: var(--muted); font-size: 13px; }
.order-row .amt { font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-new { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.status-confirmed { background: rgba(201, 164, 92, 0.18); color: var(--gold-deep); }
.status-shipped { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.status-completed { background: rgba(31, 138, 91, 0.1); color: var(--success); }
.status-cancelled { background: rgba(10, 20, 38, 0.06); color: var(--muted); }

.tracker { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; margin: 10px 0 6px; }
.tracker::before { content: ""; position: absolute; top: 21px; left: 12.5%; right: 12.5%; height: 3px; background: var(--sand); border-radius: 3px; }
.tracker .bar { position: absolute; top: 21px; left: 12.5%; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 3px; }
.tracker .step { position: relative; text-align: center; display: grid; justify-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tracker .dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--sand); color: var(--muted); z-index: 1; }
.tracker .step.done .dot { background: var(--ink); border-color: var(--ink); color: var(--gold-2); }
.tracker .step.done { color: var(--ink); }
.tracker .step.current .dot { box-shadow: 0 0 0 6px rgba(201, 164, 92, 0.25); }

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 12px 20px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; color: var(--ink); font-weight: 700; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px; }
.shelf-item { display: grid; gap: 10px; position: relative; }
.shelf-cover { display: grid; place-items: center; padding: 24px 16px; border-radius: 18px; background: radial-gradient(circle at 50% 30%, #fff, var(--sand)); }
.shelf-cover img { width: 100px; border-radius: 3px; box-shadow: 0 16px 26px -10px rgba(0, 0, 0, 0.45); transition: transform 0.4s var(--ease); }
.shelf-item:hover .shelf-cover img { transform: translateY(-6px) rotate(-2deg); }
.shelf-item strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); line-height: 1.25; }
.shelf-item small { color: var(--muted); font-size: 12.5px; }
.shelf-item .unsave { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: var(--helix-red); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }

.empty { text-align: center; padding: 40px 20px; border: 1px dashed rgba(10, 20, 38, 0.15); border-radius: var(--radius); color: var(--muted); }
.empty .icon { color: var(--gold); margin-bottom: 10px; }
.empty h3 { font-size: 1.25rem; margin-bottom: 6px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.avatar-field { display: flex; align-items: center; gap: 18px; }
.danger-zone { border-color: rgba(192, 57, 43, 0.25); }
.danger-zone h2 { color: var(--danger); }
.btn-danger { --btn-bg: var(--danger); background: var(--danger); color: #fff; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Save (heart) button on the book page */
.save-btn.is-saved { color: var(--gold-2); border-color: var(--gold); }
.save-btn.is-saved .icon { color: var(--helix-red); }

@media (max-width: 1000px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .acct-layout { grid-template-columns: 1fr; }
  .acct-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .acct-nav::-webkit-scrollbar { display: none; }
  .acct-nav a, .acct-nav button { width: auto; white-space: nowrap; }
  .acct-nav hr, .acct-nav .count { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .acct-head { padding-bottom: 96px; }
  .acct-head .btn { margin-left: 0; }
  .acct-avatar { width: 64px; height: 64px; font-size: 24px; }
  .panel { padding: 22px 18px; }
  .continue { grid-template-columns: auto 1fr; padding: 22px; }
  .continue .btn { grid-column: 1 / -1; }
  .order-row { grid-template-columns: 44px 1fr auto; }
  .order-row img { width: 44px; }
  .order-row .amt { display: none; }
  .dl { grid-template-columns: 1fr; gap: 4px; }
  .dl dd { margin-bottom: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .tracker .step { font-size: 11px; }
  .tracker .dot { width: 36px; height: 36px; }
  .tracker::before, .tracker .bar { top: 17px; }
  .kpi { padding: 16px; }
  .kpi strong { font-size: 1.7rem; }
}
