/* =============================================================================
   ACCOUNT CARD (sign-in, register, verify, reset, forgot, account, sign-out)
   Loaded AFTER the shared styles.css and alongside local-fonts.css.

   Rules of this file
   - Every card rule lives under .acct-view and every token is --acct-*, so
     nothing here can reach the shared header, footer or any other page.
   - The old account-only header, brand mark, footer, page-level :root tokens,
     reset and body rules are gone: the generated site-header / site-footer from
     tools/layout/fragments/ own the chrome, and styles.css owns the page.
   - The shared reset (`* { margin: 0 }`, heading, link and eyebrow styles) is
     overridden only where the card relied on browser defaults or on the old
     page-level rules, so the card keeps its original rhythm.

   Unchanged from the previous card: white card, 20px radius (16px at <=620px),
   48px fields, full-width #1b263b button with 9px radius, two columns, the
   850px / 620px breakpoints and the <=620px column-reverse order.
   Deliberate changes: shared 1140px maximum and 22px gutters, field border
   #8a94a3 (3:1 non-text contrast) and the Inter / Plus Jakarta Sans faces,
   which now load from /assets/fonts through local-fonts.css.
   ========================================================================== */

/* ---------- skip link (sits outside .acct-view, before the header) ---------- */
body > a.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100; /* above the sticky site header (z-index 50) */
  margin: 0;
  padding: .75rem 1rem;
  background: #fff;
  color: #1b263b;
  border-radius: 8px;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: .2em;
}
body > a.skip-link:focus,
body > a.skip-link:focus-visible {
  top: 1rem;
  outline: 3px solid #2858b5;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff;
}

/* ---------- tokens + page canvas for the account view ---------- */
.acct-view {
  --acct-ink: #1b263b;
  --acct-muted: #536074;
  --acct-paper: #fbf9f5;
  --acct-line: #d9dfe5;
  --acct-field: #8a94a3;
  --acct-focus: #2858b5;
  --acct-eyebrow: #66503a;
  --acct-primary-hover: #2c3e5a;

  color-scheme: light;
  display: flow-root; /* keeps the main's own margins inside the paper background */
  position: relative; /* anchors the decorative photo canvas below */
  isolation: isolate;
  background: var(--acct-paper);
  color: var(--acct-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

.acct-view a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.acct-view a:hover { text-decoration-thickness: 2px; }

.acct-view button,
.acct-view input { font: inherit; }

.acct-view a:focus-visible,
.acct-view button:focus-visible,
.acct-view input:focus-visible,
.acct-view summary:focus-visible {
  outline: 3px solid var(--acct-focus);
  outline-offset: 4px;
}

/* ---------- decorative photo canvas (owner correction, 16 Nov 2026) ----------
   The market homepage photograph fills the whole account canvas under a .70
   white overlay, as on the homepage hero; the white card and the main sit
   above it. The picture is aria-hidden with an empty alt, so nothing is
   announced, and no layout, breakpoint or footer rule changes. */
.acct-view .account-photo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.acct-view .account-photo-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 0;
}
.acct-view::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(255, 255, 255, .70);
}
.acct-view .account-layout { position: relative; z-index: 2; }
/* Introduction copy over the thinner canvas: the worst case is .70 white on pure black (#b3b3b3), so the
   paragraph takes the ink (7.3:1) and the eyebrow a darker brown (6.2:1). The card is white and unchanged. */
.acct-view .account-layout .account-introduction > p:not(.eyebrow) { color: var(--acct-ink); }
.acct-view .account-introduction .eyebrow { color: #3f2f1f; }

/* ---------- layout ---------- */
.acct-view .account-layout {
  max-width: var(--maxw, 1140px);
  margin: 2.5rem auto 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  align-items: start;
  gap: 5rem;
  padding: 0 22px;
}
.acct-view .account-introduction { padding-top: 3rem; }

.acct-view .eyebrow {
  display: block; /* the shared .eyebrow is inline-flex */
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 750;
  font-size: .69rem;
  margin: 0 0 .9rem;
  color: var(--acct-eyebrow);
}

.acct-view .account-introduction h2 {
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.05em;
  margin: 0 0 1.5rem;
  font-weight: 800;
  color: var(--acct-ink);
}
.acct-view .account-introduction > p:not(.eyebrow) {
  max-width: 390px;
  margin: 0 0 1em; /* the original used the browser's default paragraph margin */
  color: var(--acct-muted);
  font-size: 1.05rem;
}
.acct-view .text-link {
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  min-height: 44px;
  font-size: .94rem;
  font-weight: 650;
  margin-top: 1rem;
}

/* ---------- card ---------- */
.acct-view .account-card {
  background: #fff;
  border: 1px solid var(--acct-line);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 16px 45px rgba(27, 38, 59, .05);
  min-width: 0;
}
.acct-view .account-card h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -.045em;
  margin: 0 0 .8rem;
  color: var(--acct-ink);
}
.acct-view .intro {
  margin: 0 0 1.6rem;
  color: var(--acct-muted);
  font-size: .96rem;
}

