/**
 * MinhaDoula — telas de autenticação (cadastro, login, verificação)
 * Mobile first · tokens.css + auth.css · ver .ai/frontend.md
 */

.auth-shell,
.auth-shell *,
.auth-shell *::before,
.auth-shell *::after {
  box-sizing: border-box;
}

.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 80% 50% at 80% -10%, rgba(217, 144, 168, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 0% 110%, rgba(155, 138, 203, 0.16), transparent 50%),
    var(--md-surface);
  color: var(--md-ink);
  font-family: var(--md-font-ui), sans-serif;
}

.auth-top {
  padding: 16px 16px 0;
  display: flex;
  justify-content: center;
}

.auth-logo {
  display: block;
  line-height: 0;
}

.auth-logo img {
  width: min(148px, 46vw);
  height: auto;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 20px 16px 28px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  overflow: hidden;
  padding: 22px 18px 24px;
  border: 1px solid var(--md-line);
  border-radius: var(--md-radius-lg);
  background: var(--md-white);
  box-shadow: var(--md-shadow);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--md-accent), var(--md-primary));
}

.auth-card--wide {
  max-width: 520px;
}

.auth-head {
  text-align: center;
  margin-bottom: 20px;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: var(--md-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 8px;
  font-family: var(--md-font-display);
  font-size: clamp(1.28rem, 5.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--md-ink);
  text-wrap: balance;
}

.auth-copy {
  margin: 0;
  color: var(--md-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-copy--tight {
  margin-bottom: 16px;
}

.auth-hint-badge {
  display: inline-block;
  margin: 10px 0 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff6d6;
  border: 1px solid rgba(180, 130, 20, 0.28);
  color: #7a5a12;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

.auth-hint-badge strong {
  font-weight: 750;
}

.auth-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--md-radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.auth-notice--ok {
  background: #eceaf7;
  color: var(--md-primary);
  border: 1px solid rgba(57, 58, 143, 0.18);
}

.auth-notice--error {
  background: var(--md-rose-bg);
  color: var(--md-rose);
  border: 1px solid rgba(156, 88, 114, 0.22);
}

.auth-tentativas {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--md-radius-sm);
  background: #fff8ec;
  color: #8a5a12;
  border: 1px solid rgba(201, 162, 39, 0.28);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
}

.auth-form,
.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.auth-field span {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--md-muted);
}

.auth-field span em {
  color: var(--md-rose);
  font-style: normal;
}

.auth-input,
.auth-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(57, 58, 143, 0.14);
  border-radius: 14px;
  background: var(--md-surface);
  color: var(--md-ink);
  font: inherit;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-input::placeholder,
.auth-select:invalid {
  color: #9a9bb3;
  font-weight: 500;
}

.auth-input:hover,
.auth-select:hover {
  border-color: rgba(57, 58, 143, 0.28);
}

.auth-input:focus,
.auth-select:focus {
  outline: 2px solid var(--md-accent);
  outline-offset: 2px;
  border-color: rgba(57, 58, 143, 0.28);
  background: var(--md-white);
}

.auth-input.is-invalid,
.auth-select.is-invalid {
  border-color: var(--md-rose);
}

.auth-input[type="date"] {
  color-scheme: light;
  min-height: 52px;
}

.auth-select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  cursor: pointer;
}

.auth-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.auth-input-wrap .auth-input {
  padding-right: 48px;
}

.auth-toggle-pass {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--md-muted);
  cursor: pointer;
}

.auth-toggle-pass:hover,
.auth-toggle-pass:focus-visible {
  color: var(--md-primary);
  background: rgba(57, 58, 143, 0.06);
}

.auth-field-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--md-muted);
}

.auth-field-error {
  margin: 0;
  font-size: 0.74rem;
  color: var(--md-rose);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-btn--primary {
  background: var(--md-primary);
  color: var(--md-white);
  box-shadow: 0 12px 28px rgba(57, 58, 143, 0.22);
}

.auth-btn--ghost {
  background: var(--md-white);
  color: var(--md-primary);
  border-color: var(--md-line);
}

.auth-btn--block {
  width: 100%;
}

.auth-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  margin-top: 20px;
}

.auth-alt {
  margin-top: 22px;
  width: 100%;
  min-width: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--md-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--md-line);
}

.auth-google {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid rgba(57, 58, 143, 0.14);
  border-radius: 14px;
  background: var(--md-white);
  overflow: hidden;
}

.auth-google-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 0 16px;
  color: var(--md-ink);
  font-size: 0.92rem;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.auth-google-logo {
  flex-shrink: 0;
}

