/* ==========================================================================
   Account area and the sign-in pages
   ========================================================================== */

.account-page { padding-block: var(--space-7) var(--space-9); }

.account-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); }
.account-head h1 { font-size: var(--text-2xl); }
.account-head__email { font-size: var(--text-sm); color: var(--ink-subtle); }

/* The VITALA lockup stands in for the heading on its own page.
   
   It is only ever placed on a light ground. Measured against the brand red the
   wordmark reads at 2.33:1 and the tagline's teal at 1.01:1, so on the crimson
   hero below it the lockup would be a dark smudge on a dark field. Sized by
   height so the artwork's dimensions can change without moving the layout. */
.vitala-lockup { margin: 0; line-height: 0; }
.vitala-lockup img { height: clamp(4rem, 9vw, 5.5rem); width: auto; }

/* ---------------------------------------------------------- sub-navigation */

.account-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}
.account-nav a, .account-nav__out {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  position: relative;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.account-nav a:hover, .account-nav__out:hover { background: var(--surface-sunken); color: var(--ink); }
.account-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.account-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-4); right: var(--space-4);
  bottom: calc(var(--space-2) * -1 - 1px);
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-pill);
}
.account-nav__out { margin-left: auto; color: var(--ink-subtle); }

.account-body { display: grid; gap: var(--space-7); }

/* ----------------------------------------------------------------- stats */

.stat-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}
.stat {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  align-content: start;
}
.stat__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-subtle);
}
.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat__link { font-size: var(--text-sm); }
.stat__link--muted { color: var(--ink-subtle); }

/* ---------------------------------------------------------------- sections */

.account-section { display: grid; gap: var(--space-4); }
.account-section h2 { font-size: var(--text-lg); }
.account-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.account-section__head a { font-size: var(--text-sm); }
.account-note { font-size: var(--text-sm); color: var(--ink-subtle); max-width: var(--measure); }
.account-empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--ink-subtle);
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
}

/* ------------------------------------------------------------------ orders */

.order-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); }

.order-row {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--duration) var(--ease);
}
.order-row:hover { border-color: var(--line-strong); }
.order-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.order-row__head > div { display: grid; gap: var(--space-1); }
.order-row__number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.order-row__number:hover { color: var(--accent); }
.order-row__date { font-size: var(--text-xs); color: var(--ink-subtle); }

/* The whole card opens it. The card's one link (its number or name) stretches
   a transparent layer over the card, so a click anywhere lands on that link,
   while keyboard and screen-reader users still meet a single, clearly named
   link rather than a card that acts like one. Cards without a link (such as
   the quotations listed on a request) are untouched. */
.order-row:has(> .order-row__head a.order-row__number) { position: relative; cursor: pointer; }
.order-row a.order-row__number::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.order-row:has(a.order-row__number):hover { border-color: var(--accent); }
.order-row:has(a.order-row__number):hover .order-row__number { color: var(--accent); }
.order-row a.order-row__number:focus-visible { outline: none; }
.order-row:has(a.order-row__number:focus-visible) { box-shadow: var(--ring); border-color: var(--accent); }
.order-row__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.order-row__items { font-size: var(--text-sm); color: var(--ink-muted); }
.order-row__total {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* ----------------------------------------------------------------- rewards */

/* The VITALA balance panel is the same brand red surface as the section on the
   home page, so the two read as one feature. */
.reward-hero {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  border-radius: var(--radius-lg);
  background: var(--surface-brand);
  color: var(--on-brand-muted);
}
.reward-hero__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-brand-gold);
}
.reward-hero__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--on-brand);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reward-hero__note { font-size: var(--text-sm); max-width: 44ch; }
.reward-hero .btn {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-border: rgb(255 255 255 / 0.45);
  margin-top: var(--space-2);
}
.reward-hero .btn:hover {
  --btn-bg: #fff;
  --btn-fg: var(--surface-brand);
  --btn-border: #fff;
}

.ledger { list-style: none; padding: 0; display: grid; }
.ledger__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
}
.ledger__row > div { display: grid; gap: var(--space-1); }
.ledger__label { font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.ledger__meta { font-size: var(--text-xs); color: var(--ink-subtle); }
.ledger__amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger__amount--in  { color: var(--accent); }
.ledger__amount--out { color: var(--ink-subtle); }

/* ----------------------------------------------------------------- profile */

.profile-grid { display: grid; gap: var(--space-7); }
@media (min-width: 56rem) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .profile-grid > :last-child { grid-column: 1 / -1; }
}

.form-ok {
  padding: var(--space-3) var(--space-4);
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------- sign-in pages */

.auth-page { padding-block: var(--space-8) var(--space-9); }
.auth-card {
  max-width: 26rem;
  margin-inline: auto;
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: grid;
  gap: var(--space-4);
}
.auth-card h1 { font-size: var(--text-xl); }
.auth-lede { font-size: var(--text-sm); color: var(--ink-muted); }
.auth-switch {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-subtle);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ quotes */

.quote-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.quote-head h1 { font-family: var(--font-mono); font-size: var(--text-xl); margin-top: var(--space-2); }
.quote-head__meta { font-size: var(--text-sm); color: var(--ink-subtle); margin-top: var(--space-2); }

.quote-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.quote-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  font-weight: 600;
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--ink);
}
.quote-table .num { text-align: right; }
.quote-table td { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.quote-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-table__sku { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-subtle); }
.quote-table tfoot td { border-bottom: 0; padding: var(--space-2) 0; }
.quote-table tfoot .label { text-align: right; color: var(--ink-muted); }
.quote-table tfoot .grand td {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

.quote-extra { display: grid; gap: var(--space-4); padding-top: var(--space-2); }
.quote-extra p { font-size: var(--text-sm); color: var(--ink-muted); margin-top: var(--space-1); }
.quote-terms {
  font-size: var(--text-xs);
  color: var(--ink-subtle);
  line-height: var(--leading-normal);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.quote-actions {
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}
.quote-actions__prompt { font-weight: 600; color: var(--ink); }
.quote-actions__row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
