/* ═══════════════════════════════════════════════════════════
   MOMMENTOS — AUTENTICAÇÃO (_LayoutVazio + Views/Account)
   Ecrã dividido: painel da marca com aurora generativa + cartão de formulário.
   ═══════════════════════════════════════════════════════════ */

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

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

@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  }
}

/* ── Painel da marca ─────────────────────────────────────── */
.auth-brand {
  position: relative;
  min-height: 236px;
  color: #fff;
}

.auth-brand .cover-mesh {
  animation: auth-drift 22s var(--ease) infinite alternate;
}

@keyframes auth-drift {
  0% { transform: rotate(var(--rot)) scale(1); }
  50% { transform: rotate(calc(var(--rot) + 10deg)) scale(1.12) translate(2%, -2%); }
  100% { transform: rotate(calc(var(--rot) - 6deg)) scale(1.05) translate(-2%, 3%); }
}

.auth-brand .cover-glyph {
  font-size: clamp(220px, 60cqi, 560px);
  right: -0.12em;
  bottom: -0.3em;
  color: rgba(255, 255, 255, 0.09);
}

.auth-brand::before {
  /* véu inferior para legibilidade do texto */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 5, 18, 0.1) 0%, rgba(8, 5, 18, 0.05) 45%, rgba(8, 5, 18, 0.55) 100%);
  pointer-events: none;
}

.auth-brand-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 28px;
  height: 100%;
  padding: 88px 20px 64px;
}

.auth-logo {
  display: none;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
}

.auth-logo .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-logo em,
.auth-top-logo em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.auth-brand-copy {
  max-width: 520px;
}

.auth-brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.auth-brand-eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
}

.auth-brand-title {
  color: #fff;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.auth-brand-title em {
  color: #f4d88f;
}

.auth-brand-text,
.auth-benefits,
.auth-quote {
  display: none;
}

/* ── Coluna do formulário ────────────────────────────────── */
.auth-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.auth-main::before {
  content: none;
  position: absolute;
  inset: 0 0 auto;
  height: 420px;
  pointer-events: none;
  background:
    radial-gradient(40% 60% at 85% 0%, var(--aurora-1), transparent 70%),
    radial-gradient(35% 50% at 15% 10%, var(--aurora-2), transparent 72%);
  opacity: 0.55;
}

.auth-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
  /* no telemóvel fica sobre a aurora do painel (posicionado em .auth-shell) */
}

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--t), transform var(--t-fast), color var(--t), border-color var(--t);
}

.auth-back .ico {
  width: 17px;
  height: 17px;
  transition: transform var(--t);
}

.auth-back:hover .ico {
  transform: translateX(-3px);
}

.auth-back span {
  display: none;
}

.auth-top-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
}

