/* Factura AI auth — extracted 1:1 from prototype-auth.html */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Re-skinned to match the app theme (home.css — slate-blue dark palette). */
  --bg-primary: #0d0d16;
  --bg-secondary: #1a1a26;
  --bg-card: #1e1e2c;
  --bg-input: #28283a;
  --bg-input-focus: #313148;
  --border: #3a3a46;
  --border-focus: #6f93b8;
  --text-primary: #ffffff;
  --text-secondary: #c0c0d0;
  --text-muted: #8888a0;
  --accent: #6f93b8;
  --accent-hover: #5e7fa2;
  --accent-subtle: rgba(111, 147, 184, 0.16);
  --success: #34d399;
  --success-subtle: rgba(52, 211, 153, 0.15);
  --error: #e5484d;
  --error-subtle: rgba(229, 72, 77, 0.15);
  --warning: #f5a623;
  --warning-subtle: rgba(245, 166, 35, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 150ms ease;
  /* --font vem do fonts.css (carregado antes) — uma pilha de letras para toda a app. */
}
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  /* coluna: os dois painéis em cima, o rodapé a toda a largura por baixo */
  display: flex; flex-direction: column;
}
.auth-container { display: flex; flex: 1 0 auto; }
/* No desktop TUDO cabe num ecrã, sem scroll: a página mede o ecrã, o rodapé fica
   preso em baixo e os painéis ficam com o resto. O painel da marca é um
   contentor de tamanho (100cqh = a altura que lhe coube) para a coluna se
   dimensionar pela altura; a coluna do formulário rola por dentro se um ecrã
   for baixo de mais, em vez de rolar a página. */
@media (min-width: 901px) {
  body { height: 100dvh; min-height: 0; }
  .auth-container { flex: 1 1 auto; min-height: 0; }
  .auth-branding { min-height: 0; container-type: size; }
  .auth-form-side { min-height: 0; overflow-y: auto; }
}
.auth-branding {
  flex: 1;
  background:
    radial-gradient(120% 75% at 15% 10%, rgba(111, 147, 184, 0.13) 0%, transparent 55%),
    radial-gradient(80% 60% at 95% 100%, rgba(77, 148, 132, 0.08) 0%, transparent 60%),
    linear-gradient(158deg, #1c1c29 0%, #15151f 52%, #0c0c13 100%);
  /* centrado na vertical como a coluna do formulário */
  display: flex; flex-direction: column; justify-content: center;
  padding: 28px 28px; position: relative; overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.auth-branding::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 147, 184, 0.28), transparent);
  pointer-events: none;
}
/* Centered on the panel's axis (the divider line is the right edge) and fluid:
   640px até ~1390px de viewport — igual ao layout antigo — depois cresce com o
   ecrã até 900px. ≤900px o painel está escondido, por isso mobile não muda. */
/* O bloco ESTICA à largura do painel (margens estreitas) em vez de encolher para
   caber na altura: a manchete e a frase seguem a largura; a imagem leva a altura
   que sobrar e, quando não cabe inteira, corta-se em baixo — é uma janela de
   browser, lê-se como tal. max-height = a altura útil do painel (100cqh). */
.brand-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1100px; margin-inline: auto;
  display: flex; flex-direction: column; max-height: 100cqh;
}
.brand-inner > * { flex: none; }
/* wordmark lockup — circled emblem + centre line + wordmark, line continues
   past it and fades out (Option B). Emblem, line and text share one centre axis. */
