/* ==========================================================================
   NoxTools member area · design 03 "Tool Launcher" (Opus 5.5) · assets/auth.css
   The guest layout: sign in, forgot / reset password, sign up, the payment redirect and other pages a visitor
   sees without the app shell. Load it after base.css. shell.js builds the frame from <body data-layout="auth">:

   <body data-layout="auth" data-auth="split" data-page="login">
     <main class="auth-main" id="main"> …page… </main>
   →  <div class="auth auth--split">
        <div class="auth-col"> <header class="auth-top">brand · Help · dark toggle</header> <main>…</main> <footer class="auth-foot"> </div>
        <aside class="auth-aside">brand panel (split only; a page can supply its own <aside class="auth-aside">)</aside>
      </div>

   data-auth="split"  (default) form column + violet brand panel on the right (≥1024 px)   login · forgot · reset
   data-auth="center" one centred card on the launcher wash                                 checkout redirect · notices
   data-auth="wide"   full-width content up to 1200 px, top-aligned                          signup

   Parts for the page content (all optional):
     .auth-panel  split-mode column (400 px)      .auth-card  bordered card (center mode, or a box inside wide pages)
     .auth-head > .auth-mark (icon tile; add .tone-green / .tone-amber / .tone-red) + .auth-title + .auth-sub
     .auth-alt    "New here? Sign up" line       .auth-legal small print under a form
   Colours come from the tokens in base.css; the brand panel has its own fixed brand palette (tokens below).
   ========================================================================== */

:root {
  --aa-bg: linear-gradient(160deg, #2A1658 0%, #1A0F3A 42%, #100B22 100%);
  --aa-wash-1: rgba(239, 68, 68, .26);
  --aa-wash-2: rgba(139, 92, 246, .42);
  --aa-border: rgba(255, 255, 255, .08);
  --aa-text: #F5F3FF;
  --aa-muted: rgba(237, 233, 254, .72);
  --aa-faint: rgba(237, 233, 254, .56);
  --aa-glass: rgba(255, 255, 255, .06);
  --aa-glass-bd: rgba(255, 255, 255, .13);
}
html[data-theme="dark"] {
  --aa-bg: linear-gradient(160deg, #22134A 0%, #160D31 45%, #0F0B1E 100%);
  --aa-wash-1: rgba(239, 68, 68, .18);
  --aa-wash-2: rgba(139, 92, 246, .30);
  --aa-border: rgba(167, 139, 250, .20);
}

/* ---------- Frame ---------- */
body[data-layout="auth"] { background: var(--bg); }
.auth { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-col {
  position: relative; isolation: isolate; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
}
/* the launcher's violet wash + dotted grid, at the top of the page */
.auth-col::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 420px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 260px at 0% 0%, var(--hero-wash), transparent 70%),
    radial-gradient(520px 220px at 100% 0%, var(--hero-wash-2), transparent 70%);
}
.auth-col::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent);
}

.auth-top { flex: none; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px; }
.auth-top .brand { margin-left: -4px; padding: 0 4px; }
.auth-top-right { display: flex; align-items: center; gap: 4px; }
.auth-help {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: background-color .15s, color .15s;
}
.auth-help:hover { background: var(--surface-3); color: var(--text); }
.auth-help .ic { width: 17px; height: 17px; color: var(--muted); }

.auth-main {
  flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 32px 48px; container: main / inline-size;
}
.auth-main:focus { outline: none; }
.auth--split .auth-main > * { width: 100%; max-width: 400px; }
.auth--center .auth-main > * { width: 100%; max-width: 480px; }
.auth--wide .auth-main { justify-content: flex-start; padding-top: 16px; }
.auth--wide .auth-main > * { width: 100%; max-width: 1200px; }
.auth-main > .demo-states { margin-top: 32px; }
.auth .sticky { top: 24px; }   /* guest pages have no fixed header (base.css keeps sticky columns under the app header) */