.auth-top .theme-toggle {
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-center {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px 24px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-top: -40px;
  padding: 30px 22px 28px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  align-self: flex-start;
}

.auth-legal {
  position: relative;
  padding: 8px 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

.auth-legal a:hover {
  color: var(--purple);
}

@media (min-width: 560px) {
  .auth-card {
    padding: 40px 40px 34px;
  }

  .auth-back span {
    display: inline;
  }
}

/* ── Desktop: painel fixo à esquerda ─────────────────────── */
@media (min-width: 960px) {
  .auth-brand {
    position: sticky;
    top: 0;
    height: 100dvh;
    min-height: 620px;
  }

  .auth-brand-inner {
    justify-content: space-between;
    padding: clamp(32px, 4vw, 56px);
  }

  .auth-logo {
    display: inline-flex;
  }

  .auth-brand-text {
    display: block;
    margin-top: 18px;
    max-width: 44ch;
    font-size: var(--fs-md);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.8);
  }

  .auth-benefits {
    display: grid;
    gap: 16px;
    margin-top: 34px;
    list-style: none;
  }

  .auth-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .auth-benefits .auth-benefit-ico {
    display: grid; /* vence ".auth-benefits span { display: block }" */
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .auth-benefit-ico .ico {
    width: 18px;
    height: 18px;
  }

  .auth-benefits strong {
    display: block;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    color: #fff;
  }

  .auth-benefits span {
    display: block;
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.68);
  }

  .auth-quote {
    display: block;
    max-width: 460px;
    padding: 20px 22px;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .auth-quote blockquote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.35;
    color: #fff;
  }

  .auth-quote figcaption {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.72);
  }

  .auth-quote-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: #1d0f33;
    background: #f4d88f;
  }

  .auth-main {
    position: relative;
  }

  .auth-main::before {
    content: '';
  }

  .auth-top {
    position: relative;
    padding: 24px clamp(24px, 4vw, 48px) 0;
  }

  .auth-top-logo {
    display: none;
  }

  .auth-back {
    color: var(--ink-2);
    background: transparent;
    border-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-left: 6px;
  }

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

  .auth-top .theme-toggle {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .auth-center {
    align-items: center;
    padding: 24px clamp(24px, 4vw, 48px);
  }

  .auth-card {
    margin-top: 0;
    align-self: center;
  }
}

/* ── Cabeçalho do formulário ─────────────────────────────── */
.auth-head {
  margin-bottom: 26px;
}

.auth-head h1 {
  margin-top: 12px;
  font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.5rem);
  letter-spacing: -0.045em;
}

.auth-head h1 em {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 0.08em 0.08em 0;
  margin: 0 -0.04em -0.08em 0;
}

.auth-head p {
  margin-top: 10px;
  font-size: var(--fs-base);
  color: var(--ink-3);
}

.auth-tel {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.auth-ico {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
}

.auth-ico .ico {
  width: 24px;
  height: 24px;
}

/* ── Google + divisor ────────────────────────────────────── */
.auth-google {
  --btn-h: 52px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-base);
}

.auth-google:hover {
  border-color: var(--purple-line);
  box-shadow: var(--shadow);
}

.auth-google svg {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-3);
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

/* ── Formulário ──────────────────────────────────────────── */
.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form .validation-summary-errors {
  margin-bottom: 0;
}

.auth-card > .alert {
  margin-bottom: 22px;
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-forgot {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--purple);
  padding: 6px 0;
}

.auth-forgot:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-row {
  display: grid;
  gap: 18px;
}

.auth-remember {
  min-height: 44px;
}

.auth-form .btn-primary {
  margin-top: 4px;
}

.auth-form .btn .ico {
  width: 17px;
  height: 17px;
}

.auth-form .btn-primary .ico:last-child {
  transition: transform var(--t);
}

.auth-form .btn-primary:hover .ico:last-child {
  transform: translateX(3px);
}

.btn.is-loading {
  opacity: 0.75;
  cursor: progress;
}

/* Senha com botão mostrar/ocultar */
.pw {
  position: relative;
}

.pw .input {
  padding-right: 54px;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  border-radius: 10px;
  color: var(--ink-3);
  transition: color var(--t-fast), background var(--t-fast);
}

.pw-toggle:hover {
  color: var(--purple);
  background: var(--purple-soft);
}

.pw-toggle .ico {
  width: 19px;
  height: 19px;
}

/* Força da senha */
.pw-meter {
  display: block;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.pw-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--danger);
  transition: width var(--t), background var(--t);
}

.pw-meter[data-level='1'] span { width: 25%; background: var(--danger); }
.pw-meter[data-level='2'] span { width: 50%; background: var(--warning); }
.pw-meter[data-level='3'] span { width: 75%; background: var(--gold); }
.pw-meter[data-level='4'] span { width: 100%; background: var(--success); }

/* Identificador (email ou telefone) */
.auth-id,
.auth-phone {
  position: relative;
}

.auth-id-prefix,
.auth-phone-prefix {
  position: absolute;
  top: 50%;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-2);
  pointer-events: none;
}