.auth-google-gsi {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  overflow: hidden;
  border-radius: 14px;
}

.auth-google-gsi > div,
.auth-google-gsi iframe {
  max-width: none !important;
}

.auth-links {
  margin-top: 20px;
}

.auth-link-row {
  margin: 0;
  text-align: center;
  color: var(--md-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-link-row + .auth-link-row {
  margin-top: 8px;
}

.auth-link-row--legal {
  font-size: 0.76rem;
}

.auth-link-row a {
  color: var(--md-primary);
  font-weight: 800;
  text-decoration: none;
}

.auth-link-row a.auth-btn--primary {
  color: var(--md-white);
}

.auth-link-row a.auth-btn--ghost {
  color: var(--md-primary);
}

.auth-link-row--legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.auth-step {
  position: relative;
  text-align: center;
  color: var(--md-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.auth-step__dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 2px solid rgba(57, 58, 143, 0.16);
  background: var(--md-white);
  color: var(--md-muted);
  font-weight: 800;
  font-size: 0.78rem;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.auth-step.is-active .auth-step__dot,
.auth-step.is-done .auth-step__dot {
  border-color: var(--md-primary);
  background: var(--md-primary);
  color: var(--md-white);
}

.auth-step.is-active {
  color: var(--md-primary);
}

.auth-step.is-done {
  color: var(--md-ink);
}

.auth-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-type-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 88px;
  min-width: 0;
  padding: 16px;
  border: 2px solid var(--md-line);
  border-radius: var(--md-radius-md);
  background: var(--md-white);
  color: var(--md-ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.auth-type-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--md-accent);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-type-btn .auth-type-icon--gestante {
  width: 26px;
  height: 26px;
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}

.auth-type-btn strong {
  font-size: 0.98rem;
  font-weight: 800;
}

.auth-type-btn small {
  color: var(--md-muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-type-btn.is-selected {
  border-color: var(--md-primary);
  background: linear-gradient(145deg, rgba(57, 58, 143, 0.06), rgba(217, 144, 168, 0.08));
  color: var(--md-primary);
  box-shadow: 0 10px 24px rgba(57, 58, 143, 0.1);
}

.auth-type-btn.is-selected svg {
  color: var(--md-primary);
}

.auth-token-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.auth-token-input {
  width: 42px;
  height: 50px;
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid rgba(57, 58, 143, 0.14);
  border-radius: 12px;
  background: var(--md-surface);
  color: var(--md-primary);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-token-input:focus {
  outline: 2px solid var(--md-accent);
  outline-offset: 2px;
  background: var(--md-white);
}

.auth-plans {
  display: grid;
  gap: 12px;
}

.auth-plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 16px;
  border: 1px solid var(--md-line);
  border-radius: var(--md-radius-md);
  background: var(--md-white);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.auth-plan.is-featured {
  position: relative;
  margin-top: 14px;
  border: 2px solid var(--md-primary);
  box-shadow: 0 16px 40px rgba(57, 58, 143, 0.14);
}

.auth-plan__selo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 16px;
  border-radius: var(--md-radius-pill);
  background: var(--md-primary);
  color: var(--md-white);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(57, 58, 143, 0.28);
}

.auth-plan__desc {
  margin: 0 0 12px;
  color: var(--md-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-plan__breve {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: var(--md-radius-pill);
  background: #ECEAF8;
  color: var(--md-primary);
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: 1px;
}

.auth-plan h3 {
  margin: 0 0 6px;
  font-family: var(--md-font-display);
  font-size: 1.05rem;
}

.auth-plan .price {
  margin: 0 0 14px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--md-primary);
}

.auth-plan ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--md-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-plan li::before {
  content: "✓ ";
  color: var(--md-primary);
  font-weight: 900;
}

.auth-plan .auth-btn {
  width: 100%;
  margin-top: auto;
}

.auth-foot {
  padding: 8px 16px 24px;
  text-align: center;
  color: var(--md-muted);
  font-size: 0.78rem;
}

.auth-foot a {
  color: var(--md-primary);
  font-weight: 700;
}

.auth-foot-legal {
  margin: 6px 0 0;
}

.auth-step-panel[hidden] {
  display: none !important;
}

.auth-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.auth-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .auth-google:hover {
    border-color: rgba(57, 58, 143, 0.28);
  }

  .auth-btn:hover:not(:disabled) {
    transform: translateY(-2px);
  }

  .auth-btn--primary:hover:not(:disabled) {
    background: var(--md-primary-hover);
  }

  .auth-type-btn:hover:not(.is-selected) {
    transform: translateY(-2px);
    border-color: rgba(57, 58, 143, 0.28);
  }

  .auth-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 46px rgba(32, 33, 61, 0.1);
  }

  .auth-link-row a:not(.auth-btn):hover {
    text-decoration: underline;
  }
}
}

@media (min-width: 720px) {
  .auth-top {
    padding: 24px 24px 0;
  }

  .auth-main {
    align-items: center;
    padding: 28px 24px 40px;
  }

  .auth-card {
    padding: 32px 28px 28px;
  }

  .auth-card--wide {
    max-width: 640px;
  }

  .auth-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-field--full {
    grid-column: 1 / -1;
  }

  .auth-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-actions {
    flex-direction: row;
    justify-content: space-between;
  }

  .auth-actions .auth-btn {
    width: auto;
    min-width: 148px;
  }

  .auth-plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auth-step {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-type-btn,
  .auth-plan,
  .auth-btn,
  .auth-reveal {
    transition: none !important;
    transform: none !important;
  }
}

/* ============================================================
   Checklist de senha em tempo real
   Regras vêm do servidor (includes/auth/PasswordPolicy.php);
   o JS só desenha — ver assets/js/auth/password-strength.js
   ============================================================ */

.auth-senha-regras {
  margin: 10px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--md-line);
  border-radius: var(--md-radius-sm);
  background: var(--md-surface);
}

.auth-senha-regras[hidden] { display: none; }

.auth-senha-regras__titulo {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--md-ink);
}

.auth-senha-regras__lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.auth-senha-regra {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--md-muted);
  transition: color 140ms ease;
}

/* A marca é o único sinal que muda de forma, não só de cor — daltonismo. */
.auth-senha-regra__marca {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--md-line);
  position: relative;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.auth-senha-regra.is-ok {
  color: var(--md-success);
}
.auth-senha-regra.is-ok .auth-senha-regra__marca {
  background: var(--md-success);
  border-color: var(--md-success);
}
.auth-senha-regra.is-ok .auth-senha-regra__marca::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: var(--auth-check-svg) center / 10px no-repeat;
  mask: var(--auth-check-svg) center / 10px no-repeat;
  color: var(--md-white);
}

.auth-senha-regra.is-falta {
  color: var(--md-rose);
}
.auth-senha-regra.is-falta .auth-senha-regra__marca {
  border-color: var(--md-rose);
}
.auth-senha-regra.is-falta .auth-senha-regra__marca::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--md-rose);
  -webkit-mask: var(--auth-x-svg) center / 9px no-repeat;
  mask: var(--auth-x-svg) center / 9px no-repeat;
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --auth-check-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --auth-x-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .auth-senha-regra,
  .auth-senha-regra__marca { transition: none; }
}

