/* ------------------------------------------------------------------
   Interface do Currículo Fácil.
   Regra geral: muito respiro, cartões arredondados, sombra discreta.
------------------------------------------------------------------ */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--r-sm);
}

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.container-narrow { width: min(680px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: var(--sp-4); }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
/* O `display: none` do atributo [hidden] vem da folha do navegador e perde para
   qualquer regra de autor — sem isto, um `.btn` com [hidden] continua aparecendo. */
[hidden] { display: none !important; }
/* Texto só para leitores de tela. Duas armadilhas conhecidas aqui:
   1. `margin: -1px` era muleta da técnica antiga e só sobra 1px de vazamento;
   2. sendo `position: absolute`, o elemento se ancora no primeiro ancestral
      posicionado — se não houver nenhum, ele se ancora na PÁGINA e escapa do
      `overflow` de qualquer container de rolagem no caminho, somando a posição
      dele à largura do documento (era a rolagem lateral do stepper).
   Regra: todo elemento que hospeda um `.sr-only` precisa de `position: relative`. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);   /* reserva para navegadores antigos */
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------- Cabeçalho ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.appbar-inner {
  height: 100%; display: flex; align-items: center; gap: var(--sp-4);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.125rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand span { color: var(--brand); }
.appbar-spacer { flex: 1; }

.avatar {
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 0.875rem;
  border: 1px solid var(--border); cursor: pointer;
}

/* ---------------- Botões ---------------- */
.btn {
  --btn-bg: var(--brand); --btn-fg: var(--on-brand); --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 var(--sp-5);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-pill);
  font: inherit; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer; white-space: nowrap;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:hover { background: var(--brand-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--sp-4); font-size: 0.875rem; }
.btn-lg { min-height: 52px; padding: 0 var(--sp-8); font-size: 1rem; }

.btn-soft { --btn-bg: var(--brand-tint); --btn-fg: var(--brand); }
.btn-soft:hover { background: var(--brand-tint-2); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-muted); --btn-bd: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { --btn-bg: var(--error-tint); --btn-fg: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }

.btn-ai {
  --btn-bg: transparent; --btn-fg: var(--brand); --btn-bd: var(--brand-tint-2);
  min-height: 34px; padding: 0 12px; font-size: 0.8125rem; border-radius: var(--r-pill);
}
.btn-ai:hover { background: var(--brand-tint); color: var(--brand-strong); }
.btn-icon {
  min-height: 40px; width: 40px; padding: 0; border-radius: var(--r-pill);
  --btn-bg: transparent; --btn-fg: var(--text-muted); --btn-bd: var(--border);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: block; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Cartões ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
}
.card-flat { box-shadow: none; }
.card-hover { transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-header h3 { flex: 1; }

.grid { display: grid; gap: var(--sp-4); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------------- Formulários ---------------- */
.field { margin-bottom: var(--sp-4); }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  font-size: 0.875rem; font-weight: 600; margin-bottom: 6px;
}
.field-hint { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-top: 6px; }
.field-error { display: none; font-size: 0.8125rem; color: var(--error); margin-top: 6px; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--error); }

.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font: inherit; font-size: 1rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--shadow-focus);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.textarea-lg { min-height: 200px; }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

.counter { font-size: 0.75rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--error); }

.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9375rem; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }

.row { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }

/* ---------------- Etiquetas e chips ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand);
  font-size: 0.8125rem; font-weight: 600;
}
.tag button {
  border: 0; background: none; color: inherit; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0; opacity: 0.7;
}
.tag button:hover { opacity: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--surface-2); color: var(--text-muted);
}
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-error { background: var(--error-tint); color: var(--error); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-brand { background: var(--brand-tint); color: var(--brand); }

/* ---------------- Progresso ---------------- */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-soft), var(--brand));
  transition: width 0.45s var(--ease);
}

.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step-pill {
  /* Ancora o `.sr-only` "(concluída)" aqui dentro: assim o `overflow-x` do
     .stepper recorta o span em vez de deixá-lo esticar a largura da página. */
  position: relative;
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s var(--ease);
}
.step-pill:hover { border-color: var(--brand-soft); color: var(--brand); }
.step-pill[aria-current='step'] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step-pill.is-done { color: var(--success); border-color: var(--success-tint); background: var(--success-tint); }
/* A etapa atual continua legível mesmo já concluída: o azul vence o verde. */
.step-pill.is-done[aria-current='step'] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step-num {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: currentColor; color: var(--surface); font-size: 0.6875rem; font-weight: 800;
}
.step-num.is-check { font-size: 0.75rem; line-height: 1; }

