/* IVDNews new look: the Earthrise sign-in pages (resources/views/reader/layouts/auth.blade.php and reader/auth/*).
   From B signin.html / twofactor.html / forgot.html / reset-password.html / confirm-password.html (one shared style
   block) and the phone sheet of phone-app-signin.html. Loaded after system.css; tokens from there. The navy scene,
   the horizon and the IVDGenius(TM) glow keep their own colours (the mockup's), in both themes.
   Additions to the mockup's rules are at the end: the passkey block, coarse pointers, the arrival light. */
/* ---- Sign-in form ---- */
[hidden] { display: none !important; }
.af { display: flex; flex-direction: column; gap: var(--s-6); }
.af-head { display: flex; flex-direction: column; gap: var(--s-2); }
.af-h { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.012em; color: var(--text); }
.af-h:focus { outline: none; }
.af-lede { font-size: var(--fs-sm); line-height: 19px; color: var(--text-2); }
.af-field { display: flex; flex-direction: column; gap: var(--s-3); }
.af-labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); }
.af-label { font-size: var(--fs-sm); line-height: 18px; font-weight: 500; color: var(--text); }
.af-labelrow a { font-size: var(--fs-xs); font-weight: 500; }
.af .input { height: 38px; padding: 0 11px; font-size: var(--fs-md); border-radius: var(--r-2); }
.af .input:focus { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.af-pw { position: relative; }
.af-pw .input { padding-right: 64px; }
.af-pw-toggle { position: absolute; right: 4px; top: 4px; height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-1); background: none; color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; }
.af-pw-toggle:hover { background: var(--surface-2); color: var(--text); }
.af-field.is-invalid .input { border-color: var(--down); }
.af-field.is-invalid .input:focus { box-shadow: 0 0 0 3px var(--down-soft), 0 0 0 1px var(--down); }
.af-err { font-size: var(--fs-xs); line-height: 16px; color: var(--down); }
.af-check { margin-top: -2px; }
.af .btn-lg2 { height: 38px; font-size: var(--fs-md); font-weight: 600; border-radius: var(--r-2); }
.af .btn-primary.btn-lg2 { letter-spacing: .005em; }
.af .btn:not(.btn-primary).btn-lg2 { font-weight: 500; }
.af .btn:not(.btn-primary) .i { color: var(--text-2); }
.af-or { display: flex; align-items: center; gap: var(--s-5); margin: -2px 0; font-size: var(--fs-xs); color: var(--text-3); }
.af-or::before, .af-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.af-alert { display: flex; gap: var(--s-4); padding: 10px 12px; border-radius: var(--r-2); background: var(--down-soft); border: 1px solid color-mix(in srgb, var(--down) 28%, transparent); color: var(--text); font-size: var(--fs-sm); line-height: 19px; }
.af-alert .i { color: var(--down); margin-top: 1px; }
.af-alert a { font-weight: 500; }
.af-note { font-size: var(--fs-sm); line-height: 19px; color: var(--text-2); }
.af-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); font-size: var(--fs-sm); }
.af-links .link-btn, .af-linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }
.af-linkbtn:hover { text-decoration: underline; text-underline-offset: 2px; }
.af-back { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-sm); }
.af-back .i { width: 14px; height: 14px; }

/* who is signing in (two-factor) */
.af-who { display: flex; align-items: center; gap: var(--s-4); padding: 7px 8px 7px 7px; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface-2); font-size: var(--fs-sm); }
.af-who .av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .02em; flex: none; }
.af-who .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.af-who a { font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }

/* six-digit code: one real input (paste, autofill, screen readers) drawn as six cells */
.otp { position: relative; }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; font-size: 16px; cursor: text; z-index: 1; }
.otp-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 10px repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.otp-cells .gap { align-self: center; justify-self: center; width: 8px; height: 1.5px; background: var(--border-strong); border-radius: 1px; }
.otp-cells .c { position: relative; height: 50px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--surface); font: 500 22px/1 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; transition: border-color .12s, box-shadow .12s; }
.otp:hover .otp-cells .c { border-color: var(--text-3); }
.otp.is-focus .otp-cells .c.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.otp.is-focus .otp-cells .c.is-active:empty::after { content: ""; width: 1.5px; height: 22px; background: var(--accent); animation: otp-blink 1.05s steps(1) infinite; }
.otp.is-invalid .otp-cells .c { border-color: var(--down); color: var(--down); }
.otp.is-ok .otp-cells .c { border-color: var(--up); }
@keyframes otp-blink { 50% { opacity: 0; } }
.af .input.mono-input { font-family: var(--font-mono); font-size: 15px; letter-spacing: .04em; }

/* theme button */
.tbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); }
.tbtn:hover { background: var(--surface-3); color: var(--text); }