.brand-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
/* clamps calibrados: valor actual a ~1390px de viewport, ~1.3× a ~1930px */
.bl-emblem {
  width: clamp(48px, 2.4vw + 14.6px, 62px); height: clamp(48px, 2.4vw + 14.6px, 62px);
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  outline: 1px solid rgba(255, 255, 255, 0.06);
}
.bl-emblem img { width: clamp(32px, 1.6vw + 9.8px, 42px); height: clamp(32px, 1.6vw + 9.8px, 42px); object-fit: contain; display: block; }
.bl-word { font-size: clamp(24px, 1.15vw + 7px, 32px); font-weight: 800; line-height: 1; color: var(--text-primary); white-space: nowrap; flex-shrink: 0; }
.bl-word .ai { color: var(--accent); }
.bl-line { height: 3px; border-radius: 999px; flex-shrink: 0; }
.bl-pre { width: 60px; background: linear-gradient(90deg, var(--accent), #5e8fa0); }
.bl-post { flex: 1 1 0; min-width: 28px; background: linear-gradient(90deg, #5e8fa0, #4d9484 32%, rgba(77, 148, 132, 0) 100%); }

/* hero headline — UM parágrafo, justificado a sério: as duas linhas encostam aos
   dois lados da coluna, alinhadas com a moldura por baixo. O `text-align:justify`
   não estica a última linha, por isso cada linha mede a largura da coluna
   (100cqi) a dividir pela sua razão --r (largura do texto ÷ tamanho da letra) —
   a técnica da manchete da Início. O espaçamento vai na LINHA e é o --tr-tight:
   o .06em das etiquetas foi desenhado para 11px. */
.brand-headline {
  margin: 0 0 16px; font-weight: 700; line-height: 1.12;
  text-transform: uppercase; color: var(--text-primary);
  container-type: inline-size;
}
.brand-headline .ht-line {
  display: block; white-space: nowrap; letter-spacing: var(--tr-tight);
  font-size: calc(100cqi / var(--r));
}

/* product showcase — framed app screenshot (the hero visual) */
.brand-shot { margin: 0; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.brand-shot-frame {
  flex: 0 1 auto; min-height: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #15151f;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.brand-shot-bar { flex: none;
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px;
  background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand-shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.brand-shot-bar i:first-child { background: rgba(229, 72, 77, 0.55); }
.brand-shot-bar i:nth-child(2) { background: rgba(245, 166, 35, 0.55); }
.brand-shot-bar i:nth-child(3) { background: rgba(52, 211, 153, 0.50); }
/* A imagem é uma galeria de folhas brancas num fundo escuro — sem isto puxava
   o olhar todo. Baixa-se a luz e passa-se um véu escuro por cima da moldura. */
.brand-shot-img { display: block; width: 100%; height: auto; filter: brightness(0.72) saturate(0.9); }
.brand-shot-frame { position: relative; }
.brand-shot-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13, 13, 22, 0.10) 0%, rgba(13, 13, 22, 0.34) 100%);
}

/* a frase que corre — logo a seguir à manchete. Anda da direita para a esquerda
   sem costura: a faixa leva a frase duas vezes (a 2.ª é aria-hidden) e desloca-se
   exactamente metade. As pontas desvanecem para a frase entrar e sair, não bater. */
.brand-sub {
  margin: 0 0 24px; overflow: hidden; white-space: nowrap;
  font-size: clamp(16px, 0.75vw + 4.6px, 20px); font-weight: 600; line-height: var(--lh-base);
  color: rgba(255, 255, 255, 0.62);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.brand-sub strong { font-weight: 700; color: var(--text-primary); }
.bs-track { display: inline-flex; animation: brand-sub-scroll 28s linear infinite; will-change: transform; }
.bs-item { flex: none; padding-right: 72px; }
.brand-sub:hover .bs-track { animation-play-state: paused; }
@keyframes brand-sub-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .brand-sub { white-space: normal; -webkit-mask-image: none; mask-image: none; }
  .bs-track { display: block; animation: none; }
  .bs-item { padding-right: 0; }
  .bs-item[aria-hidden="true"] { display: none; }
}

.auth-form-side { flex: 1; display: flex; flex-direction: column; padding: 24px 40px; max-width: 560px; }
/* margin:auto centra nos dois eixos e, ao contrário do align-items:center,
   não corta o topo quando o formulário é mais alto do que a coluna. */
.auth-form-wrapper { width: 100%; max-width: 440px; margin: auto; }

/* Iniciar Sessão | Criar Conta — a navegação entre as duas páginas */
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px 0; text-align: center; font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none; border-bottom: 2px solid transparent;
  transition: var(--transition); background: none; font-family: var(--font); text-decoration: none;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* dois campos curtos na mesma fila (E-mail · Telefone no registo) */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-2 .form-group { min-width: 0; }

.form-header { margin-bottom: 18px; }
.form-header h1 { font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing:var(--tr-tight); margin-bottom: 6px; }
.form-header p { font-size: 14px; color: var(--text-secondary); }

.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input-wrapper { position: relative; }
.form-input {
  width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 14px; font-family: var(--font);
  transition: var(--transition); outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--border-focus); background: var(--bg-input-focus); box-shadow: 0 0 0 3px var(--accent-subtle); }
/* Campos bloqueados (dados verificados pela AGT): visivelmente não editáveis,
   sem tocar na cor da borda para os estados .success/.error continuarem a ler. */
.form-input[readonly] { background: var(--bg-secondary); color: var(--text-secondary); cursor: not-allowed; }
.form-input[readonly]:focus { background: var(--bg-secondary); box-shadow: none; border-color: var(--border); }
.form-input.error { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-subtle); }
.form-input.success { border-color: var(--success); }
/* Província/Município escritos à mão — aparece por baixo do select em «Outra…». */
.pm-outra { margin-top: 8px; }
.pm-outra[hidden] { display: none; }

.form-error { font-size: 12px; color: var(--error); margin-top: 4px; display: none; }
.form-error.visible { display: block; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-notice-banner {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 18px;
}
.form-error-banner {
  background: var(--error-subtle); border: 1px solid rgba(229, 72, 77, 0.4); border-left: 3px solid var(--error);
  color: var(--error); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 18px;
}
/* Mensagens do servidor (django.contrib.messages) — por cima da página, sem a
   empurrar: as páginas de entrada cabem num só ecrã. Fecham-se num clique. */
.auth-mensagens {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(520px, calc(100vw - 32px)); cursor: pointer;
}
.auth-mensagens > div { margin-bottom: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.auth-mensagens > .form-error-banner {
  background: linear-gradient(var(--error-subtle), var(--error-subtle)), var(--bg-primary);
}

.phone-input-group { display: flex; gap: 8px; }
.phone-prefix { width: 64px; flex-shrink: 0; padding-inline: 10px; text-align: center; }
.phone-input-group .form-input:not(.phone-prefix) { min-width: 0; }

.password-strength { display: flex; gap: 4px; margin-top: 8px; }
.strength-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: var(--transition); }
.strength-bar.active-weak { background: var(--error); }
.strength-bar.active-fair { background: var(--warning); }
.strength-bar.active-good { background: var(--accent); }
.strength-bar.active-strong { background: var(--success); }
.strength-text { font-size: 11px; margin-top: 4px; color: var(--text-muted); }

.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-family: var(--font);
}
.password-toggle:hover { color: var(--text-secondary); }

.nif-status { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 500; display: none; }
.nif-status.found { color: var(--success); display: block; }
.nif-status.not-found { color: var(--warning); display: block; }
.nif-empresa-name { font-size: 12px; color: var(--success); margin-top: 4px; padding: 6px 10px; background: var(--success-subtle); border-radius: var(--radius); display: none; }
.nif-empresa-name.visible { display: block; }
.nif-not-found-warning {
  margin-top: 8px; padding: 12px 14px; background: var(--warning-subtle);
  border: 1px solid rgba(245, 166, 35, 0.3); border-radius: var(--radius); font-size: 13px; color: var(--warning);
}
.nif-not-found-warning p { margin-bottom: 4px; }
.btn-warning-yes { padding: 6px 14px; background: var(--warning); color: #000; border: none; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.btn-warning-no { padding: 6px 14px; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; cursor: pointer; font-family: var(--font); }
.btn-warning-yes:hover { opacity: 0.9; }
.btn-warning-no:hover { border-color: var(--text-muted); }

.agt-result-card { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); }
.agt-result-header { background: var(--accent); color: white; padding: 8px 14px; font-size: 12px; font-weight: 600; }
.agt-result-body { padding: 12px 14px; }
.agt-row { display: flex; padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.agt-row:last-child { border-bottom: none; }
.agt-label { width: 120px; flex-shrink: 0; color: var(--text-muted); font-weight: 500; }
.agt-value { color: var(--text-primary); flex: 1; }
.agt-resident { font-style: italic; color: var(--text-secondary); }
.agt-result-footer { padding: 6px 14px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-card); }
.agt-estado-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.agt-estado-badge.activo { background: var(--success-subtle); color: var(--success); }
.agt-estado-badge.inactivo { background: var(--error-subtle); color: var(--error); }

.form-checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.form-checkbox input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-input); cursor: pointer; accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.form-checkbox span { font-size: 13px; color: var(--text-secondary); line-height: var(--lh-base); }
.form-checkbox a { color: var(--accent); text-decoration: none; }