/* Campo com botão colado: no celular ninguém aperta Enter para confirmar. */
.input-with-button { display: flex; gap: 8px; align-items: stretch; }
.input-with-button .input { flex: 1; min-width: 0; }
.input-with-button .btn { flex: none; }

/* Item selecionável das sugestões da IA. */
.check-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); cursor: pointer;
}
.check-card:hover { border-color: var(--brand-soft); }
.check-card input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------------- Editor ---------------- */
/* Mobile-first e com um único valor de corte (1081px), igual ao usado no JS
   (`window.matchMedia('(min-width: 1081px)')`). Um par do tipo max-width:1080
   + min-width:1081 parece complementar, mas com zoom do navegador ou telas de
   alta densidade a largura pode chegar fracionada (ex.: 1080.4px) — nesse
   valor NENHUMA das duas condições bate, e CSS e JS discordam sobre o modo.
   Com o mesmo número nos dois lugares, sempre há exatamente uma resposta. */
.editor-layout { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); align-items: start; }

.editor-panel { min-width: 0; }
.preview-panel { position: static; }
.preview-panel.is-closed { display: none; }
/* Sem altura máxima não nasce barra de rolagem interna — e sem ela some o
   vaivém de largura que embaralhava a escala no celular. */
.preview-frame { max-height: none; overflow: visible; }

.preview-toggle { width: 100%; margin-bottom: var(--sp-4); }

@media (min-width: 1081px) {
  /* minmax(0, 1fr) na primeira coluna — sem isso ela se recusa a ficar menor
     que o A4 da pré-visualização e joga a página inteira para fora da tela. */
  .editor-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
  .preview-panel { position: sticky; top: calc(var(--header-h) + 16px); }
  .preview-frame { max-height: calc(100vh - var(--header-h) - 140px); overflow: auto; }
  .preview-toggle { display: none; }
}

.preview-frame {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4); min-width: 0;
}
/* O recorte tem o tamanho já reduzido; o filho continua com 794px por dentro. */
.preview-clip { overflow: hidden; margin: 0 auto; }
.preview-scaler { transform-origin: top left; }

.repeater-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4); margin-bottom: var(--sp-3); background: var(--surface-2);
}
.repeater-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.repeater-head strong { flex: 1; font-size: 0.9375rem; }

.template-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.template-option {
  border: 2px solid var(--border); border-radius: var(--r-md); padding: 10px;
  background: var(--surface); cursor: pointer; text-align: center; transition: all 0.18s var(--ease);
}
.template-option:hover { border-color: var(--brand-soft); }
.template-option[aria-pressed='true'] { border-color: var(--brand); box-shadow: var(--shadow-focus); }
.template-option img, .template-option svg { border-radius: 6px; margin-bottom: 8px; }
.template-option span { font-size: 0.8125rem; font-weight: 600; }

/* ---------------- Toast ---------------- */
.toast-area {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px));
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 12px 16px;
  font-size: 0.9375rem; animation: toast-in 0.25s var(--ease);
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- Modal ---------------- */
.modal[open] { display: flex; }
.modal {
  /* O navegador aplica max-width/max-height próprios em dialog:modal e centraliza
     com margin auto. Sem zerar isso, a caixa não cobre a tela e o escurecimento
     vira uma faixa em volta do modal. */
  position: fixed; inset: 0; z-index: 80; display: none;
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0;
  align-items: center; justify-content: center; padding: 16px;
  border: 0; overflow: hidden;
  /* O escurecimento fica só aqui. O dialog é `position: fixed; inset: 0`, então
     cobre a tela por construção, sem depender de como o navegador pinta a top
     layer. Repetir a mesma cor no ::backdrop somava as duas camadas e deixava o
     fundo quase preto. */
  background: rgba(15, 21, 35, 0.55);
  /* O <dialog> tem `color: CanvasText` no próprio UA stylesheet, que segue o
     tema do sistema operacional — não o data-theme deste app. Sem esta linha,
     título e parágrafos sem classe de cor própria saem pretos mesmo com o app
     em modo escuro, porque o preto do SO vence por herança direta. */
  color: var(--text);
}
.modal::backdrop { background: transparent; }
.modal-box {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  width: min(640px, 100%); max-height: min(88vh, 88dvh); overflow: auto; padding: var(--sp-6);
  animation: modal-in 0.22s var(--ease);
}
/* Com o teclado do celular aberto, 88vh ainda deixa a caixa maior que a área útil. */
@media (max-width: 640px) {
  .modal { padding: 8px; }
  .modal-box { width: 100%; max-height: calc(100dvh - 16px); padding: var(--sp-5); }
}
.modal-box.is-wide { width: min(880px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.modal-head h3 { flex: 1; }
.modal-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--sp-6); }
@media (max-width: 520px) { .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { width: 100%; } }

