/*
 * Página de acesso (mmn_backend_mvp/public/auth.php).
 * Carregado depois de app.css; usa só os tokens de :root definidos lá e classes auth-*.
 */

/* ---------- Estrutura ---------- */

.auth-page {
  background: var(--bg);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Painel de apresentação ---------- */

.auth-story {
  --surface: #ffffff;
  --violet-soft: #eee8fc;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 72px);
  background: radial-gradient(ellipse at 0% 90%, #493475 0%, transparent 65%), linear-gradient(140deg, #0b1f3a, #142947);
  color: var(--surface);
}

.auth-story::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--surface) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface) 1px, transparent 1px);
  background-size: 70px 70px;
  opacity: 0.045;
}

.auth-story::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -190px;
  right: -200px;
  width: 530px;
  height: 530px;
  border: 1px solid rgba(226, 213, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(226, 213, 255, 0.035), 0 0 0 130px rgba(226, 213, 255, 0.025);
  pointer-events: none;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--surface);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.auth-brand:hover {
  color: var(--surface);
  text-decoration: none;
}

.auth-brand-accent {
  color: var(--violet-soft);
}

.auth-story-body {
  max-width: 560px;
  padding: 48px 0 24px;
}

.auth-overline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--violet-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-overline::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--violet-soft);
}

.auth-story-title {
  margin: 20px 0;
  color: var(--surface);
  font-size: clamp(40px, 5vw, 70px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.06em;
}

.auth-story-accent {
  color: var(--violet-soft);
}

.auth-story-text {
  max-width: 440px;
  margin: 0;
  color: var(--surface);
  font-size: 15px;
  line-height: 1.85;
  opacity: 0.8;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.auth-point {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: var(--radius-sm);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.auth-point svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--violet-soft);
}

.auth-art {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin-top: 28px;
}

.auth-art svg {
  width: min(400px, 95%);
  height: auto;
}

.auth-art-ring {
  fill: none;
  stroke: var(--violet-soft);
  stroke-opacity: 0.3;
  stroke-width: 1;
}

.auth-art-trail {
  fill: none;
  stroke: var(--violet);
  stroke-opacity: 0.35;
  stroke-width: 20;
  stroke-linecap: round;
}

.auth-art-route {
  fill: none;
  stroke: var(--violet-soft);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 3 9;
}

.auth-art-tile {
  fill: var(--navy-2);
  stroke: var(--violet-soft);
  stroke-opacity: 0.5;
}

.auth-art-check {
  fill: none;
  stroke: var(--violet-soft);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-art-dot {
  fill: var(--violet);
}

.auth-art-core {
  fill: var(--surface);
}

.auth-story-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--surface);
  font-size: 12px;
  opacity: 0.8;
}

.auth-story-footer a {
  color: inherit;
}

.auth-story-footer a:hover {
  color: var(--violet-soft);
}

/* ---------- Área do formulário ---------- */

.auth-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 28px 28px;
}

.auth-workspace:focus {
  outline: none;
}

.auth-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(470px, 100%);
  margin-bottom: 24px;
}

.auth-back {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-back:hover {
  color: var(--violet);
}

.auth-mini {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-mini .auth-brand-accent {
  color: var(--violet);
}

.auth-card {
  width: min(470px, 100%);
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(11, 31, 58, 0.09);
  border-top: 3px solid var(--accent-line);
}

/* Garante o atributo hidden mesmo sobre classes que definem display. */
.auth-card [hidden] {
  display: none;
}

.auth-card noscript .notice {
  margin: 0 0 20px;
}

.auth-label {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--violet-soft);
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-heading {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.05em;
}

.auth-heading:focus {
  outline: none;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.auth-section-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form > .field,
.auth-form > .check,
.auth-form > .notice {
  margin: 0;
}

.auth-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.auth-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch + .auth-switch {
  margin-top: 8px;
}

.auth-link {
  padding: 4px;
  border: 0;
  background: none;
  color: var(--violet);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-privacy svg {
  flex: 0 0 16px;
  margin-top: 2px;
  color: var(--violet);
}

/* Entrada visível e percurso decorativo finito, sem repetir durante a digitação. */
@keyframes azv-auth-route {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -96; }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-story-body {
    animation: azv-rise 900ms var(--ease-out);
  }

  .auth-card {
    animation: azv-rise 850ms var(--ease-out) 120ms backwards;
  }

  .auth-story::after {
    animation: azv-halo-intro 2200ms var(--ease-out);
  }

  .auth-card section:not([hidden]) {
    animation: azv-appear 550ms var(--ease-out);
  }

  .auth-art-route {
    animation: azv-auth-route 4400ms ease-out;
  }
}

/* ---------- Telas menores ---------- */

@media (max-width: 1020px) {
  .auth-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-story {
    padding: 22px 24px;
  }

  .auth-story-body,
  .auth-story-footer {
    display: none;
  }

  .auth-workspace {
    justify-content: flex-start;
    padding: 32px 20px;
  }

  .auth-mini {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-workspace {
    padding: 24px 12px;
  }

  .auth-top {
    margin-bottom: 16px;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: var(--radius-sm);
  }
}