/* Aceite dos Termos no cadastro (Regra 30) */
.auth-termos { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--auth-surface-soft, #f6f5fa); border: 1px solid var(--auth-border, #e4e2ee); }
.auth-termos__rotulo { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.auth-termos__rotulo input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; accent-color: #393a8f; }
.auth-termos__rotulo em { color: #9c5872; font-style: normal; }
.auth-termos.is-erro { border-color: #b4234a; background: #fdf0f3; }
.auth-termos__aviso { margin: 8px 0 0; color: #b4234a; }
.auth-google-guard { position: relative; }
.auth-google-guard__capa { position: absolute; inset: 0; z-index: 2; width: 100%; border: 0; background: transparent; cursor: not-allowed; }
.auth-google-guard.is-liberado .auth-google-guard__capa { display: none; }

/* Black November: «de» riscado em vermelho, valor novo e selo pequeno (planos.php). */
.auth-plan .price--promo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.auth-plan .price--promo .price__de { flex: 0 0 100%; color: var(--md-muted); font-size: 1rem; font-weight: 700; text-decoration: line-through; text-decoration-color: #D92D20; text-decoration-thickness: 2px; }
.auth-plan .price--promo .price__selo { flex: 0 0 auto; margin: 6px 100% 0 0; padding: 3px 9px; border-radius: 99px; background: var(--md-ink); color: #fff; font-size: 0.66rem; font-style: normal; font-weight: 800; letter-spacing: 0.03em; }
/* Black November: frase da campanha acima dos cards (planos.php). */
.auth-promo-nota { max-width: 760px; margin: 0 auto 22px; text-align: center; font-size: 0.85rem; padding: 12px 16px; border: 1px solid #D9D2EC; border-radius: 14px; background: #F4F2FB; color: var(--md-ink); font-weight: 600; line-height: 1.5; }