/* ---------------- Comparação de textos (IA) ---------------- */
.diff { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .diff { grid-template-columns: 1fr; } }
.diff-side { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface-2); }
.diff-side h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.diff-side p { white-space: pre-wrap; margin: 0; font-size: 0.9375rem; }
.diff-new { background: var(--brand-tint); border-color: var(--brand-tint-2); }

/* ---------------- Pontuação ---------------- */
.score-ring {
  --value: 0;
  width: 128px; height: 128px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), var(--border) 0);
}
.score-ring::after {
  content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface);
}
.score-value { position: relative; z-index: 1; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-value small { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.06em; }

.list-check { list-style: none; margin: 0; padding: 0; }
.list-check li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.list-check li:last-child { border-bottom: 0; }
.list-check .mark { flex: none; margin-top: 2px; }

/* ---------------- Estados vazios ---------------- */
.empty { text-align: center; padding: var(--sp-12) var(--sp-4); }
.empty-art { width: 96px; height: 96px; margin: 0 auto var(--sp-4); color: var(--brand); opacity: 0.85; }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--text-muted); max-width: 40ch; margin-inline: auto; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- FAQ ---------------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; padding: var(--sp-4) 0; font-weight: 600; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--brand); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { color: var(--text-muted); padding-bottom: var(--sp-4); margin: 0; }

/* ---------------- Landing ---------------- */
.hero { padding: var(--sp-12) 0 var(--sp-10); }
.hero-grid { display: grid; gap: var(--sp-10); grid-template-columns: 1.05fr 0.95fr; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: var(--sp-4); }
.hero-lead { font-size: 1.125rem; color: var(--text-muted); max-width: 46ch; }
.hero-points { list-style: none; padding: 0; margin: var(--sp-6) 0 0; display: grid; gap: 10px; }
.hero-points li { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; }
.hero-points svg { color: var(--success); flex: none; }

.auth-card { padding: var(--sp-8); border-radius: var(--r-xl); }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-pill); margin-bottom: var(--sp-6); }
.auth-tab {
  flex: 1; border: 0; background: none; padding: 10px; border-radius: var(--r-pill);
  font: inherit; font-weight: 600; font-size: 0.875rem; color: var(--text-muted); cursor: pointer;
}
.auth-tab[aria-selected='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 0.8125rem; margin: var(--sp-5) 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-google {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
}
.btn-google:hover { background: var(--surface-2); }

/* ---------------- Barra fixa do editor (mobile) ---------------- */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; gap: var(--sp-3); padding: var(--sp-4) 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.sticky-actions .btn { flex: 1; }

/* ---------------- Tutorial ---------------- */
.tour-step { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-3) 0; }
.tour-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); font-weight: 800; font-size: 0.8125rem;
}

/* ---------------- Banner de instalação / atualização ---------------- */
.app-banner {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  font-size: 0.9375rem;
}
.app-banner p { margin: 0; flex: 1; min-width: 200px; }

/* Enquanto a impressão é preparada, o currículo fica montado fora da vista — e
   não com `display: none`, que não carregaria a foto nem calcularia a altura.
   Deslocar para a esquerda é seguro: sobra à esquerda não gera barra de rolagem. */
#print-root { position: absolute; left: -10000px; top: 0; width: 210mm; }

