/* ═══════════════════════════════════════════════════════════
   Cardas Capital · Candidatura à Mentoria
   Consultório, não palco.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink: #0E1A24;
  --ink-2: #16242F;
  --paper: #F5F2EC;
  --muted: #8A98A3;
  --accent: #C8A24B;
  --line: #25333E;
  --error: #D96C5F;
  --success: #5FA98A;

  --font-display: 'Caladea', Georgia, serif;
  --font-body: 'Poppins', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
}

.container {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Foco por teclado: obrigatório, não negociável */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Tipografia utilitária ─────────────────────────────── */

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 16px;
}

.microcopy {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ── Estado A: Pré-frame ───────────────────────────────── */

#state-preframe { padding: 32px 0 64px; }

.brand {
  padding: 8px 0 48px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.selo {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero-sub {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 40px;
}

.cta-block { margin-bottom: 48px; }

.authority { margin-top: 16px; }

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 24px;
}

.authority-line {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}

/* ── Botões ────────────────────────────────────────────── */

.btn {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--ink);
  padding: 16px 32px;
  min-height: 56px;
}

.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary[disabled] { cursor: wait; }

.btn-primary.is-loading .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-shake { animation: shake 200ms ease; }

.btn-back {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 8px 8px 0;
}

.btn-back:hover { color: var(--paper); }

/* ── Estado B: Formulário ──────────────────────────────── */

#state-form {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
  z-index: 10;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 15%;
  transition: width 400ms ease-in-out;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  min-height: 64px;
}

.step-counter {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: auto;
}

.screens {
  flex: 1;
  position: relative;
  overflow-x: hidden;
  padding-top: 24px;
  padding-bottom: 160px; /* espaço para o footer fixo no mobile */
}

.screen { width: 100%; }

.screen-question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 8px;
}

.screen-context {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}

/* Transições entre ecrãs */
.slide-in-right { animation: slideInRight 250ms ease-out; }
.slide-in-left { animation: slideInLeft 250ms ease-out; }

@keyframes slideInRight {
  from { transform: translateX(48px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-48px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-out-left { animation: slideOutLeft 250ms ease-out forwards; }
.slide-out-right { animation: slideOutRight 250ms ease-out forwards; }

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-48px); opacity: 0; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(48px); opacity: 0; }
}

/* ── Inputs de texto ───────────────────────────────────── */

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 16px; /* nunca abaixo de 16px: evita zoom do iOS */
  color: var(--paper);
  transition: border-color 150ms ease;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.7; }

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field textarea {
  resize: none;
  min-height: calc(3 * 1.6em + 32px);
  max-height: calc(6 * 1.6em + 32px);
  overflow-y: auto;
}

.field.has-error input,
.field.has-error textarea { border-color: var(--error); }

.field-error {
  font-size: 13px;
  color: var(--error);
  margin: 8px 0 0;
  min-height: 1.2em;
}

.email-suggestion {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
}

/* ── Cards de opção ────────────────────────────────────── */

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.option-card:hover { border-color: var(--muted); }

.option-card[aria-pressed="true"] {
  border-color: var(--accent);
}

.option-card .check {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 150ms ease;
}

.option-card[aria-pressed="true"] .check { opacity: 1; }

/* ── Footer do formulário (thumb zone) ─────────────────── */

.form-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 640px;
  margin-inline: auto;
  background: linear-gradient(to top, var(--ink) 70%, transparent);
  padding-top: 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 5;
}

.form-footer .field-error { margin-bottom: 8px; text-align: center; }
.form-footer .microcopy { text-align: center; }

@media (min-width: 641px) {
  .form-footer {
    position: static;
    background: none;
    padding-top: 8px;
  }
  .screens { padding-bottom: 32px; }
}

/* ── Estado C: Pós-submissão ───────────────────────────── */

#state-success { padding: 64px 0; }

.success-check {
  color: var(--accent);
  margin-bottom: 24px;
  animation: scaleIn 400ms ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 16px;
}

.success-sub {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 32px;
}

.next-steps ol {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.resource-card {
  display: block;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--paper);
  transition: border-color 150ms ease;
}

.resource-card:hover { border-color: var(--accent); }

.resource-title {
  display: block;
  font-weight: 500;
}

.resource-desc {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

/* ── Rodapé ────────────────────────────────────────────── */

.site-footer {
  padding-top: 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-footer a:hover { color: var(--paper); text-decoration: underline; }

body.form-active .site-footer { display: none; }

/* ── Desktop ───────────────────────────────────────────── */

@media (min-width: 641px) {
  body { font-size: 17px; }
  .hero-headline { font-size: 48px; }
  .screen-question { font-size: 32px; }
  .success-headline { font-size: 40px; }
  .microcopy, .screen-context { font-size: 14px; }
  #state-preframe { padding-top: 48px; }
}

/* ── Movimento reduzido: corte seco, sem animação ──────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
