/* Atrium sign-in surfaces: login, OTP, enrolment, password reset, logout confirm, Admin login.
   Design: design/frozen-20261025/ledger-login-direction-20261020.html (login). OTP, enrolment and reset are not in
   the design: they follow the same single card. Tokens only; the yellow visual panel is built from --at-accent. */
@layer atrium.pages {
  .at-auth-body { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; margin: 0; padding: 24px; background: var(--at-window-page-bg); color: var(--at-ink); font-family: var(--at-font-ui); }
  .at-auth { width: 100%; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.06fr 1fr; gap: 12px; padding: 12px; border: 1px solid var(--at-edge); border-radius: 30px; background: var(--at-window-bg); box-shadow: var(--at-shadow-shell); }
  .at-auth--solo { max-width: 520px; grid-template-columns: minmax(0, 1fr); }
  .at-auth__panel { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-width: 0; padding: 36px 48px; border-radius: 22px; background: var(--at-glass-panel); }
  .at-auth--solo .at-auth__panel { padding: 32px 36px; }
  .at-auth__brand { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; min-height: 44px; margin: -12px 0; font: 700 14px/1.4 var(--at-font-ui); color: var(--at-ink); text-decoration: none; }
  .at-auth__brand img { width: 20px; height: 20px; border-radius: 6px; }
  .at-auth__main { display: flex; flex-direction: column; }
  .at-auth h1 { margin: 0 0 12px; font: 700 clamp(26px, 3vw, 34px)/1.15 var(--at-font-display); letter-spacing: -.03em; }
  .at-auth__lead { margin: 0 0 24px; color: var(--at-ink-2); font-size: var(--at-fs-body); }
  .at-auth form { display: grid; gap: 18px; }
  .at-auth .at-field > small { display: block; margin-top: 6px; color: var(--at-ink-3); font-size: var(--at-fs-meta); }
  .at-auth__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .at-auth__row > label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 600; line-height: 1.4; }
  .at-auth__row a { display: inline-flex; align-items: center; min-height: 44px; margin: -13px 0; font-size: var(--at-fs-meta); color: var(--at-link); }
  .at-auth .at-btn--primary { width: 100%; min-height: 44px; margin-top: 4px; }
  .at-auth__password { position: relative; }
  .at-auth__password input { padding-right: 112px; }
  .at-auth__reveal { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); isolation: isolate; min-width: 64px; min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--at-ink-2); font: 500 11px/1 var(--at-font-ui); cursor: pointer; }
  .at-auth__reveal::before { content: ""; position: absolute; z-index: -1; inset: 6px 4px; border-radius: var(--at-r-pill); background: var(--at-surface-chip); }
  .at-auth__foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--at-line); font-size: var(--at-fs-meta); color: var(--at-ink-2); }
  .at-auth__foot a { display: inline-flex; align-items: center; min-height: 44px; margin: -13px 0; }
  .at-auth__hint :is(a, button) { position: relative; }
  .at-auth__hint :is(a, button)::after { content: ""; position: absolute; inset: -14px -6px; }
  .at-auth__foot a, .at-auth a.at-auth__link, .at-auth button.at-auth__link { color: var(--at-link); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
  .at-auth button.at-auth__link { padding: 0; border: 0; background: none; cursor: pointer; }
  .at-auth__hint { margin: 16px 0 0; font-size: var(--at-fs-meta); color: var(--at-ink-2); }
  .at-auth .at-error { min-height: 0; margin: 0 0 12px; }
  .at-auth .at-error:empty { display: none; }
  .at-auth .at-inline-state { margin: 0 0 14px; }
  .at-auth .at-inline-state[hidden] { display: none; }

  /* Login id as two columns: short company code + username. */
  .at-loginid { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 12px; align-items: end; }
  .at-loginid label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
  .at-loginid__org input { text-transform: uppercase; letter-spacing: .08em; }

  /* One-time code boxes (six single digits). */
  .at-otp { display: flex; gap: 8px; justify-content: center; margin: 4px 0 18px; }
  .at-otp[hidden] { display: none; }
  .at-otp input { width: 48px; height: 56px; min-height: 0; padding: 0; text-align: center; border-radius: 14px; font: 600 22px/1 var(--at-font-mono); }
  .at-auth input[hidden] { display: none; }
  @media (max-width: 420px) { .at-otp { gap: 6px; } .at-otp input { width: 42px; height: 52px; } }

  /* QR, fallback secret and backup codes. */
  .at-qr { display: flex; justify-content: center; margin: 4px 0 16px; }
  .at-auth { --at-qr-bg: #fff; } /* a QR code must stay dark on white in both themes */
  .at-qr img { width: 176px; height: 176px; padding: 8px; border-radius: 14px; border: 1px solid var(--at-line); background: var(--at-qr-bg); }
  .at-secret { margin: 0 0 18px; text-align: center; }
  .at-secret summary { cursor: pointer; font-size: var(--at-fs-meta); color: var(--at-ink-2); }
  .at-secret code { display: block; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--at-line); border-radius: 10px; background: var(--at-surface-sunk); font: 400 13px/1.5 var(--at-font-mono); letter-spacing: .04em; overflow-wrap: anywhere; }
  .at-backup { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--at-line); border-radius: 12px; background: var(--at-surface-sunk); font: 400 13px/2 var(--at-font-mono); white-space: pre-line; }
  .at-auth [hidden] { display: none !important; }

  /* Password rules (reset). */
  .at-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--at-fs-meta); color: var(--at-ink-2); }
  .at-rules .ok { color: var(--at-good-ink); }

  /* The yellow visual panel (login and Admin login). */
  .at-auth__visual { --at-wave: #fff7d5; --at-sun: #fff8d3; --at-visual-ink: #29210a; /* the panel is yellow in both themes, so its light strokes are theme independent */
    position: relative; min-height: 630px; overflow: hidden; border-radius: 21px; isolation: isolate; color: var(--at-visual-ink);
    background: linear-gradient(145deg, color-mix(in srgb, var(--at-accent) 62%, white), var(--at-accent) 65%, color-mix(in srgb, var(--at-accent) 86%, black)); }
  .at-auth__sun { position: absolute; z-index: 1; right: -89px; top: 172px; width: 250px; height: 250px; border-radius: 50%; background: var(--at-sun);
    box-shadow: 0 0 0 26px color-mix(in srgb, var(--at-sun) 40%, transparent), 0 0 0 58px color-mix(in srgb, var(--at-sun) 22%, transparent); }
  .at-auth__sun::after { content: ""; position: absolute; inset: 64px; border-radius: 50%; background: var(--at-accent); }
  .at-auth__waves { position: absolute; z-index: 2; left: 0; top: 0; width: calc(100% + 24px); height: 630px; pointer-events: none; }
  .at-auth__waves path { fill: none; stroke: var(--at-wave); stroke-width: 40; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .95; }
  .at-auth__visual-copy { position: absolute; z-index: 3; left: 38px; right: 38px; bottom: 39px; }
  .at-auth__visual h2 { max-width: 510px; margin: 0; font: 800 clamp(31px, 3.5vw, 45px)/1.05 var(--at-font-display); letter-spacing: -.06em; }
  .at-auth__signature { display: flex; align-items: center; gap: 11px; margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
  .at-auth__signature strong { font-size: 12px; letter-spacing: .2em; }
  .at-auth__signature span { padding-left: 11px; border-left: 1px solid color-mix(in srgb, var(--at-visual-ink) 45%, transparent); }
  @media (prefers-reduced-motion: no-preference) {
    .at-auth__waves path { stroke-dashoffset: 1; animation: at-auth-travel 1.1s cubic-bezier(.22, .78, .24, 1) both; }
    .at-auth__waves path:nth-child(2) { animation-delay: .1s; } .at-auth__waves path:nth-child(3) { animation-delay: .2s; } .at-auth__waves path:nth-child(4) { animation-delay: .3s; }
    .at-auth__sun { animation: at-auth-arrive .45s ease-out 1.55s both; }
  }
  @keyframes at-auth-travel { to { stroke-dashoffset: 0; } }
  @keyframes at-auth-arrive { from { opacity: 0; transform: scale(.78); } to { opacity: 1; transform: scale(1); } }

  @media (max-width: 760px) {
    .at-auth-body { padding: 12px; }
    .at-auth { grid-template-columns: minmax(0, 1fr); }
    .at-auth__panel, .at-auth--solo .at-auth__panel { padding: 28px 22px; }
    .at-auth__visual { min-height: 300px; order: 2; }
    .at-auth__waves { height: 300px; }
    .at-auth__sun { top: 65px; width: 160px; height: 160px; right: -55px; }
    .at-auth__sun::after { inset: 42px; }
    .at-auth__visual-copy { left: 24px; bottom: 24px; }
    .at-auth__visual h2 { font-size: 28px; }
  }
}