@media (max-width: 599px) {
  .af .input, .af .btn-lg2 { height: 44px; font-size: 16px; }
  .af-pw-toggle { top: 7px; }
  .otp-cells .c { height: 54px; }
  .af-labelrow a, .af-who a { font-size: var(--fs-sm); }
}
@media (prefers-reduced-motion: reduce) { .otp-cells .c::after { animation: none !important; } }


/* Installed app: safe areas (notch / Dynamic Island, home indicator). */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
:root { --v3-bg: #0b1f36; --v3-bg-2: #06111f; --v3-ink: #e8eef6; --v3-ink-2: #a3b6cb; --v3-link: #8fd0ff; --v3-line: rgba(159, 179, 201, .14);
  --v3-card-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 4px rgba(0, 0, 0, .18), 0 40px 100px -20px rgba(0, 0, 0, .75); --v3-globe-op: 1;
  /* IVDGenius halo: the wordmark PNG's own colours, #37B5FF -> #8F69FF (the one IVDGenius violet, see redesign/ivdgenius/brand.html), led by the violet */
  --v3-halo: linear-gradient(118deg, rgba(55, 181, 255, .55) 0%, rgba(143, 105, 255, .62) 34%, rgba(143, 105, 255, .70) 62%, rgba(143, 105, 255, .50) 100%);
  --v3-halo-op: .78; --v3-halo-blur: 44px; --v3-halo-spread: -22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --v3-bg: #070e18; --v3-bg-2: #03070c; --v3-globe-op: .72; --v3-card-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 100px -20px rgba(0, 0, 0, .95); --v3-halo-op: .62; --v3-halo-blur: 48px; } }
:root[data-theme="dark"] { --v3-bg: #070e18; --v3-bg-2: #03070c; --v3-globe-op: .72; --v3-card-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 100px -20px rgba(0, 0, 0, .95); --v3-halo-op: .62; --v3-halo-blur: 48px; }

body { background: var(--v3-bg-2); }
.v3 { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 56px 1fr auto; color: var(--v3-ink-2);
  background: linear-gradient(180deg, var(--v3-bg-2) 0%, var(--v3-bg) 55%, var(--v3-bg-2) 100%); }
.v3-globe { position: absolute; z-index: -1; left: 0; bottom: 0; width: 100%; height: 38vh; min-height: 300px; pointer-events: none; opacity: var(--v3-globe-op); }
.v3-top { display: flex; align-items: center; gap: var(--s-6); padding: 0 var(--s-6) 0 var(--s-8); }
.v3-top .logo { width: 113px; height: 30px; }
.v3-tagline { font-size: var(--fs-xs); color: var(--v3-ink-2); padding-left: var(--s-6); border-left: 1px solid var(--v3-line); line-height: 20px; letter-spacing: .01em; }
.v3-top .tbtn { margin-left: auto; color: var(--v3-ink-2); }
.v3-top .tbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.v3-top { padding-top: var(--sat); padding-right: max(var(--s-6), var(--sar)); padding-left: max(var(--s-8), var(--sal)); }
/* The card's top edge sits at the same height on every page; taller pages grow downwards. */
.v3-main { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: max(24px, calc(50vh - 348px)) var(--s-6) 120px; }
.v3-cardwrap { position: relative; width: 100%; max-width: 392px; }
/* Light from behind the card: a blurred copy of the wordmark gradient, layered under the depth shadow. */
.v3-cardwrap::before { content: ""; position: absolute; z-index: -1; inset: var(--v3-halo-spread) var(--v3-halo-spread) 8px; border-radius: 22px; background: var(--v3-halo);
  filter: blur(var(--v3-halo-blur)); opacity: var(--v3-halo-op); pointer-events: none; }
.v3-card { position: relative; width: 100%; padding: 28px 32px 0; background: var(--surface); border-radius: 10px; box-shadow: var(--v3-card-shadow); overflow: hidden; }
.v3-headrow { display: flex; align-items: center; gap: 15px; min-height: 34px; }
.v3-headrow .logo { width: 124px; height: 33px; flex: none; margin-top: -1px; }
.v3-headrow .sep { flex: none; width: 1px; height: 26px; background: var(--border-strong); }
.v3-headrow .af-h { font-size: 20px; line-height: 28px; white-space: nowrap; }
.v3-powered { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px -32px 0; height: 40px; background: #0b1f36; color: #8ea7c2; font-size: 10.5px; line-height: 1; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
.v3-powered::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(55, 181, 255, 0), rgba(55, 181, 255, .55) 35%, rgba(143, 105, 255, .65) 65%, rgba(143, 105, 255, 0)); }
.v3-powered img { display: block; height: 18px; width: auto; margin-top: 1px; }
:root[data-theme="dark"] .v3-powered { background: #0a1729; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .v3-powered { background: #0a1729; } }
.v3-after { margin-top: var(--s-8); font-size: var(--fs-sm); color: var(--v3-ink-2); }
.v3-after .af-linkbtn { color: var(--v3-link); }
.v3-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3) var(--s-7); padding: 14px var(--s-8) 18px; font-size: var(--fs-xs); color: var(--v3-ink-2); }
.v3-foot nav { display: flex; gap: var(--s-6); }
.v3-foot nav a { color: var(--v3-ink-2); }
.v3-foot nav a:hover { color: #fff; }
.v3-foot strong { color: var(--v3-ink); font-weight: 500; }
/* focus on the navy page: a light ring, offset so it never sits on the text */
.v3-top :focus-visible, .v3-foot :focus-visible, .v3-after :focus-visible { outline: 2px solid #8fd0ff; outline-offset: 3px; border-radius: 3px; }
.v3-intro, .v3-cardfoot { display: none; }
/* "No subscription?" sits inside the card, above the band, so it never crosses the horizon */
.v3-after.in { margin: var(--s-7) 0 0; padding-top: var(--s-6); border-top: 1px solid var(--border); color: var(--text-2); }
.v3-after.in .af-linkbtn { color: var(--accent); }

/* ---- flow pieces (forgot, reset, confirm) ---- */
.af-alert.is-ok { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.af-alert.is-ok .i { color: var(--up); }
.af-alert.is-info { background: var(--accent-soft); border-color: var(--accent-line); }
.af-alert.is-info .i { color: var(--accent); }
.af-alert strong { font-weight: 600; }
.af-who .av.av-icon { background: var(--accent-soft); color: var(--accent); }
.af-who .av .i { width: 14px; height: 14px; }
.af-who .who2 { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.af-who .who2 .em { flex: none; }
.af-who .who2 small { font-size: var(--fs-xs); line-height: 16px; color: var(--text-2); }
.af-who.is-tall { align-items: flex-start; padding: 8px 10px 8px 8px; }
.af-who.is-tall .av { width: 28px; height: 28px; font-size: 11px; margin-top: 1px; }
.af-rules { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 1px 0 0; padding: 0; list-style: none; font-size: var(--fs-xs); line-height: 16px; color: var(--text-3); }
.af-rules li { display: inline-flex; align-items: center; gap: 6px; transition: color .15s; }
.af-rules li::before { content: ""; box-sizing: border-box; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--border-strong); transition: background-color .15s, border-color .15s; }
.af-rules li.is-met { color: var(--text-2); }
.af-rules li.is-met::before { border-color: var(--up); background: var(--up) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.3 6.2l1.8 1.8 3.6-4' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.af-rules li.is-miss { color: var(--down); }
.af-rules li.is-miss::before { border-color: var(--down); }
.af-match { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); line-height: 16px; }
.af-match .i { width: 13px; height: 13px; }
.af-match.is-ok { color: var(--up); }
.af-match.is-bad { color: var(--down); }
.af-field.is-invalid .input { border-color: var(--down); }
.af .btn[disabled] { opacity: 1; cursor: default; color: var(--text-3); background: var(--surface-2); border-color: var(--border); }
.af-count { font-variant-numeric: tabular-nums; font-weight: 400; margin-left: 4px; }
.af-tip { font-size: var(--fs-xs); line-height: 17px; color: var(--text-3); margin-top: -4px; }
.af-links .af-aside { font-size: var(--fs-xs); color: var(--text-3); }
a.af-back:hover { color: var(--text); text-decoration: none; }
.af-links { min-height: 20px; }

@media (max-width: 599px) {
  body { background: var(--surface); }
  /* Phone: the logo is in the navy band above the tagline (where the launch scene leaves it) and on the card too. */
  .v3 { grid-template-rows: auto 1fr; overflow: hidden; }
  .v3-top { position: absolute; top: 0; right: 0; z-index: 2; height: auto; padding: calc(12px + var(--sat)) max(8px, var(--sar)) 0 0; }
  .v3-top .logo, .v3-tagline, .v3-foot { display: none; }
  .v3-globe { top: calc(18px + var(--sat)); bottom: auto; height: 300px; min-height: 0; }
  .v3-intro { display: block; padding: calc(16px + var(--sat)) 64px 70px max(20px, var(--sal)); }
  .v3-intro-logo { width: 136px; height: 36px; margin-bottom: 10px; }
  .v3-intro p { font-family: var(--font-read); font-size: 16px; line-height: 21px; color: #c9d8e8; max-width: none; }
  .v3-main { padding: 0; justify-content: flex-start; align-items: stretch; }
  .v3-cardwrap { flex: 1; max-width: none; display: flex; flex-direction: column; }
  /* bottom sheet: the halo only along the top edge */
  .v3-cardwrap::before { inset: -10px 6% auto; height: 46px; border-radius: 50%; filter: blur(22px); opacity: calc(var(--v3-halo-op) * .9); }
  .v3-card { flex: 1; display: flex; flex-direction: column; border-radius: 16px 16px 0 0; padding: 22px max(20px, var(--sar)) 0 max(20px, var(--sal)); box-shadow: 0 -16px 40px -12px rgba(0, 0, 0, .55); }
  .v3-after { margin: var(--s-8) 0 0; padding-top: var(--s-6); border-top: 1px solid var(--border); color: var(--text-2); }
  .v3-after .af-linkbtn { color: var(--accent); }
  .v3-cardfoot { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: auto; padding-top: var(--s-8); font-size: var(--fs-xs); }
  .v3-cardfoot a { color: var(--text-3); }
  .v3-headrow { gap: 13px; }
  .v3-headrow .logo { width: 106px; height: 28px; }
  .v3-headrow .sep { height: 24px; }
  .v3-headrow .af-h { font-size: 20px; }
  .v3-powered { margin: 18px calc(-1 * max(20px, var(--sar))) 0 calc(-1 * max(20px, var(--sal))); height: auto; padding: 13px 16px calc(13px + var(--sab)); }
  .af-rules { gap: 4px 12px; }
}
/* Phone with the on-screen keyboard up (the layout viewport shrinks): the navy band folds away so the field
   and its button stay in view; the sheet takes the whole screen and clears the status bar. */
@media (max-width: 599px) and (max-height: 600px) {
  .v3-intro, .v3-globe, .v3-top, .v3-cardwrap::before, .v3-cardfoot, .v3-after, .v3-powered { display: none; }
  .v3 { grid-template-rows: 1fr; }
  .v3-card { border-radius: 0; box-shadow: none; padding-top: calc(16px + var(--sat)); padding-bottom: 16px; }
}

/* ---- "Where to?" (B start.html): the staff chooser ---- */
.st-list { display: grid; gap: 10px; margin-top: 4px; }
.st-card { display: block; position: relative; padding: 13px 40px 13px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .12s, background .12s, box-shadow .12s; }
.st-card::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -5px; border-right: 2px solid var(--accent); border-top: 2px solid var(--accent); transform: rotate(45deg); }
.st-card:hover { border-color: var(--accent); background: var(--surface-2, var(--surface)); text-decoration: none; }
.st-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-t { display: block; font-weight: 600; font-size: 15px; line-height: 20px; }
.st-d { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-2); }
/* phone: the card is the full-height sheet, the IVDGenius band at its foot */
@media (max-width: 599px) {
  #start { flex: 1; }
  .st-card { padding: 15px 40px 15px 14px; }
  .st-t { font-size: 16px; }
  .st-d { font-size: 14px; line-height: 20px; }
}

/* ---- Additions (not in the mockup's style block) ---- */
/* the passkey block: passkey.js unhides it where the browser can use a passkey */
.af-passkey { display: flex; flex-direction: column; gap: var(--s-6); }
.v3-after a.af-linkbtn:hover { text-decoration: underline; text-underline-offset: 2px; }
.af-who a.af-change, .af-who [data-sent-change] { font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.otp-input:focus-visible { outline: none; }
.v3-sweep { opacity: 0; }
.v3-foot { padding-bottom: calc(18px + var(--sab)); padding-left: max(var(--s-8), var(--sal)); padding-right: max(var(--s-8), var(--sar)); }

/* Touch screens at any width (tablets, the installed app): 44px controls and 16px inputs (no zoom on focus). */
@media (pointer: coarse) {
  .af .input, .af .btn-lg2 { height: 44px; font-size: 16px; }
  .af-pw-toggle { top: 4px; height: 36px; }
  .af-labelrow a, .af-who a, .v3-after a, .af-cardfoot a, .v3-cardfoot a { padding: 12px 0; margin: -12px 0; }
  .af-links .af-linkbtn, .af-back { min-height: 44px; margin: -12px 0; }
  .otp-cells .c { height: 54px; }
  .v3-top .tbtn { width: 44px; height: 44px; }
}

/* Arrival (once per browser session, set in the head): one pass of light along the horizon, left to right, and the
   glow behind the card blooming; over within 1.4 s. Reduce Motion: nothing moves. */
@media (prefers-reduced-motion: no-preference) {
  .er-arrive .v3-sweep { animation: er-sweep 1.1s cubic-bezier(.45, 0, .25, 1) .2s both; }
  .er-arrive .v3-cardwrap::before { animation: er-bloom .9s ease-out .1s both; }
}
@keyframes er-sweep { 0% { opacity: 0; stroke-dashoffset: -560; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: -930; } }
@keyframes er-bloom { from { opacity: calc(var(--v3-halo-op) * .55); transform: scale(.94); } to { opacity: var(--v3-halo-op); transform: none; } }
