/* =====================================================================================================
   DS7 — Zeus Login · stylesheet of the login screens (hosted edition only)

   Layout: owner-approved A3 / A3.3 — Zeus as a full-screen background, one storm-glass panel anchored
   at the bottom, official branding at the top.

   PRESENTATION ONLY (AGENTS.md, "Login development rule"). This file is shipped as
   dist-hosted/ds7-login.css by `npm run build:hosted`. The DS7 application stylesheet (build.mjs) does
   not include it and the local edition (dist/Zeus.html) never loads it. See docs/LOGIN_BUILD.md.

   Every size, colour and spacing value lives in the token block below so a refinement is a one-line
   edit. Tokens marked CONFIRMED come from recorded owner decisions. Tokens marked PROVISIONAL were
   measured from the A3.3 comparison board or taken from existing DS7 tokens. The owner accepted them
   provisionally for this stage on 2026-11-16; they are not final values.

   Uses the existing DS7 tokens (--accent, --accent-rgb, --ds7-*) from src/styles.css and
   src/styles-tokens.css. It defines none of them.
   ===================================================================================================== */

.zl-stage {
  /* --- placement -------------------------------------------------------------------------------- */
  --zl-safe-top: env(safe-area-inset-top, 0px);
  --zl-safe-bottom: env(safe-area-inset-bottom, 0px);
  --zl-clearance: 12px; /* CONFIRMED  BC1: 12 px safe-area clearance below the panel        */
  --zl-panel-max: 450px; /* CONFIRMED  desktop panel width                                   */
  --zl-gutter: 12px; /* PROVISIONAL side margin on phones (board: about 12 px)           */
  --zl-logo-top: 14px; /* PROVISIONAL gap between the top safe area and the logo           */
  --zl-logo-width: min(84%, 330px); /* PROVISIONAL logo width (board: about 83 % of the screen)         */

  /* --- storm-glass panel ------------------------------------------------------------------------ */
  --zl-chamfer: 20px; /* PROVISIONAL angular corner cut (board: about 20 px)              */
  --zl-edge-width: 1.5px; /* PROVISIONAL cyan edge thickness                                  */
  --zl-glass-top: rgba(7, 26, 36, 0.78); /* PROVISIONAL glass tint, top                             */
  --zl-glass-bottom: rgba(2, 10, 15, 0.88); /* PROVISIONAL glass tint, bottom                          */
  --zl-glass-blur: 16px; /* PROVISIONAL background blur behind the glass                     */
  --zl-pad-x: 24px; /* PROVISIONAL (board: about 24 px)                                 */
  --zl-pad-top: 22px; /* PROVISIONAL                                                      */
  --zl-pad-bottom: 24px; /* PROVISIONAL                                                      */

  /* --- heading ---------------------------------------------------------------------------------- */
  --zl-heading-size: 22px; /* PROVISIONAL (board: about 22 px, bold, upright)                  */
  --zl-heading-gap: 24px; /* PROVISIONAL space between heading and first field                */

  /* --- fields ----------------------------------------------------------------------------------- */
  --zl-field-height: 46px; /* PROVISIONAL (board: about 44 px; 46 keeps a comfortable target)  */
  --zl-field-radius: 12px; /* PROVISIONAL = --ds7-radius-sm                                    */
  --zl-field-gap: 10px; /* PROVISIONAL (board: about 10 px)                                 */
  --zl-field-font: 16px; /* PROVISIONAL 16 px stops iPhone Safari zooming on focus           */
  --zl-field-fill: rgba(255, 255, 255, 0.04);
  --zl-field-line: rgba(170, 200, 214, 0.24);
  --zl-placeholder: #d7e4ea;

  /* --- sign-in action --------------------------------------------------------------------------- */
  --zl-cta-height: 52px; /* PROVISIONAL (board: about 52 px)                                 */
  --zl-cta-gap: 16px; /* PROVISIONAL space between the last field and the button          */
  --zl-cta-font: 18px; /* PROVISIONAL                                                      */
  --zl-cta-ink: #03212a; /* existing DS7 primary-button text colour                          */

  /* --- recovery link ---------------------------------------------------------------------------- */
  --zl-link-gap: 18px; /* PROVISIONAL space between the button and the link                */
  --zl-link-font: 15px; /* PROVISIONAL                                                      */

  /* --- artwork (see README: existing artwork used as a temporary stand-in) ---------------------- */
  --zl-art-anchor: 40.7%; /* stand-in only: keeps Zeus' head in frame and the lettering baked
                                      into zeus-opening out of frame on portrait screens              */
  --zl-art-drop: 6%; /* stand-in only: lowers the artwork so the logo clears the horns   */

  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: auto;
  background: #02090e; /* same ground as the existing opening screen                       */
  color: var(--ds7-text, #eaf7fc);
  font-family: var(--ds7-font-body, 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, sans-serif);
  /* The login sets its own base text size and line height so the page it sits on cannot shift its layout. */
  font-size: 16px;
  line-height: normal;
  -webkit-text-size-adjust: 100%;
}
.zl-stage *,
.zl-stage *::before,
.zl-stage *::after {
  box-sizing: border-box;
}

/* ---------- full-screen Zeus background ---------- */
.zl-art {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.zl-art img {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translate(var(--zl-art-anchor), var(--zl-art-drop));
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%);
  mask-image: linear-gradient(180deg, transparent 0, #000 16%);
}
/* Scrims: a darker sky for the logo, a darker floor behind the panel. */
.zl-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 9, 14, 0.78) 0,
    rgba(2, 9, 14, 0.3) 13%,
    transparent 24%,
    transparent 50%,
    rgba(2, 9, 14, 0.5) 70%,
    rgba(2, 9, 14, 0.92) 100%
  );
}
/* Landscape and desktop: the screen is covered by the part of the stand-in artwork that carries no
   baked-in lettering (the crop is the viewBox on the svg in the markup). */