.auth-foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
  padding: 16px 32px 20px; font-size: 12.5px; color: var(--muted);
}
.auth-foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.auth-foot a { border-radius: 4px; }
.auth-foot a:hover { color: var(--text); }
.auth-secure { display: inline-flex; align-items: center; gap: 6px; }
.auth-secure .ic { width: 14px; height: 14px; color: var(--green-text); }

/* ---------- Page parts ---------- */
.auth-panel { display: flex; flex-direction: column; }
.auth-panel > .alert, .auth-card > .alert { margin-bottom: 16px; }
.auth-head { margin-bottom: 24px; }
.auth-head.center { text-align: center; }
.auth-head.center .auth-mark { margin-left: auto; margin-right: auto; }
.auth-mark {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 14px;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-text);
}
.auth-mark .ic { width: 22px; height: 22px; }
.auth-mark .spinner { width: 22px; height: 22px; }
/* tones for the mark (this file loads after base.css, so its violet would otherwise win over base.css's .tone-*) */
.auth-mark.tone-green { color: var(--green-text); background: var(--green-soft); border-color: var(--green-border); }
.auth-mark.tone-amber { color: var(--amber-text); background: var(--amber-soft); border-color: var(--amber-border); }
.auth-mark.tone-red { color: var(--red-text); background: var(--red-soft); border-color: var(--red-border); }
.auth-mark.brand-mark { border: 0; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.auth-mark.brand-mark img { width: 28px; height: 28px; }
.auth-title { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -.022em; color: var(--text); }
.auth-sub { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.auth-sub strong { color: var(--text-2); font-weight: 600; }
.auth-card {
  padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.auth-card > .auth-head:last-child { margin-bottom: 0; }
.auth-alt { margin-top: 24px; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
/* underlined, not only coloured (WCAG 1.4.1: "New here? Create an account" is a link inside a sentence) */
.auth-alt a { color: var(--accent-text); font-weight: 600; border-radius: 3px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.auth-alt a:hover { text-decoration-thickness: 2px; }
.auth-legal { margin-top: 16px; font-size: 12px; line-height: 1.55; color: var(--muted); text-align: center; }
.auth-legal a { color: var(--text-2); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Brand panel (split) ---------- */
.auth-aside { display: none; }
@media (min-width: 1024px) {
  .auth--split .auth-aside {
    display: block; flex: 0 0 clamp(440px, 44vw, 660px); padding: 12px 12px 12px 0;
    position: sticky; top: 0; height: 100vh; height: 100dvh;
  }
}
.aa-inner {
  position: relative; isolation: isolate; height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  gap: 32px; padding: 48px clamp(36px, 4vw, 56px); border-radius: 20px; border: 1px solid var(--aa-border);
  background: var(--aa-bg); color: var(--aa-text);
}
.aa-inner::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 320px at 100% 0%, var(--aa-wash-1), transparent 65%),
    radial-gradient(620px 420px at 0% 100%, var(--aa-wash-2), transparent 65%);
}
.aa-inner::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px); background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(80% 60% at 70% 20%, #000, transparent); mask-image: radial-gradient(80% 60% at 70% 20%, #000, transparent);
}
.aa-copy { max-width: 460px; }
.aa-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid rgba(196, 181, 253, .32); background: rgba(167, 139, 250, .14); color: #DDD6FE;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.aa-pill .ic { width: 14px; height: 14px; color: #C4B5FD; }
.aa-title { margin-top: 18px; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.18; font-weight: 700; letter-spacing: -.028em; color: #fff; }
.aa-text { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--aa-muted); }

/* a still of the launcher: search box + logo tiles */
.aa-launcher {
  padding: 14px; border-radius: 18px; border: 1px solid var(--aa-glass-bd); background: var(--aa-glass);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.aa-search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 14px; border-radius: 12px;
  background: #FFFFFF; color: #6B6B78; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.aa-search .ic { width: 18px; height: 18px; color: #6B6B78; }
.aa-q { flex: 1; min-width: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aa-keys { display: inline-flex; gap: 3px; }
.aa-keys kbd { background: #FFFFFF; border-color: #D9D9E0; color: #6B6B78; }
.aa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.aa-logo {
  height: 64px; display: flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 11px;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.aa-logo img { width: 100%; height: 28px; object-fit: scale-down; filter: url(#logoClean); }
.aa-logo .logo-fallback { font-size: 13px; }

.aa-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 22px; }
.aa-facts li { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 14px; }
.aa-facts li:first-child { padding-left: 0; }
.aa-facts li + li { border-left: 1px solid rgba(255, 255, 255, .12); }
.aa-facts strong { font-size: 19px; line-height: 26px; font-weight: 700; letter-spacing: -.015em; color: #fff; white-space: nowrap; }
.aa-facts span { font-size: 12.5px; line-height: 1.4; color: var(--aa-faint); }

/* short laptop screens: keep the panel calm */
@media (min-width: 1024px) and (max-height: 760px) {
  .aa-inner { gap: 24px; padding-top: 32px; padding-bottom: 32px; }
  .aa-text { display: none; }
  .aa-logo { height: 54px; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .aa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aa-grid > li:nth-child(n+5) { display: none; }
}

/* ---------- Tablet + phone ---------- */
@media (max-width: 1023.98px) {
  .auth-top { padding: 0 24px; }
  .auth-main { padding: 24px 24px 40px; }
  .auth-foot { padding: 16px 24px 20px; }
}
@media (max-width: 767.98px) {
  .auth-top { height: 60px; padding: 0 12px 0 16px; }
  .auth-help { width: 40px; padding: 0; justify-content: center; }
  .auth-help span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .auth-main { justify-content: flex-start; padding: 20px 16px 32px; }
  .auth--wide .auth-main { padding-top: 8px; }
  .auth-head { margin-bottom: 20px; }
  .auth-title { font-size: 23px; line-height: 30px; }
  .auth-sub { font-size: 14px; }
  .auth-card { padding: 20px; border-radius: var(--radius-lg); }
  .auth-foot { flex-direction: column; align-items: flex-start; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  .auth-col::before { height: 300px; }
}
/* phones and touch screens: the footer links (FAQs, Help Desk) are 44 px tap targets; the padding is taken back by a
   negative margin, so nothing moves (as in the app footer, base.css) */
@media (max-width: 767.98px), (pointer: coarse) {
  .auth-foot-links a { padding: 13px 9px; margin: -13px -9px; }
}
/* touch screens: the header's Help link and dark-mode button get 44 px tap areas; their 40 px boxes do not change */
@media (pointer: coarse) {
  .auth-help { position: relative; }
  .auth-help::after { content: ""; position: absolute; inset: -2px; }
  .auth-top .icon-btn::after { content: ""; position: absolute; inset: -3px; }   /* from its padding box, 1 px inside the border */
  /* sign-in page: "Forgot password?" sits on the Password label's line (login/page.css). A link button's touch padding
     reached down over the password field and its show-password button, which then lost their top 8 px to the link.
     Here the link keeps its desktop box (and focus ring), and an invisible frame fills the room between the two fields,
     which gets 4 px more (20 px instead of 16): 44 px tall, ending where the password field starts (24 Nov 2026) */
  .pw-field { margin-top: 4px; }
  .pw-field > .pw-forgot { padding: 4px 6px; margin: -4px -6px; }
  .pw-field > .pw-forgot::before { content: ""; position: absolute; inset: -18px 0 -3px; }
}

/* dark theme: the launcher still uses the dark search box and dimmed logo plates, like the real dashboard */
html[data-theme="dark"] .aa-search { background: #16161C; color: #9C9CA9; box-shadow: inset 0 0 0 1px #34343F; }
html[data-theme="dark"] .aa-search .ic { color: #9C9CA9; }
html[data-theme="dark"] .aa-keys kbd { background: #16161C; border-color: #34343F; color: #9C9CA9; }
html[data-theme="dark"] .aa-logo { filter: var(--plate-filter); }
