/* KB#4058 Sign-in, registration, password recovery, reset and e-mail verification in the heavy luxury (program KB#4045,
   item 3; Decision #481). One stylesheet loaded after the page's own ones; the markup, the forms, the scripts, OAuth
   and every request are untouched.
   - The card stays the shared card token (contract public-auth-visual-contract: the card is var(--card-bg) and
     var(--card-border)); the auth pages set the token itself to the jade plate in a copper rim, at the body, so the
     card and the contract's token probe resolve the same paint.
   - The page is one deep jade-black in both themes, like the other heavy-luxury pages; text tokens turn ivory, the
     auth indigo accent (#5b52ee / #6c63ff, lilac) turns copper.
   - Messages keep their meaning colours, lightened for the dark jade (the light-theme dark red and greens would sit
     on jade at about 2:1).
   - The buttons keep the shared brand action of the site (KB#3927: dark jade fill, copper ink), as the contract
     public-auth-visual-contract requires.
   Nothing smaller than 16 px for the 60+ audience (KB#4024); headings in the solid text ink with a cast copper rule
   under them (no gradient-clipped ink, KB#3895). */

body.auth-page,
body[data-page="authReset"],
body[data-page="authVerify"] {
  --card-bg:
    linear-gradient(180deg, rgb(255 236 210 / .08), transparent 38%),
    radial-gradient(120% 140% at 30% 20%, rgb(60 130 96 / .16), rgb(2 18 13 / .3)),
    url("/landing-assets/toc/jade-plate.webp") 50% 50% / 640px auto,
    #0b2a22;
  --card-border: #b67c4e;
  --text: #f5ecdf;
  --text-primary: #f5ecdf;
  --text-secondary: #c9d6d0;
  --pn-fg-secondary: #c9d6d0;
  --accent: #e9b386;
  --au-copper: #e9b386;
  --au-rule: rgb(214 152 101 / .45);
  color-scheme: dark;
  background: #04130f;
  color: var(--text);
}
html:has(> body.auth-page),
html:has(> body[data-page="authReset"]),
html:has(> body[data-page="authVerify"]) {
  background: #04130f;
  color-scheme: dark;
}
/* the ambient glows and the light-theme ambient layers of the old canvas are not part of the jade page */
body.auth-page > .g,
body[data-page="authReset"] > .g,
body[data-page="authVerify"] > .g,
body.auth-page > .pn-ambient-background,
body[data-page="authReset"] > .pn-ambient-background,
body[data-page="authVerify"] > .pn-ambient-background { display: none; }

/* The foreground roles (KB#3773) switch to dark ink in the light theme on every .pn-foreground element
   (:root[data-theme="light"] .pn-foreground, weight 0,3,0). The jade page keeps the light ink in both themes: the
   same roles, one step heavier (0,3,1), only on the sign-in pages. */
:root body.auth-page.pn-foreground,
:root body.auth-page .pn-foreground,
:root body[data-page="authReset"].pn-foreground,
:root body[data-page="authReset"] .pn-foreground,
:root body[data-page="authVerify"].pn-foreground,
:root body[data-page="authVerify"] .pn-foreground {
  --pn-fg-primary: #f5ecdf;
  --pn-fg-secondary: #c9d6d0;
  --pn-fg-link: #e9b386;
  --pn-fg-success: #b3e5b6;
  --pn-fg-warning: #f4d598;
  --pn-fg-danger: #ffadb2;
  --pn-fg-focus: #f5ecdf;
}

/* ── the card: the jade plate in a thin copper rim ── */
body.auth-page .auth-card,
body[data-page="authReset"] .auth-card,
body[data-page="authVerify"] .auth-card {
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgb(255 220 180 / .3),
    inset 0 0 0 1px rgb(20 10 4 / .5),
    0 18px 40px rgb(0 0 0 / .5);
}

