/* account.html — sign-in form + billing state, layered on top of site.css's
   tokens/utilities. Kept in its own file since this page is the site's first
   real interactive surface (Supabase auth + Razorpay Checkout JS) — see
   README.md's "JS budget" note. */

#signin-view {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px; margin: 28px auto 0; max-width: 420px;
  box-shadow: 0 12px 36px var(--shadow);
}
/* Phone: the 32px desktop padding eats a third of a narrow viewport. */
@media (max-width: 480px) {
  #signin-view { padding: 22px 16px; }
}
.authform {
  display: flex; flex-direction: column; gap: 14px; max-width: 360px; margin-top: 28px;
}
#signin-view .authform:first-child { margin-top: 0; }
.authform label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.authform input {
  font-family: var(--sans); font-size: 15px; color: var(--text);
  background: var(--surface2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 11px 13px;
}
.authform input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.authform button { margin-top: 4px; }
.authhint { font-size: 13px; margin-top: 18px; max-width: 460px; line-height: 1.6; }
.storerow { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.storechip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px;
}
.storechip:hover, .storechip:focus-visible { color: var(--text); border-color: var(--gold); }
.storechip .sic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* The Apple mark is a filled silhouette, not a stroked outline. */
.storechip .sic-fill { fill: currentColor; stroke: none; }
.autherr { font-size: 13.5px; color: var(--crimson); margin: 2px 0 0; }

#google-signin-btn, #apple-signin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.gicon { width: 18px; height: 18px; flex: none; }
.aicon { width: 18px; height: 18px; flex: none; fill: currentColor; }
.authdivider {
  display: flex; align-items: center; gap: 12px; max-width: 360px;
  margin: 18px 0 0; font-size: 12px; color: var(--dim);
}
.authdivider::before, .authdivider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.acctbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; gap: 12px; flex-wrap: wrap;
}

.datastats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 20px; }
.dstat {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 6px; text-align: center;
}
.dstat .n { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dstat .l {
  font-size: 10px; color: var(--muted); margin-top: 1px;
  text-transform: uppercase; letter-spacing: .04em;
}

.aiusage {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; margin-top: 10px;
}
.aiu-top { display: flex; justify-content: space-between; align-items: baseline; }
.aiu-label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.aiu-count { color: var(--text); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.aiu-track { height: 6px; background: var(--surface); border-radius: 3px; margin-top: 9px; overflow: hidden; }
.aiu-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width .3s; }
.aiu-left { display: block; margin-top: 6px; font-size: 11.5px; color: var(--dim); }

/* Unlike the homepage pricing grid (roughly equal content per card, so
   site.css's stretch-to-match-row-height reads as intentional symmetry),
   account.html's cards vary wildly — Free may be just a "Current plan"
   note while Pro/Elite carry a full action stack. Let each size to its
   own content instead of stretching into oversized empty tiles. */
#tiers { align-items: start; }
/* Account cards carry far less content than the homepage's (no feature
   list, just a price and one action) — the shared .tier padding/type
   scale was sized for that richer card, so it reads oversized here. */
#tiers .tier { padding: 18px; }
#tiers .tier .tn { font-size: 18px; }
#tiers .tier .pr { margin-top: 4px; }
#tiers .tier .pr b { font-size: 24px; }

/* Per-tier action area injected into each .tier card (site.css supplies
   .tiers/.tier/.tn/.pr/.bdg — this only adds the interactive bits). */
.tier .actions { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.tier .actions .btn { width: 100%; text-align: center; }
.tier .actions .btn[disabled] { opacity: .55; cursor: default; transform: none !important; }
.tier .note { font-size: 12.5px; color: var(--dim); margin-top: 16px; }

.billstatus, .billerror {
  margin-top: 22px; font-size: 14px; border-radius: 12px; padding: 13px 16px;
}
.billstatus { background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.billerror { background: var(--surface2); color: var(--crimson); border: 1px solid var(--crimson); }

/* ── Motion + hierarchy pass (2026-07-19), matching the app dashboard ── */

/* Billing view enters like the app's Home: sections fade-and-rise in
   reading order once the data lands. Pure CSS — account.js only flips
   [hidden], the animation runs on reveal. */
#billing-view:not([hidden]) > * {
  animation: acct-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
#billing-view:not([hidden]) > *:nth-child(2) { animation-delay: .08s; }
#billing-view:not([hidden]) > *:nth-child(3) { animation-delay: .16s; }
#billing-view:not([hidden]) > *:nth-child(4) { animation-delay: .24s; }
#billing-view:not([hidden]) > *:nth-child(5) { animation-delay: .32s; }
#billing-view:not([hidden]) > *:nth-child(6) { animation-delay: .40s; }
@keyframes acct-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
#signin-view:not([hidden]) { animation: acct-rise .5s cubic-bezier(.2, .8, .2, 1) both; }

/* Stats read as the account's vitals — bigger numbers, gold accent on
   hover, same tabular figures as the app's tiles. */
.dstat { transition: border-color .18s ease, transform .18s ease; }
.dstat:hover { border-color: var(--gold); transform: translateY(-2px); }
.dstat .n { font-size: 22px; }

/* The current plan should read FIRST — before any upsell. account.js marks
   the active card with .tier-current. */
.tier-current { border-color: var(--gold) !important; position: relative; }
.tier-current::before {
  content: "CURRENT PLAN"; position: absolute; top: -9px; left: 50%;
  transform: translateX(-50%); background: var(--gold); color: var(--bg);
  font-size: 9.5px; font-weight: 600; letter-spacing: .08em;
  padding: 2px 10px; border-radius: 8px; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  #billing-view:not([hidden]) > *, #signin-view:not([hidden]) { animation: none; }
  .dstat:hover { transform: none; }
}