.zl-art svg {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@media (min-aspect-ratio: 8/9) {
  .zl-art img {
    display: none;
  }
  .zl-art svg {
    display: block;
  }
}

/* ---------- frame: logo at the top, panel anchored at the bottom ---------- */
.zl-frame {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: calc(var(--zl-safe-top) + var(--zl-logo-top)) var(--zl-gutter)
    calc(var(--zl-safe-bottom) + var(--zl-clearance));
}

/* ---------- official branding ---------- */
.zl-logo {
  display: block;
  width: var(--zl-logo-width);
  height: auto;
  flex-shrink: 0;
  /* The existing logo file has an opaque dark ground. These two rules only soften its edge over the
     artwork; the file itself is untouched. */
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

/* ---------- storm-glass panel ---------- */
.zl-panel {
  position: relative;
  flex-shrink: 0;
  width: min(100%, var(--zl-panel-max));
}
.zl-panel-glass,
.zl-panel-edge,
.zl-panel-edge i {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.zl-panel-glass {
  background: linear-gradient(180deg, var(--zl-glass-top), var(--zl-glass-bottom));
  -webkit-backdrop-filter: blur(var(--zl-glass-blur)) saturate(1.15);
  backdrop-filter: blur(var(--zl-glass-blur)) saturate(1.15);
  clip-path: polygon(
    var(--zl-chamfer) 0,
    calc(100% - var(--zl-chamfer)) 0,
    100% var(--zl-chamfer),
    100% calc(100% - var(--zl-chamfer)),
    calc(100% - var(--zl-chamfer)) 100%,
    var(--zl-chamfer) 100%,
    0 calc(100% - var(--zl-chamfer)),
    0 var(--zl-chamfer)
  );
}
/* Illuminated cyan edge: a thin angular ring, with the glow applied by its wrapper. */
.zl-panel-edge {
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.75)) drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.35));
}
.zl-panel-edge i {
  --c: var(--zl-chamfer);
  --t: var(--zl-edge-width);
  --k: calc(var(--c) + 0.414 * var(--t));
  background: linear-gradient(180deg, #b9fbff 0, var(--accent) 22%, rgba(var(--accent-rgb), 0.62) 100%);
  clip-path: polygon(
    evenodd,
    var(--c) 0,
    calc(100% - var(--c)) 0,
    100% var(--c),
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    var(--c) 100%,
    0 calc(100% - var(--c)),
    0 var(--c),
    var(--c) 0,
    var(--k) var(--t),
    calc(100% - var(--k)) var(--t),
    calc(100% - var(--t)) var(--k),
    calc(100% - var(--t)) calc(100% - var(--k)),
    calc(100% - var(--k)) calc(100% - var(--t)),
    var(--k) calc(100% - var(--t)),
    var(--t) calc(100% - var(--k)),
    var(--t) var(--k),
    var(--k) var(--t)
  );
}
.zl-panel-body {
  position: relative;
  padding: var(--zl-pad-top) var(--zl-pad-x) var(--zl-pad-bottom);
}

/* ---------- heading ---------- */
.zl-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 var(--zl-heading-gap);
  font-size: var(--zl-heading-size);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.zl-heading-text {
  background: var(--ds7-silver-text, linear-gradient(180deg, #fff 0%, #dfe8ec 45%, #8fa3ac 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.zl-rule {
  position: relative;
  flex: 1;
  height: 2px;
  min-width: 18px;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.55);
}
.zl-rule::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: translate(50%, -50%) rotate(45deg);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
}
.zl-rule + .zl-heading-text + .zl-rule {
  transform: scaleX(-1);
}

/* ---------- fields ---------- */
.zl-form {
  margin: 0;
}
.zl-field {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--zl-field-height);
  margin-bottom: var(--zl-field-gap);
  border: 1px solid var(--zl-field-line);
  border-radius: var(--zl-field-radius);
  background: var(--zl-field-fill);
  transition:
    border-color var(--ds7-fast, 0.15s),
    box-shadow var(--ds7-fast, 0.15s);
}
.zl-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.22);
}
.zl-field-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  color: var(--accent);
}
.zl-field-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.zl-field input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 12px 0 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--ds7-text, #eaf7fc);
  font: inherit;
  font-size: var(--zl-field-font);
  letter-spacing: 0.1px;
}
/* The field frame shows focus (above); the application's own input focus styles must not add a second one. */
.zl-stage .zl-field input:focus,
.zl-stage .zl-field input:focus-visible {
  outline: none;
  box-shadow: none;
}
.zl-field input::placeholder {
  color: var(--zl-placeholder);
  opacity: 1;
}
.zl-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ds7-text, #eaf7fc);
  transition: background-color 9999s;
}
/* Show / hide password control */
.zl-eye {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 var(--zl-field-radius) var(--zl-field-radius) 0;
  background: transparent;
  color: #f2fbff;
  cursor: pointer;
}
.zl-eye svg {
  width: 26px;
  height: 26px;
  display: block;
}
.zl-eye .zl-eye-slash {
  display: none;
}
.zl-eye[aria-pressed='true'] .zl-eye-slash {
  display: block;
}