.auth-id-prefix {
  opacity: 0;
  transform: translate(-6px, -50%);
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.auth-id .input {
  transition: padding var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.auth-id.is-phone .auth-id-prefix {
  opacity: 1;
  transform: translate(0, -50%);
}

.auth-id.is-phone .input {
  padding-left: 62px;
}

.auth-phone .input {
  padding-left: 92px;
}

.auth-phone-prefix::after {
  content: '';
  width: 1px;
  height: 22px;
  margin-left: 4px;
  background: var(--line-strong);
}

.auth-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #cc092f 0 50%, #111 50% 100%);
  position: relative;
  box-shadow: 0 0 0 1px var(--line);
}

.auth-flag::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #ffcb00;
}

/* Código SMS */
.auth-code {
  height: 64px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px !important;
  font-weight: 600;
  letter-spacing: 0.5em;
  padding-left: calc(16px + 0.5em);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.auth-code::placeholder {
  color: var(--line-strong);
  letter-spacing: 0.5em;
}

/* Reenviar código */
.auth-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 18px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.auth-resend-btn {
  min-height: 44px;
  padding: 0 6px;
  font-weight: 600;
  color: var(--purple);
}

.auth-resend-btn:hover:not(:disabled) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-resend-btn:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  font-variant-numeric: tabular-nums;
}

/* Passos (recuperação) */
.auth-steps {
  display: grid;
  gap: 10px;
  margin-top: 26px;
  padding: 18px;
  list-style: none;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.auth-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-steps li span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-soft);
}

/* Rodapé do cartão */
.auth-switch {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.auth-switch a,
.auth-fine a {
  font-weight: 600;
  color: var(--purple);
}

.auth-switch a:hover,
.auth-fine a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-fine {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand .cover-mesh {
    animation: none;
  }
}

@media (max-width: 559px) {
  .auth-brand-eyebrow {
    display: none;
  }
}

/* ── Recuperar senha: escolha do método ──────────────────── */
.auth-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-method { position: relative; cursor: pointer; }
.auth-method input { position: absolute; opacity: 0; pointer-events: none; }
.auth-method > span { display: grid; justify-items: start; gap: 2px; height: 100%; padding: 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.auth-method .ico { width: 22px; height: 22px; margin-bottom: 8px; color: var(--ink-3); transition: color var(--t-fast); }
.auth-method strong { font-size: var(--fs-sm); color: var(--ink); }
.auth-method small { font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-3); }
.auth-method:hover > span { border-color: var(--purple-line); }
.auth-method input:checked + span { border-color: var(--purple); background: var(--purple-soft); }
.auth-method input:checked + span .ico { color: var(--purple); }
.auth-method input:focus-visible + span { box-shadow: var(--ring); }

.auth-method-panel, .auth-submit-email, .auth-submit-sms { display: none; }
.auth-recover:has(input[value='email']:checked) .auth-method-panel--email,
.auth-recover:has(input[value='sms']:checked) .auth-method-panel--sms { display: grid; gap: 10px; }
.auth-recover:has(input[value='email']:checked) .auth-submit-email,
.auth-recover:has(input[value='sms']:checked) .auth-submit-sms { display: inline-flex; }

@media (max-width: 420px) { .auth-methods { grid-template-columns: minmax(0, 1fr); } }

/* ── Aceitação dos Termos ────────────────────────────────── */
.auth-terms { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.auth-terms:hover { border-color: var(--purple-line); }
.auth-terms:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.auth-terms:has(input:focus-visible) { box-shadow: var(--ring); }
.auth-terms input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--purple); cursor: pointer; }
.auth-terms a { color: var(--purple); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.auth-fine--google { margin-top: 10px; text-align: center; }
.auth-ext-card { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.auth-ext-text { display: grid; min-width: 0; line-height: 1.3; }
.auth-ext-text strong { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-ext-text small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
