/* Painel da marca das telas de acesso (login e cadastro): grade em duas colunas,
   infinito do logo animado por js/auth-stage.js e frase em Archivo. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url("../assets/fonts/archivo-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

  .auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  .auth-stage {
    --stage-night: #071224;
    --stage-night-2: #0b1a33;
    --stage-signal: #2f86ff;
    --stage-signal-soft: #8cbcff;
    --stage-text: #e8f0fb;
    --stage-muted: #9fb2cc;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: clamp(32px, 5vw, 64px);
    background:
      radial-gradient(120% 80% at 70% 42%, rgba(47, 134, 255, .16), transparent 60%),
      linear-gradient(180deg, var(--stage-night-2), var(--stage-night));
    color: var(--stage-text);
  }
  .auth-stage-grid {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
      linear-gradient(rgba(140, 188, 255, .06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(140, 188, 255, .06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(90% 70% at 60% 45%, #000 30%, transparent 85%);
    mask-image: radial-gradient(90% 70% at 60% 45%, #000 30%, transparent 85%);
  }
  /* Camadas criadas por js/auth-stage.js quando há mouse: foco de luz e grade acesa sob o cursor. */
  .auth-stage-spot,
  .auth-stage-grid-lit {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-slow) var(--motion-ease-out);
  }
  .auth-stage-spot {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: radial-gradient(440px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(79, 216, 255, .14), rgba(47, 134, 255, .07) 42%, transparent 70%);
  }
  .auth-stage-grid-lit {
    background-image:
      linear-gradient(rgba(143, 220, 255, .34) 1px, transparent 1px),
      linear-gradient(90deg, rgba(143, 220, 255, .34) 1px, transparent 1px);
    -webkit-mask-image: radial-gradient(230px circle at var(--spot-x, 50%) var(--spot-y, 50%), #000, transparent);
    mask-image: radial-gradient(230px circle at var(--spot-x, 50%) var(--spot-y, 50%), #000, transparent);
  }
  .auth-stage.is-pointing .auth-stage-spot,
  .auth-stage.is-pointing .auth-stage-grid-lit { opacity: 1; }

  .auth-flow {
    --flow-shift: -50%;
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 25%;
    width: min(88%, 600px);
    overflow: visible;
    /* --tilt-x/--tilt-y (-0,5 a 0,5) são atualizados por js/auth-stage.js conforme o cursor. */
    transform:
      translate(var(--flow-shift), -50%)
      perspective(900px)
      translate3d(calc(var(--tilt-x, 0) * 26px), calc(var(--tilt-y, 0) * 18px), 0)
      rotateX(calc(var(--tilt-y, 0) * -16deg))
      rotateY(calc(var(--tilt-x, 0) * 20deg));
    pointer-events: none;
  }
  .auth-flow path { fill: none; }
  .auth-flow .aura { stroke: url(#authFlowInk); stroke-width: 30; opacity: 0; filter: blur(16px); }
  .auth-flow .strand { stroke: url(#authFlowInk); stroke-width: 1; opacity: 0; }
  .auth-flow .core {
    stroke: url(#authFlowInk);
    stroke-width: 2.4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(47, 134, 255, .75));
  }
  .auth-flow .core.is-drawing { transition: stroke-dashoffset calc(var(--motion-slow) * 4) var(--motion-ease-inout); }
  .auth-flow .aura,
  .auth-flow .strand,
  .auth-flow .flux { transition: opacity calc(var(--motion-slow) * 3) var(--motion-ease-out) calc(var(--motion-slow) * 2); }
  .auth-flow.is-ready .aura { opacity: .26; }
  .auth-flow.is-ready .s1 { opacity: .4; }
  .auth-flow.is-ready .s2 { opacity: .22; }
  .auth-flow.is-ready .s3 { opacity: .1; }
  /* Pulsos de dados correndo pela curva; o período do tracejado (40) divide o pathLength (400). */
  .auth-flow .flux {
    stroke: #d6efff;
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-dasharray: 3 37;
    opacity: 0;
    animation: auth-flux var(--motion-auth-flux) var(--motion-ease-linear) infinite;
  }
  .auth-flow.is-ready .flux { opacity: .5; }
  .auth-flow .trail { stroke-linecap: round; }
  .auth-flow .t1 { stroke: rgba(79, 216, 255, .22); stroke-width: 1.6; }
  .auth-flow .t2 { stroke: rgba(92, 170, 255, .6); stroke-width: 2.8; }
  .auth-flow .t3 { stroke: #dff3ff; stroke-width: 3.6; filter: drop-shadow(0 0 6px rgba(79, 216, 255, .95)); }
  .auth-flow .head-core { fill: #fff; filter: drop-shadow(0 0 5px #4fd8ff); }
  .auth-flow .head-halo {
    fill: url(#authFlowHalo);
    transform-box: fill-box;
    transform-origin: center;
    animation: auth-head-pulse var(--motion-auth-pulse) var(--motion-ease-inout) infinite alternate;
    transition: scale var(--motion-slow) var(--motion-ease-out);
  }
  .auth-flow.is-chasing .head-halo { scale: 1.5; }
  .auth-flow .trail,
  .auth-flow .head { opacity: 0; transition: opacity var(--motion-slow) var(--motion-ease-out); }
  .auth-flow.is-live .trail,
  .auth-flow.is-live .head { opacity: 1; }
  .auth-flow .dust circle {
    fill: #a9d6ff;
    opacity: .2;
    transform: translate(calc(var(--tilt-x, 0) * var(--depth) * -22px), calc(var(--tilt-y, 0) * var(--depth) * -16px));
    animation: auth-dust-twinkle var(--motion-auth-twinkle) var(--motion-ease-inout) infinite alternate;
  }
  /* Os nós ficam sempre acesos sobre a fita e acendem mais forte quando o sinal passa. */
  .auth-flow .node { fill: #6fb8ff; stroke: rgba(207, 230, 255, .9); stroke-width: 1.2; filter: drop-shadow(0 0 4px rgba(79, 216, 255, .7)); transition: fill var(--motion-slow) var(--motion-ease-out), stroke var(--motion-slow) var(--motion-ease-out), filter var(--motion-slow) var(--motion-ease-out); }
  .auth-flow .node-ring { fill: none; stroke: #4fd8ff; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
  .auth-flow .is-hit .node { fill: #eaf5ff; stroke: #ffffff; filter: drop-shadow(0 0 8px rgba(79, 216, 255, 1)); }
  .auth-flow .is-hit .node-ring { animation: auth-node-ping calc(var(--motion-slow) * 3) var(--motion-ease-out); }

  .auth-stage-kind {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--stage-muted);
    font-size: 13px;
    font-weight: 500;
  }
  .auth-stage-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .16); }
  .auth-stage-copy { max-width: 30rem; margin-top: auto; }
  .auth-stage-title {
    color: #fff;
    font-family: "Archivo", var(--font-body);
    font-stretch: 112%;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.025em;
    text-wrap: balance;
  }
  .auth-stage-title span { color: var(--stage-signal-soft); }
  .auth-stage-text {
    max-width: 26rem;
    margin-top: 16px;
    color: var(--stage-muted);
    font-size: 16px;
    line-height: 1.55;
  }
  .auth-stage-steps { margin-top: 32px; list-style: none; border-top: 1px solid rgba(140, 188, 255, .16); }
  .auth-stage-steps li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 14px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid rgba(140, 188, 255, .12);
    color: var(--stage-muted);
    font-size: 14.5px;
    transition: color var(--motion-slow) var(--motion-ease-out);
  }
  .auth-stage-steps svg { color: rgba(140, 188, 255, .55); transition: color var(--motion-slow) var(--motion-ease-out), filter var(--motion-slow) var(--motion-ease-out); }
  .auth-stage-steps li.is-active { color: #fff; }
  .auth-stage-steps li.is-active svg { color: #9cc6ff; filter: drop-shadow(0 0 6px rgba(47, 134, 255, .8)); }
  .auth-stage-steps small { display: block; margin-top: 1px; color: rgba(159, 178, 204, .8); font-size: 12.5px; }

  /* Em telas largas o painel acompanha a rolagem de formulários longos (cadastro). */
  @media (min-width: 761px) {
    .auth-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; }
  }
  @media (max-width: 1080px) {
    .auth-shell { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
    .auth-stage-steps { display: none; }
    .auth-flow { top: 32%; width: 96%; }
  }
  @media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-stage { min-height: 168px; padding: 24px 20px; gap: 0; }
    .auth-stage-kind, .auth-stage-text, .auth-stage-steps { display: none; }
    .auth-stage-title { max-width: 18rem; font-size: 22px; }
    .auth-flow { --flow-shift: -28%; width: 420px; top: 38%; }
  }
  /* Notebooks baixos: a lista de etapas sai para o laço e a frase não se sobreporem. */
  @media (max-height: 760px) and (min-width: 761px) {
    .auth-stage-steps { display: none; }
    .auth-flow { top: 36%; width: min(80%, 520px); }
  }
  @media (prefers-reduced-motion: reduce) {
    .auth-flow, .auth-flow * { transition: none !important; animation: none !important; }
  }