.acct-view .account-card form {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.acct-view .account-card label {
  font-size: .87rem;
  font-weight: 650;
  margin-top: .65rem;
}
.acct-view .account-card input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--acct-field);
  border-radius: 8px;
  background: #fff;
  color: var(--acct-ink);
  padding: .65rem .8rem;
}
.acct-view .account-card input:focus { border-color: var(--acct-focus); }

/* Browser autofill must not tint the fields: keep them white. */
.acct-view .account-card input:-webkit-autofill,
.acct-view .account-card input:-webkit-autofill:hover,
.acct-view .account-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--acct-ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--acct-ink);
}
.acct-view .account-card input:autofill {
  -webkit-text-fill-color: var(--acct-ink);
  box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--acct-ink);
}

.acct-view .field-help {
  font-size: .8rem;
  line-height: 1.5;
  margin: .1rem 0 .4rem;
  color: var(--acct-muted);
}

/* ---------- buttons ---------- */
.acct-view .button {
  min-height: 48px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .75rem 1rem;
  font-size: .93rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
}
.acct-view .primary { background: var(--acct-ink); color: #fff; }
.acct-view .primary:hover { background: var(--acct-primary-hover); }
.acct-view .secondary { background: #f4f5f7; border-color: var(--acct-line); }
.acct-view form .button { margin-top: 1rem; }

/* ---------- footer links, notices and the other account views ---------- */
.acct-view .account-footer {
  font-size: .86rem;
  color: var(--acct-muted);
  margin: 1.15rem 0 0;
  line-height: 1.6;
}
.acct-view .account-footer a {
  font-weight: 650;
  color: var(--acct-ink);
  display: inline-block;
  padding: .25rem 0;
}

.acct-view .notice,
.acct-view .error {
  border-radius: 9px;
  padding: .85rem 1rem;
  font-size: .9rem;
  margin: 0 0 1.3rem;
  overflow-wrap: anywhere;
}
.acct-view .notice { background: #edf7f2; color: #205640; border: 1px solid #b5d6c6; }
.acct-view .error { background: #fff2ef; color: #842d22; border: 1px solid #efb8ae; }

.acct-view .profile-email { margin: 0 0 1.5rem; overflow-wrap: anywhere; }
.acct-view .profile-email span { display: block; color: var(--acct-muted); font-size: .8rem; }
.acct-view .profile-email strong { font-size: .96rem; }

.acct-view .password-details { border-top: 1px solid var(--acct-line); margin-top: 1.6rem; padding-top: .3rem; }
.acct-view .password-details summary { cursor: pointer; min-height: 48px; padding: .7rem 0; font-size: .9rem; font-weight: 650; }
.acct-view .password-details[open] summary { margin-bottom: .4rem; }

/* ---------- <=850px: card breakpoint ---------- */
@media (max-width: 850px) {
  .acct-view .account-layout {
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    margin-top: 1rem;
  }
  .acct-view .account-card { padding: 1.6rem; }
  .acct-view .account-introduction h2 { font-size: 2.2rem; }
  .acct-view .account-introduction { padding-top: 1.75rem; }
}

/* ---------- <=620px: single column, card first (column-reverse) ---------- */
@media (max-width: 620px) {
  .acct-view .account-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 1.5rem;
    margin: 1rem auto 2rem;
  }
  .acct-view .account-card { width: 100%; padding: 1.5rem; border-radius: 16px; }
  .acct-view .account-card h1 { font-size: 1.8rem; }
  .acct-view .account-introduction { padding: .5rem 0 0; }
  .acct-view .account-introduction h2 { font-size: 1.8rem; }
  .acct-view .account-introduction h2 br { display: none; }
  .acct-view .account-introduction > p:not(.eyebrow) { font-size: .94rem; margin-bottom: .5rem; }
  .acct-view .text-link { margin-top: 0; }
  .acct-view .account-footer a { min-height: 36px; }
}

/* The shared stylesheet smooth-scrolls; the skip link and anchors must not. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