.form-select {
  width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 14px; font-family: var(--font);
  transition: var(--transition); outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8b96' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.form-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-subtle); }

.btn { width: 100%; padding: 11px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; font-family: var(--font); cursor: pointer; transition: var(--transition); border: none; outline: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-input); border-color: var(--text-muted); }
.auth-link { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 14px; }
.auth-link a { color: var(--accent); text-decoration: none; font-weight: 500; }

.forgot-link { display: block; text-align: right; font-size: 13px; color: var(--accent); text-decoration: none; margin-top: -4px; margin-bottom: 14px; }

.otp-container { display: flex; gap: 10px; justify-content: center; margin: 28px 0; }
.otp-input {
  width: 48px; height: 56px; text-align: center; font-size: 20px; font-weight: 600;
  font-family: var(--font); background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); outline: none; transition: var(--transition);
}
.otp-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-subtle); }
.otp-message { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.otp-email { color: var(--text-primary); font-weight: 500; }
.otp-resend { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.otp-resend a { color: var(--accent); text-decoration: none; cursor: pointer; }

.wizard-progress { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.wizard-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.wizard-step.active { color: var(--text-primary); }
.wizard-step.completed { color: var(--success); }
.wizard-step-number { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.wizard-step.active .wizard-step-number { background: var(--accent); border-color: var(--accent); color: white; }
.wizard-step.completed .wizard-step-number { background: var(--success); border-color: var(--success); color: white; }
.wizard-step-line { flex: 1; height: 1px; background: var(--border); margin: 0 12px; }
.wizard-step-line.completed { background: var(--success); }

.file-upload { border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: var(--transition); }
.file-upload:hover { border-color: var(--accent); background: var(--accent-subtle); }
.file-upload-icon { font-size: 24px; margin-bottom: 8px; }
.file-upload-text { font-size: 13px; color: var(--text-secondary); }
.file-upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* RODAPÉ — a toda a largura, por baixo dos dois painéis (auth/_base.html).
   Uma fila: marca · ligações do wanvid.com · botão «Contacto» (abre um menu com
   e-mail, telefone e WhatsApp); por baixo, a linha legal. */
.auth-footer {
  flex: none; background: #0a0a11;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 12px 40px 10px;
}
.af-inner { width: 100%; max-width: 1480px; margin-inline: auto; }
.af-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 32px; flex-wrap: wrap; }
.af-brand { display: flex; align-items: center; gap: 10px; }
.af-emblem {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.af-emblem img { width: 21px; height: 21px; object-fit: contain; display: block; }
.af-lema { font-size: var(--t-small); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.af-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: var(--t-small); }
.af-nav a { color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.af-nav a:hover { color: var(--text-primary); }
.af-legal {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: var(--t-micro); line-height: var(--lh-base); color: var(--text-muted);
}
/* o botão e o seu menu */
.af-contact { position: relative; }
.af-cbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px;
  border-radius: 999px; cursor: pointer; font-family: var(--font); font-size: var(--t-body); font-weight: 600;
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary);
  transition: border-color var(--transition), color var(--transition);
}
.af-cbtn svg { width: 14px; height: 14px; transition: transform var(--transition); }
.af-cbtn:hover, .af-cbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.af-cbtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.af-pop {
  position: absolute; right: 0; bottom: calc(100% + 8px); width: 340px; max-width: calc(100vw - 32px); padding: 8px; z-index: 50;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
}
.af-pop[hidden] { display: none; }
/* cada caminho é um BOTÃO: moldura, fundo, seta — lê-se como clicável */
.af-opt {
  display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border);
  font-family: var(--font); color: inherit; text-align: left; text-decoration: none; white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.af-opt::after {
  content: ''; width: 8px; height: 8px; margin-right: 2px;
  border-right: 2px solid var(--text-muted); border-top: 2px solid var(--text-muted); transform: rotate(45deg);
  transition: border-color var(--transition);
}
.af-opt:hover, .af-opt:focus-visible {
  background: var(--bg-input-focus); border-color: var(--accent); outline: none; transform: translateY(-1px);
}
.af-opt:hover::after, .af-opt:focus-visible::after { border-color: var(--accent); }
.af-opt:active { transform: none; }
.af-opt-k { font-size: var(--t-micro); font-weight: 700; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--accent); }
.af-opt-wa .af-opt-k { color: var(--success); }
.af-opt-v { font-size: var(--t-body); font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* formulário «Contacto» — dentro da WFDialog; os campos são os das páginas */
.contacto-form { margin: 18px 0 2px; }
.contacto-form textarea.form-input { min-height: 120px; resize: vertical; line-height: var(--lh-base); }
.contacto-form .ct-turnstile { margin: 4px 0 6px; min-height: 0; }
.ct-isco { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }
/* Criar Conta, «NIF já registado» → «Este NIF é meu — reclamar» */
.nif-reclamar { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 14px;
  border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent-subtle);
  color: var(--text-primary); font-size: 13px; font-weight: 600; font-family: var(--font); cursor: pointer;
  transition: background var(--transition); }
.nif-reclamar:hover { background: rgba(111, 147, 184, 0.26); }
.nif-reclamar[hidden] { display: none; }
.nif-reclamar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* caixa «Apoio ao Cliente» / «Reclamar um NIF» — o anexo (apoio/_externo.html) */
.apoio-file { position: relative; display: block; padding: 14px; border-radius: var(--radius); border: 1px dashed #4d4d5b;
  color: var(--text-secondary); font-size: 13px; text-align: center; cursor: pointer; }
.apoio-file:hover { border-color: var(--accent); }
.apoio-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.apoio-file .form-hint { display: inline; margin: 0 0 0 4px; }
.apoio-form .form-label .opc { color: var(--text-muted); font-weight: 400; }
/* A WFDialog não rola nem tem tecto de altura; num ecrã baixo (ou no telemóvel,
   com os campos numa coluna) a caixa cortava-se em cima e em baixo. Rola o
   formulário por dentro — o título e os botões ficam sempre à vista. */
.apoio-form { max-height: calc(100dvh - 240px); overflow-y: auto; padding-right: 4px; }
.apoio-form textarea.form-input { min-height: 96px; }

@media (max-width: 900px) {
  .auth-branding { display: none; }
  .auth-form-side { max-width: 100%; padding: 24px; }
  .auth-footer { padding: 20px 24px 16px; }
  .af-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .af-pop { right: auto; left: 0; }
  .af-legal { margin-top: 14px; padding-top: 12px; font-size: var(--t-small); }
}
@media (max-width: 480px) {
  .auth-form-wrapper { max-width: 100%; }
  .form-row-2 { grid-template-columns: 1fr; gap: 0; }
  .otp-input { width: 42px; height: 48px; font-size: 16px; }
  .otp-container { gap: 6px; }
}