/* ── the small brand mark of the reset and verify cards: the brand emblem, not the old cyan-to-violet ring ── */
body[data-page="authReset"] #main.pn-foreground .auth-logo svg,
body[data-page="authVerify"] #main.pn-foreground .auth-logo svg { display: none; }
body[data-page="authReset"] #main.pn-foreground .auth-logo::before,
body[data-page="authVerify"] #main.pn-foreground .auth-logo::before {
  content: "";
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: url("/brand/pocketnode-emblem-dark.webp") center / contain no-repeat;
}
body[data-page="authReset"] #main.pn-foreground .auth-logo span,
body[data-page="authVerify"] #main.pn-foreground .auth-logo span { color: var(--au-copper); }

/* ── headings and copy ── */
/* The heading keeps the text ink of the foreground contract (KB#3672, KB#3750: heading = text ink, no gradient);
   the copper comes as a short cast rule under it. */
body.auth-page #main.pn-foreground .auth-card h1,
body[data-page="authReset"] #main.pn-foreground .auth-title,
body[data-page="authVerify"] #main.pn-foreground .auth-card h1 {
  font-weight: 600;
  text-shadow: 0 2px 0 rgb(0 0 0 / .35), 0 4px 14px rgb(0 0 0 / .45);
}
body.auth-page #main.pn-foreground .auth-card h1::after,
body[data-page="authReset"] #main.pn-foreground .auth-title::after,
body[data-page="authVerify"] #main.pn-foreground .auth-card h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin: 10px auto 0;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, #e9b386 20%, #c98b5c 80%, transparent);
}
body.auth-page #main.pn-foreground .auth-subtitle,
body.auth-page #main.pn-foreground .auth-links,
body.auth-page #main.pn-foreground .separator {
  font-size: max(1rem, 16px);
}

/* ── links: copper, underlined ── */
body.auth-page #main.pn-foreground .auth-links a,
body.auth-page #main.pn-foreground .btn-link,
body.auth-page #main.pn-foreground .auth-card a:not(.btn-oauth):not(.btn-primary),
body[data-page="authReset"] #main.pn-foreground .auth-card a:not(.btn):not(.auth-logo),
body[data-page="authVerify"] #main.pn-foreground .auth-card a:not(.btn):not(.auth-btn):not(.auth-btn-outline):not(.auth-logo) {
  color: var(--au-copper);
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.auth-page #main.pn-foreground .auth-links a:hover,
body.auth-page #main.pn-foreground .btn-link:hover { color: var(--text); }

/* ── the separator and the OAuth buttons ── */
body.auth-page .separator::before,
body.auth-page .separator::after { background: var(--au-rule); }
body.auth-page .btn-oauth {
  border-color: var(--au-rule);
  background: rgb(2 18 13 / .45);
  min-height: 48px;
  font-size: max(1rem, 16px);
}
body.auth-page .btn-oauth:hover { background: rgb(255 255 255 / .08); border-color: #e8b88c; }
body.auth-page .btn-oauth:focus-visible { outline: 3px solid #f5ecdf; outline-offset: 3px; }

/* ── e-mail verification: the status marks are cast copper tiles (ChatGPT, the same shoot as the other tiles of the
   site) instead of the colour emoji, whose paint depends on the system; the emoji stay in the markup, aria-hidden.
   The loading ring is copper on a faint copper track, not the old cyan one. ── */
body[data-page="authVerify"] #main.pn-foreground .status-icon {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto var(--pn-space-4);
  background: var(--au-mark) center / contain no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 0;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / .5));
}
body[data-page="authVerify"] #state-success .status-icon { --au-mark: url("/landing-assets/auth/status-success.webp"); }
body[data-page="authVerify"] #state-expired .status-icon { --au-mark: url("/landing-assets/auth/status-expired.webp"); }
body[data-page="authVerify"] #state-invalid .status-icon { --au-mark: url("/landing-assets/auth/status-invalid.webp"); }
body[data-page="authVerify"] #state-network .status-icon { --au-mark: url("/landing-assets/auth/status-network.webp"); }
body[data-page="authVerify"] #main.pn-foreground .spinner-large {
  border-color: rgb(214 152 101 / .22);
  border-top-color: var(--au-copper);
}

