/* E1.7 · Acceso clínico: una secuencia de ajuste; el formulario siempre está disponible. */
body.auth-page { background: var(--surface); }
body.auth-page > .topbar { display: none; }
body.auth-page main[data-view] { max-width: none; padding: 0; }
body.auth-page .skip { z-index: 100; }
body.auth-page .stale { position: relative; z-index: 2; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); min-height: 100svh; }
main.enter > .auth-layout { animation: none; }
.auth-story {
  --ink: #f3f8fc; --phx-accent: #79beff;
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  isolation: isolate; overflow: hidden; padding: clamp(32px, 5vw, 80px); color: var(--ink);
  background: #081b2d; min-height: 760px;
}
.auth-story::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: url('../icons/auth-background.webp') center bottom / cover no-repeat;
}
.auth-story::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 27, 45, .18), rgba(8, 27, 45, .30) 58%, rgba(8, 27, 45, .55)); }
.auth-brand .brand { align-items: center; gap: 18px; }
.auth-brand .brand-mark { display: flex; }
.auth-brand .logo-mark { box-shadow: none; border-radius: 0; }
.auth-brand .brand-name { color: #f3f8fc; font-size: 2.25rem; letter-spacing: -.03em; }
.auth-brand .brand-name b { --now-lit: #81ceff; --now-glow: 0 0 9px #25a9ff99, 0 0 26px #168aff70; color: var(--now-lit); text-shadow: var(--now-glow); background: none; -webkit-text-fill-color: currentColor; }
.auth-brand .brand-by { color: #bed1e1; font-size: .75rem; }
.auth-brand .phoraxis-logo { color: #e0edf7; }
.auth-message { margin: 76px 0 128px; }
.auth-message h1 { max-width: 12ch; margin: 0 0 28px; font: 700 clamp(2.5rem, 3.85vw, 4rem)/1.10 var(--marca); letter-spacing: -.035em; text-wrap: balance; }
.auth-message h1 span { color: #a2ebd3; }
.auth-message > p { max-width: 37ch; margin: 0; color: #d1dfeb; font-size: 1.0625rem; line-height: 1.65; }
.auth-story-foot { color: #d1dfeb; font-size: .8125rem; }
.auth-story-foot p { margin: 0; }
.auth-principles { display: flex; flex-wrap: wrap; gap: 0 20px; margin-bottom: 14px !important; font-size: .9375rem; font-weight: 600; color: #f3f8fc; }
.auth-principles span + span::before { content: ''; display: inline-block; width: 3px; height: 3px; margin: 0 20px 3px 0; background: #a2ebd3; border-radius: 50%; }
.auth-access { display: flex; align-items: center; justify-content: center; padding: 60px clamp(28px, 5vw, 72px); background: var(--surface); }
.auth-access-inner { width: 100%; max-width: 390px; min-width: 0; }
.auth-form-heading { margin-bottom: 36px; }
.auth-form-heading h2 { margin: 0 0 12px; font-size: 1.625rem; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; text-wrap: balance; }
.auth-form-heading p { margin: 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.6; }
.auth-access .card { padding: 0; border: 0; border-radius: 0; box-shadow: none; margin-bottom: 26px; }
.auth-access .field { margin-bottom: 22px; }
.auth-access .field label { color: var(--ink); font-size: .875rem; margin-bottom: 9px; }
.auth-access .input-wrap input, .auth-access .input-wrap select { min-height: 52px; border-radius: 9px; padding: 12px 14px; background: var(--surface); border-color: var(--ink-3); caret-color: var(--brand); }
.auth-access .input-wrap input:focus, .auth-access .input-wrap select:focus { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: none; }
.auth-access .input-wrap:has(.password-toggle) input { padding-right: 54px; }
.password-toggle { position: absolute; right: 4px; display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); cursor: pointer; }
.password-toggle:hover { background: var(--surface-2); color: var(--ink); }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed='true'] .eye-slash { display: block; }
.auth-access .btn { border-radius: 9px; min-height: 50px; box-shadow: none; transition: background-color .16s, border-color .16s; }
.auth-access .btn.primary { background: var(--brand); color: var(--brand-ink); margin-top: 8px; }
.auth-access .btn.primary:hover { filter: none; background: color-mix(in srgb, var(--brand) 86%, var(--ink)); }
.auth-access .btn:disabled { opacity: .65; cursor: wait; filter: none; transform: none; }
.auth-access .btn.ghost { border-color: var(--line); }
.auth-arrow { width: 20px; height: 20px; margin-left: 8px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-access a { text-underline-offset: 4px; }
.auth-access form > .center { margin: 18px 0 0; }
.auth-signup { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 30px; }
.auth-signup p { color: var(--ink-2); line-height: 1.6; margin-bottom: 16px; }
.auth-footnote { margin: 32px 0 0; font-size: .75rem; line-height: 1.65; color: var(--ink-3); text-align: center; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -12px 0 24px; font-size: .875rem; text-decoration: none; }
.auth-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-access .check { background: var(--surface-2); border: 0; font-size: .8125rem; line-height: 1.6; padding: 14px; }
.auth-access .demo-panel { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-access .demo-panel .card-h { font-size: .9375rem; }
.auth-access .form-err { margin: 12px 0; }
.auth-story ::selection { background: #a2ebd3; color: #081b2d; }
@media (min-width: 1600px) { .auth-message h1 { max-width: 14ch; } }
@media (max-width: 1050px) and (min-width: 761px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
  .auth-story { padding: 36px; }
  .auth-brand .brand-name { font-size: 1.75rem; }
  .auth-brand .logo-mark { width: 56px; height: 56px; }
  .auth-message h1 { font-size: 2.5rem; }
  .auth-access { padding: 44px 32px; }
}
@media (max-width: 760px) {
  .auth-layout { display: block; min-height: 100svh; }
  .auth-story { min-height: 0; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 30px max(24px, env(safe-area-inset-left)); }
  .auth-story::before { background-size: cover; background-position: center 65%; opacity: .72; }
  .auth-story::after { background: linear-gradient(180deg, rgba(8, 27, 45, .20), rgba(8, 27, 45, .66)); }
  .auth-brand .brand { gap: 12px; }
  .auth-brand .logo-mark { width: 44px; height: 44px; }
  .auth-brand .brand-name { font-size: 1.625rem; }
  .auth-brand .brand-by { font-size: .625rem; }
  .auth-message { margin: 26px 0 0; }
  .auth-message h1 { max-width: 23ch; font-size: clamp(1.625rem, 6.5vw, 2.5rem); line-height: 1.16; margin-bottom: 12px; letter-spacing: -.025em; }
  .auth-message > p { max-width: 43ch; font-size: .8125rem; line-height: 1.6; }
  .auth-story-foot { display: none; }
  .auth-access { padding: 32px max(24px, env(safe-area-inset-right)) calc(32px + var(--safe-b)) max(24px, env(safe-area-inset-left)); }
  .auth-access-inner { max-width: 480px; }
  .auth-form-heading { margin-bottom: 26px; }
  .auth-form-heading h2 { font-size: 1.375rem; margin-bottom: 8px; }
  .auth-form-heading p { font-size: .875rem; }
  .auth-access .field { margin-bottom: 18px; }
  .auth-signup { margin-top: 26px; padding-top: 22px; }
  .auth-footnote { margin-top: 24px; }
  .auth-back { margin-bottom: 14px; }
}
@media (max-width: 380px) { .auth-story, .auth-access { padding-left: 20px; padding-right: 20px; } }
@media print { .auth-story { display: none; } .auth-layout { display: block; } }

/* La descarga baña la pantalla; no intercepta el formulario. */
.auth-layout::after { content:''; position:fixed; inset:0; z-index:10; pointer-events:none; opacity:0; background:radial-gradient(ellipse at 27% 12%,#b7f7ffcc 0%,#45b8ff88 34%,#1485df38 70%,transparent 100%); }
.auth-brand { position:relative; z-index:11; }
.energy-controls { display:flex; gap:18px; margin-top:18px; }
.energy-controls button { background:none; border:0; padding:4px 0; min-height:32px; color:#bed1e1; font:inherit; font-size:.6875rem; cursor:pointer; text-decoration:underline; text-underline-offset:4px; }
.energy-controls button:focus-visible { outline:2px solid #81ceff; outline-offset:4px; }
@keyframes screen-charge { 0% { opacity:0; } 15% { opacity:.95; } 100% { opacity:0; } }
@media(prefers-reduced-motion:no-preference) { .electric-sequence::after { animation:screen-charge .5s ease-out 2s both; } }
@media(max-width:760px) { .energy-controls { margin-top:12px; }.now-bolt { width:260px;height:310px; } }
@media(prefers-reduced-motion:reduce) { .energy-controls { display:none; } }

/* Descarga desde la esquina superior derecha hasta NOW, fugaz y sin recortes. */
.electric-sequence > .now-bolt { position:fixed; inset:0; width:100vw; height:100vh; transform:none; z-index:12; }
@media(prefers-reduced-motion:no-preference) {
 .electric-sequence > .now-bolt { animation:now-bolt .5s ease-out 2s both; }
 .electric-sequence > .now-bolt path { animation:now-strike .09s ease-out 2s both; }
}