/* ---------- sign-in action ---------- */
/* Scoped under .zl-stage so the application stylesheet (form button[type=submit]) cannot change its spacing. */
.zl-stage .zl-submit {
  display: block;
  width: 100%;
  height: var(--zl-cta-height);
  margin: var(--zl-cta-gap) 0 0;
  padding: 0 16px;
  border: 1px solid rgba(197, 255, 255, 0.55);
  border-radius: var(--zl-field-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0) 50%),
    linear-gradient(90deg, #0fb0c0 0, var(--accent) 24%, #4ff0fc 50%, var(--accent) 76%, #0fb0c0 100%);
  color: var(--zl-cta-ink);
  font: inherit;
  font-size: var(--zl-cta-font);
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 22px rgba(var(--accent-rgb), 0.55),
    0 0 46px rgba(var(--accent-rgb), 0.22);
  transition:
    box-shadow var(--ds7-fast, 0.15s),
    filter var(--ds7-fast, 0.15s);
}
.zl-submit:hover {
  box-shadow:
    0 0 28px rgba(var(--accent-rgb), 0.7),
    0 0 56px rgba(var(--accent-rgb), 0.3);
}
.zl-submit:active {
  filter: brightness(0.94);
}

.zl-submit:disabled {
  cursor: progress;
  opacity: 0.8;
  filter: saturate(0.55) brightness(0.82);
  box-shadow: none;
}

/* ---------- status message (placeholder styling: no approved error or notice design exists yet) ---------- */
.zl-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 205, 148, 0.45);
  border-radius: 10px;
  background: rgba(255, 205, 148, 0.08);
  color: var(--ds7-warn, #ffcd94);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.zl-status[hidden] {
  display: none;
}
.zl-status[data-tone='notice'] {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--ds7-text, #eaf7fc);
}

/* ---------- authenticator set-up (placeholder styling: no approved design exists for these screens yet) ----- */
.zl-note {
  margin: 0 0 var(--zl-field-gap);
  color: var(--ds7-text, #eaf7fc);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.zl-qr {
  display: block;
  width: 184px;
  height: 184px;
  margin: 0 auto var(--zl-field-gap);
  padding: 8px;
  border-radius: var(--zl-field-radius);
  background: #fff;
  box-sizing: border-box;
}
.zl-key {
  margin: 0 0 var(--zl-field-gap);
  color: var(--ds7-text, #eaf7fc);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}
.zl-key-label {
  display: block;
  color: var(--zl-placeholder);
}
.zl-key code {
  font:
    14px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.04em;
  user-select: all;
}
.zl-links .zl-link + .zl-link {
  margin-left: 6px;
}

/* ---------- recovery link ---------- */
.zl-links {
  margin: var(--zl-link-gap) 0 0;
  line-height: normal;
  text-align: center;
}
.zl-link {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--accent);
  font-size: var(--zl-link-font);
  text-decoration: none;
}
.zl-link:hover {
  text-decoration: underline;
}

/* ---------- focus (DS7 rule: visible 2 px accent ring) ---------- */
.zl-eye:focus-visible,
.zl-submit:focus-visible,
.zl-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.zl-submit:focus-visible {
  outline-color: #fff;
}

/* ---------- screen-reader-only text ---------- */
.zl-stage .zl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- the page behind the login ---------- */
/* Until sign-in succeeds, nothing behind the stage is shown. The view also makes it unreachable (inert). */
html.zl-gated body > :not(.zl-stage):not(noscript) {
  visibility: hidden !important;
}
.zl-noscript {
  position: fixed;
  inset: 0;
  z-index: 301;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: #02090e;
  color: #eaf7fc;
  font:
    16px/1.5 system-ui,
    sans-serif;
  text-align: center;
}

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  .zl-stage {
    --zl-logo-width: min(60%, 420px);
    --zl-logo-top: 26px;
  }
}

/* ---------- motion: nothing here animates yet; transitions respect the DS7 settings ---------- */
@media (prefers-reduced-motion: reduce) {
  .zl-stage * {
    transition: none !important;
  }
}