/* ── form controls: copper focus and copper checkbox ── */
body.auth-page input[type="checkbox"],
body[data-page="authReset"] input[type="checkbox"] { accent-color: #c98b5c; }

/* ── messages, readable on the jade in both themes ── */
body.auth-page .error-msg,
:root[data-theme="light"] body.auth-page .error-msg,
:root:not([data-theme="light"]) body.auth-page .error-msg {
  background: rgb(239 68 68 / .14);
  border-color: rgb(248 113 113 / .5);
  color: #fca5a5;
  font-size: max(1rem, 16px);
}
body.auth-page .status-msg { background: rgb(16 185 129 / .14); border-color: rgb(110 231 183 / .45); color: #a7f3d0; font-size: max(1rem, 16px); }
body.auth-page .success-msg { background: rgb(34 197 94 / .14); border-color: rgb(134 239 172 / .45); color: #bbf7d0; font-size: max(1rem, 16px); }

/* ===================== REAL METAL · KB#4083 S4 =====================
 * Decision #502 (Commander, 12.10.2026): metal is real copper poured into the jade, never drawn. The thin copper rim of the card (a colour token and an inset
 * light line), the copper rule under the heading, the copper hairlines of the separator and the OAuth buttons and the
 * copper loading ring were colours. The card wears the photographed rim of the element base (an overlay, nothing
 * moves), the rule is the cast copper bar, hairlines are grooves, the main action is the cast copper button, the
 * OAuth buttons are cast dark steel, the ring is ivory on a groove. The card and the actions keep reading the
 * shared tokens (contract public-auth-visual-contract: var(--card-bg) / var(--card-border), var(--pn-action-fill) /
 * var(--pn-action-ink)); the cast metal is laid over them with border-image … fill. */
body.auth-page, body[data-page="authReset"], body[data-page="authVerify"] {
  --card-border: rgb(0 0 0 / .5);
  --au-rule: rgb(0 0 0 / .55);
}
body.auth-page .auth-card, body[data-page="authReset"] .auth-card, body[data-page="authVerify"] .auth-card {
  position: relative;
  border-radius: 0;
  box-shadow: 0 18px 40px rgb(0 0 0 / .5);
}
body.auth-page .auth-card::after, body[data-page="authReset"] .auth-card::after, body[data-page="authVerify"] .auth-card::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  z-index: 1;
  border: 14px solid transparent;
  border-image: url(/shared/luxury-elements/plate-rim.webp) 130 / 14px stretch;
  pointer-events: none;
}
@media (max-width: 767px) {
  body.auth-page .auth-card::after, body[data-page="authReset"] .auth-card::after, body[data-page="authVerify"] .auth-card::after { border-width: 12px; border-image-width: 12px; }
}
body.auth-page #main.pn-foreground .auth-card h1::after,
body[data-page="authReset"] #main.pn-foreground .auth-title::after,
body[data-page="authVerify"] #main.pn-foreground .auth-card h1::after {
  width: 72px;
  height: 6px;
  border-radius: 0;
  background: url(/shared/luxury-elements/bar-copper-h.webp) center / 100% 100% no-repeat;
}
body.auth-page .separator::before,
body.auth-page .separator::after { box-shadow: 0 1px 0 rgb(150 200 170 / .12); }
body.auth-page .btn-primary, body[data-page="authReset"] :is(#submit-btn, #token-error .btn), body[data-page="authVerify"] .auth-btn {
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  border-image: url(/shared/luxury-elements/button-copper.webp) 45 65 fill / 10px 14px stretch !important;
  box-shadow: none !important;
}
:is(body.auth-page .btn-primary, body[data-page="authReset"] :is(#submit-btn, #token-error .btn), body[data-page="authVerify"] .auth-btn):hover:not(:disabled) { filter: brightness(1.1); }
body.auth-page .btn-oauth,
body.auth-page .btn-oauth:hover {
  border: 1px solid transparent;
  border-radius: 0;
  border-image: url(/shared/luxury-elements/button-steel.webp) 45 65 fill / 8px 12px stretch;
  background: #0c2a1b padding-box;
  color: #eef2f2;
}
body.auth-page .btn-oauth:hover { filter: brightness(1.12); }
body[data-page="authVerify"] #main.pn-foreground .spinner-large {
  border-color: rgb(0 0 0 / .45);
  border-top-color: #f5ecdf;
}