/* Impressão. */
@media print {
  .appbar, .sticky-actions, .toast-area, .app-banner, .no-print { display: none !important; }
  /* A redução serve para caber na tela. No papel o currículo volta ao tamanho real. */
  .preview-clip, .preview-scaler {
    width: auto !important; height: auto !important;
    transform: none !important; overflow: visible !important; margin: 0 !important;
  }

  /* Quando pdf.js monta o bloco de impressão, só ele vai para o papel.
     Sem esta regra, imprimir do editor levava as etapas, a escolha de modelo, os
     botões e a pré-visualização junto com o currículo. */
  body.is-printing > *:not(#print-root) { display: none !important; }
  #print-root {
    position: static !important; left: auto !important; top: auto !important;
    width: auto !important;
  }
  /* openModal prende o body com position:fixed para a página não rolar atrás do
     modal. Se a impressão começar nesse estado, o papel sai em branco. */
  body.is-printing {
    position: static !important; top: auto !important; width: auto !important;
  }
}

/* ---------------- Paleta do currículo ---------------- */
.palette-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.swatch {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); padding: 6px 14px 6px 8px;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.18s var(--ease);
}
.swatch:hover { border-color: var(--border-strong); }
.swatch[aria-pressed='true'] { border-color: var(--swatch); color: var(--text); }
.swatch-dot {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ---------------- Foto do currículo ---------------- */
.photo-field {
  display: flex; gap: var(--sp-4); align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4); background: var(--surface-2);
}
.photo-preview {
  width: 88px; height: 88px; flex: none; border-radius: var(--r-md);
  overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { font-size: 0.75rem; color: var(--text-soft); }
.photo-actions { flex: 1; min-width: 0; display: grid; gap: 6px; }
.photo-actions .tag-list { margin-top: 6px; }
@media (max-width: 520px) {
  .photo-field { flex-direction: column; }
  .photo-preview { width: 100%; height: 140px; }
}

/* ---------------- Páginas de texto longo (termos, privacidade) ---------------- */
/* Medida de leitura curta: linha longa cansa e faz a pessoa reler a mesma frase.
   ~68 caracteres é o intervalo confortável, e no celular o limite é a tela. */
.legal { max-width: 68ch; }
.legal-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  font-size: 0.875rem; color: var(--text-muted); margin: var(--sp-3) 0 0;
}
.legal h1 { margin-bottom: var(--sp-3); }
.legal h2 {
  font-size: 1.25rem; margin: var(--sp-10) 0 var(--sp-3);
  padding-top: var(--sp-4); border-top: 1px solid var(--border);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal h3 { font-size: 1rem; margin: var(--sp-6) 0 var(--sp-2); }
.legal p, .legal li { color: var(--text); }
.legal ul, .legal ol { margin: 0 0 var(--sp-4); padding-left: 22px; }
.legal li { margin-bottom: var(--sp-2); }
.legal li::marker { color: var(--text-soft); }
/* Âncora com cabeçalho fixo: sem isto o título some atrás da barra do topo. */
.legal :target { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Caixa de destaque para o que a pessoa precisa mesmo ler. */
.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--brand);
  background: var(--surface-2); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warning); background: var(--warning-tint); }
.callout-danger { border-left-color: var(--error); background: var(--error-tint); }

/* Índice da página, para não obrigar a rolar tudo à procura de um assunto. */
.legal-toc { margin: var(--sp-6) 0 var(--sp-10); }
.legal-toc ol { columns: 2; column-gap: var(--sp-8); margin: 0; }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } }

/* Rodapé com os links obrigatórios. */
.site-footer { padding: var(--sp-10) 0; border-top: 1px solid var(--border); margin-top: var(--sp-10); }
.footer-links {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
  justify-content: center; margin: 0 0 var(--sp-3);
  list-style: none; padding: 0; font-size: 0.875rem;
}

/* ---------------- Área de risco (excluir conta) ---------------- */
.danger-zone {
  border: 1px solid color-mix(in srgb, var(--error) 35%, var(--border));
  background: var(--error-tint); border-radius: var(--r-md);
  padding: var(--sp-4); margin-top: var(--sp-4);
}
.danger-zone h4 { margin: 0 0 var(--sp-2); font-size: 0.9375rem; color: var(--error); }
.danger-zone p { margin: 0 0 var(--sp-3); font-size: 0.875rem; color: var(--text-muted); }
.danger-zone > :last-child { margin-bottom: 0; }
/* Lista do que será apagado: sem bolinhas, com um traço discreto. */
.delete-list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); font-size: 0.9375rem; }
.delete-list li { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-2); color: var(--text); }
.delete-list li::before { content: '—'; color: var(--error); flex: none; }
