/* ==========================================================================
   Web4 Comunicação — Briefing Estratégico de Identidade Visual
   Design system + layout web + layout PDF

   Sumário
   1. Tokens de design
   2. Reset e base
   3. Utilitários e acessibilidade
   4. Topbar e progresso
   5. Hero
   6. Layout principal e trilha de etapas
   7. Formulário: seções, campos, estados
   8. Botões e ações
   9. Conclusão e estados de sistema
   10. Rodapé
   11. Motion
   12. Responsividade
   13. Documento PDF (pdf.html)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens de design
   Paleta derivada do logotipo Web4: teal profundo, vermelho e dourado.
   -------------------------------------------------------------------------- */
:root {
  /* Cor — marca */
  --ink: #06151a;
  --teal-900: #003d4d;
  --teal-700: #075368;
  --teal-500: #0d6d87;
  --teal-100: #e3eef2;
  --red: #e8333f;
  --red-600: #c92732;
  --gold: #e9a13b;

  /* Cor — neutros */
  --slate: #3a4750;
  --muted: #5f6e77;
  --line: #d7e2e8;
  --mist: #f4f8fa;
  --paper: #fbfdfe;
  --white: #ffffff;

  /* Cor — feedback */
  --success: #0e7a5f;
  --success-soft: rgba(14, 122, 95, 0.08);
  --error: #c92732;
  --error-soft: rgba(201, 39, 50, 0.06);

  /* Tipografia */
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --display: "Sora", "Inter", "Segoe UI", Arial, sans-serif;

  /* Espaçamento (escala de 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Forma e profundidade */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(6, 21, 26, 0.06);
  --shadow: 0 18px 50px rgba(6, 21, 26, 0.1);
  --ring: 0 0 0 4px rgba(13, 109, 135, 0.16);

  /* Movimento */
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  --speed-fast: 140ms;
  --speed: 220ms;

  /* Medidas de layout */
  --content-max: 1360px;
  --gutter: clamp(18px, 5vw, 72px);
}

/* --------------------------------------------------------------------------
   2. Reset e base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: var(--font);
  background: var(--mist);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--teal-900);
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(38px, 5.4vw, 72px);
  letter-spacing: -0.015em;
}

h2 {
  margin: 0 0 var(--space-4);
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 var(--space-3);
  font-size: 22px;
}

:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  color: var(--white);
  background: var(--teal-700);
}

/* --------------------------------------------------------------------------
   3. Utilitários e acessibilidade
   -------------------------------------------------------------------------- */
/* Garante que [hidden] sempre vença displays declarados por classes. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--teal-900);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--speed-fast) var(--ease-out);
}

.skip-link:focus-visible {
  top: var(--space-3);
}

.noscript-panel {
  max-width: var(--content-max);
  margin: 0 auto var(--space-8);
  padding: var(--space-5) var(--space-6);
  border: 1px solid rgba(201, 39, 50, 0.3);
  border-radius: var(--radius);
  color: var(--error);
  background: var(--error-soft);
}

.noscript-panel p {
  margin: var(--space-2) 0 0;
  color: var(--slate);
}

/* --------------------------------------------------------------------------
   4. Topbar e progresso
   -------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(13, 109, 135, 0.07), transparent 36rem),
    linear-gradient(180deg, var(--paper), var(--mist) 46rem);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) var(--gutter);
  border-bottom: 1px solid rgba(215, 226, 232, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo-img {
  display: block;
  width: clamp(140px, 16vw, 180px);
  height: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.progress-wrap {
  min-width: min(340px, 32vw);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-track {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: var(--teal-100);
}

.progress-bar {
  width: 8.33%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-700), var(--teal-500));
  transition: width 320ms var(--ease-out);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.6fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) var(--space-8);
}

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  max-width: 700px;
  margin: var(--space-5) 0 0;
  color: var(--slate);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
}

.hero-card {
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero-card-title {
  margin: 0 0 var(--space-2);
  font-size: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.metric {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.metric strong {
  display: block;
  color: var(--teal-700);
  font-family: var(--display);
  font-size: 21px;
}

.metric span {
  display: block;
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   6. Layout principal e trilha de etapas
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--space-6);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-16);
}

/* Evita que conteúdo largo (ex.: trilha horizontal no mobile)
   expanda os itens do grid além da viewport. */
.layout > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
}

.steps {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: var(--space-3);
  align-items: start;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--slate);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--speed-fast) var(--ease-out), color var(--speed-fast) var(--ease-out);
}

.step-button:hover,
.step-button.is-active {
  color: var(--teal-900);
  background: var(--teal-100);
}

.step-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
  transition: background var(--speed-fast) var(--ease-out),
    color var(--speed-fast) var(--ease-out),
    border-color var(--speed-fast) var(--ease-out);
}

.step-button.is-active .step-index {
  border-color: var(--teal-700);
  color: var(--white);
  background: var(--teal-700);
}

/* Etapa em andamento: anel dourado discreto. */
.step-button.is-partial .step-index {
  border-color: var(--gold);
}

/* Etapa concluída: o número dá lugar a um check. */
.step-button.is-complete .step-index {
  border-color: var(--success);
  color: transparent;
  background: var(--success);
  position: relative;
}

.step-button.is-complete .step-index::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: translateY(-1px) rotate(-45deg);
}

.step-copy {
  display: block;
}

.step-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.step-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   7. Formulário: seções, campos, estados
   -------------------------------------------------------------------------- */
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

.form-panel:focus {
  outline: none;
}

.form-loading {
  padding: var(--space-12);
  color: var(--muted);
}

.fatal-error strong {
  display: block;
  color: var(--error);
  font-size: 17px;
}

.fatal-error p {
  margin: var(--space-2) 0 0;
  max-width: 560px;
  color: var(--slate);
}

.required-note {
  margin: 0;
  padding: var(--space-3) clamp(22px, 4vw, 48px) 0;
  color: var(--muted);
  font-size: 13px;
}

.form-section {
  display: none;
  padding: clamp(22px, 4vw, 48px);
}

.form-section.is-active {
  display: block;
}

.section-kicker {
  margin: 0 0 var(--space-2);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-section h2:focus {
  outline: none;
}

.section-intro {
  max-width: 720px;
  margin: 0 0 var(--space-8);
  color: var(--slate);
  font-size: 16px;
  line-height: 1.6;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.field {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.field.full {
  grid-column: 1 / -1;
}

label,
.choice-fieldset legend {
  color: var(--teal-900);
  font-size: 14px;
  font-weight: 700;
}

.required-mark {
  color: var(--red);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--speed-fast) var(--ease-out), box-shadow var(--speed-fast) var(--ease-out);
}

input,
select {
  min-height: 48px;
  padding: 0 var(--space-4);
}

textarea {
  min-height: 116px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-500);
  box-shadow: var(--ring);
}

input::placeholder,
textarea::placeholder {
  color: #9aa7ae;
}

.choice-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--space-2);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-weight: 500;
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--speed-fast) var(--ease-out), background var(--speed-fast) var(--ease-out);
}

.choice:hover {
  border-color: var(--teal-500);
}

.choice:has(input:checked) {
  border-color: var(--teal-700);
  color: var(--teal-900);
  background: var(--teal-100);
}

.choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--teal-700);
  flex-shrink: 0;
}

/* Estados de erro */
.field-error {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
}

.field-error::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--error);
  transform: translateY(-1px);
}

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

.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 4px var(--error-soft);
}

/* --------------------------------------------------------------------------
   8. Botões e ações
   -------------------------------------------------------------------------- */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) clamp(22px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--speed-fast) var(--ease-out),
    border-color var(--speed-fast) var(--ease-out),
    color var(--speed-fast) var(--ease-out),
    transform var(--speed-fast) var(--ease-out),
    box-shadow var(--speed-fast) var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  color: var(--white);
  background: var(--teal-900);
}

.button.primary:hover {
  background: var(--teal-700);
  box-shadow: 0 8px 24px rgba(0, 61, 77, 0.24);
}

.button.secondary {
  color: var(--teal-900);
  border-color: var(--line);
  background: var(--white);
}

.button.secondary:hover {
  border-color: var(--teal-500);
}

.button.ghost {
  color: var(--teal-700);
  background: transparent;
}

.button.ghost:hover {
  background: var(--teal-100);
}

.button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--mist);
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.save-area {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.save-status.is-error {
  color: var(--error);
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--speed-fast) var(--ease-out);
}

.link-button:hover {
  color: var(--error);
}

/* --------------------------------------------------------------------------
   9. Conclusão e estados de sistema
   -------------------------------------------------------------------------- */
.completion-panel {
  text-align: center;
}

.completion-panel:focus {
  outline: none;
}

.completion-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--success);
  box-shadow: 0 14px 38px rgba(14, 122, 95, 0.32);
}

.completion-panel h2 {
  margin-bottom: var(--space-3);
}

.completion-text {
  max-width: 560px;
  margin: 0 auto var(--space-3);
  color: var(--slate);
  font-size: 16px;
  line-height: 1.6;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* --------------------------------------------------------------------------
   10. Rodapé
   -------------------------------------------------------------------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. Motion
   -------------------------------------------------------------------------- */
@keyframes section-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-section.is-active {
  animation: section-enter var(--speed) var(--ease-out);
}

@keyframes completion-pop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.completion-panel[hidden] {
  display: none;
}

.completion-panel:not([hidden]) {
  display: block;
}

.completion-panel:not([hidden]) .completion-icon {
  animation: completion-pop 320ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   12. Responsividade
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3);
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .progress-wrap {
    flex: 1;
    min-width: 0;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .steps {
    display: flex;
    min-width: max-content;
    gap: var(--space-2);
  }

  .step-button {
    min-width: 180px;
  }
}

@media (max-width: 680px) {
  .hero {
    padding-top: var(--space-8);
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .topbar-actions .button {
    width: 100%;
  }

  .metric-grid,
  .field-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .field-grid .field {
    grid-column: 1 / -1;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .button {
    flex: 1 1 calc(50% - var(--space-4));
  }

  .save-area {
    order: 3;
    width: 100%;
    margin-top: var(--space-2);
  }

  .site-footer {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* ==========================================================================
   13. Documento PDF (pdf.html)
   Identidade editorial premium — A4, 15 páginas.
   ========================================================================== */
.premium-pdf-body {
  background: #e6edf3;
}

.premium-pdf {
  width: 210mm;
  margin: 0 auto;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
}

.premium-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 210mm;
  min-height: 297mm;
  padding: 16mm 18mm 14mm;
  overflow: hidden;
  background: var(--white);
  page-break-after: always;
}

/* Filete de marca no topo de cada página. */
.premium-page::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 44mm;
  height: 3mm;
  background: var(--red);
}

/* ---- Capa ---- */
.premium-cover {
  padding: 19mm 18mm 17mm;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(0, 61, 77, 0.97), rgba(6, 21, 26, 0.98)),
    radial-gradient(circle at 82% 18%, rgba(232, 51, 63, 0.22), transparent 30mm);
}

.premium-cover::before {
  width: 74mm;
  height: 4mm;
  background: linear-gradient(90deg, var(--gold), var(--red));
}

.premium-cover::after {
  content: "";
  position: absolute;
  right: -24mm;
  bottom: 32mm;
  width: 90mm;
  height: 90mm;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(45deg);
}

.premium-cover-header,
.premium-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14mm;
}

.premium-cover-header img,
.premium-logo {
  display: block;
  width: 62mm;
  height: auto;
}

.premium-cover-header img {
  box-sizing: content-box;
  padding: 3.5mm 4.5mm;
  border-radius: 2mm;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.premium-cover-header span,
.premium-header span {
  color: inherit;
  font-size: 7.6pt;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}

.premium-header {
  padding-bottom: 6mm;
  border-bottom: 1px solid var(--line);
}

.premium-header img {
  display: block;
  width: 36mm;
  height: auto;
}

.cover-index {
  position: relative;
  z-index: 1;
  margin-top: 48mm;
  color: rgba(255, 255, 255, 0.7);
  font-size: 8pt;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.premium-cover h1 {
  position: relative;
  z-index: 1;
  max-width: 160mm;
  margin: 8mm 0 0;
  color: var(--white);
  font-size: 38pt;
  line-height: 0.98;
}

.premium-lead {
  position: relative;
  z-index: 1;
  max-width: 126mm;
  margin: 9mm 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5pt;
  line-height: 1.55;
}

.cover-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8mm;
  margin-top: auto;
}

.cover-meta div {
  min-height: 19mm;
  padding-top: 5mm;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.cover-meta span {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 7pt;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cover-meta strong {
  display: block;
  min-height: 8mm;
}

/* ---- Páginas editoriais ---- */
.page-intro {
  margin-top: 16mm;
  max-width: 154mm;
}

.page-intro.compact {
  margin-top: 13mm;
}

.premium-kicker {
  display: inline-flex;
  margin-bottom: 4mm;
  color: var(--red);
  font-size: 7.5pt;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.premium-page h2 {
  margin: 0;
  color: var(--teal-900);
  font-size: 26pt;
  line-height: 1.05;
}

.page-intro p,
.section-title p,
.note-panel p,
.closing-card p,
.process-grid p {
  color: var(--muted);
  font-size: 9.8pt;
  line-height: 1.55;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4.5mm;
  margin-top: 12mm;
}

.process-grid article {
  min-height: 33mm;
  padding: 5mm;
  border: 1px solid var(--line);
  border-radius: 2mm;
  background: var(--mist);
}

.process-grid article span,
.toc-grid span,
.section-title > span {
  color: var(--red);
  font-weight: 800;
}

.process-grid strong {
  display: block;
  margin-top: 3mm;
  color: var(--teal-900);
  font-size: 10.5pt;
}

.process-grid p {
  margin: 2mm 0 0;
  font-size: 8.2pt;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5mm;
  margin-top: 12mm;
}

.toc-grid div {
  display: flex;
  align-items: center;
  gap: 4mm;
  min-height: 16mm;
  padding: 4mm;
  border-bottom: 1px solid var(--line);
  color: var(--teal-900);
  font-size: 10.5pt;
  font-weight: 700;
}

.note-panel,
.closing-card {
  margin-top: 14mm;
  padding: 7mm;
  border-left: 1.8mm solid var(--red);
  background: var(--mist);
}

.note-panel strong,
.closing-card strong {
  display: block;
  color: var(--teal-900);
  font-size: 11pt;
}

.note-panel p,
.closing-card p {
  margin: 2mm 0 0;
}

/* ---- Páginas de seção ---- */
.section-page {
  padding-top: 14mm;
}

.section-title {
  display: grid;
  grid-template-columns: 16mm 1fr;
  gap: 6mm;
  align-items: start;
  margin-top: 10mm;
  padding-bottom: 6mm;
  border-bottom: 1px solid var(--line);
}

.section-title > span {
  display: grid;
  width: 14mm;
  height: 14mm;
  place-items: center;
  border: 1px solid rgba(232, 51, 63, 0.4);
  border-radius: 50%;
  font-size: 10.5pt;
}

.section-title h2 {
  font-size: 21pt;
}

.section-title p {
  max-width: 132mm;
  margin: 2.5mm 0 0;
}

.questions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4mm 5mm;
  margin-top: 6mm;
}

.question {
  display: grid;
  gap: 2mm;
  align-content: start;
}

.question.full {
  grid-column: 1 / -1;
}

.question label {
  color: var(--ink);
  font-size: 9.2pt;
  font-weight: 700;
  line-height: 1.35;
}

.question-hint {
  margin: 0;
  color: var(--muted);
  font-size: 7.8pt;
  line-height: 1.4;
}

/* Área de resposta com pauta sutil para preenchimento manual. */
.answer {
  border: 1px solid var(--line);
  border-radius: 2mm;
  background:
    linear-gradient(var(--white), var(--white)) padding-box,
    repeating-linear-gradient(180deg, transparent 0, transparent 8mm, rgba(215, 226, 232, 0.86) 8.1mm) border-box;
}

.answer.short {
  min-height: 10mm;
}

.answer.box {
  min-height: 19mm;
}

.answer.large {
  min-height: 28mm;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5mm;
}

.option-row span {
  padding: 2mm 4mm;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-900);
  font-size: 8pt;
  font-weight: 700;
}

/* ---- Validação e assinatura ---- */
.validation-page .validation-notes {
  margin-top: 10mm;
}

.premium-signatures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10mm;
  margin-top: 16mm;
}

.premium-signatures div {
  padding-top: 14mm;
  border-top: 1px solid var(--teal-900);
  color: var(--muted);
  font-size: 9pt;
}

.premium-footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6mm;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 7.6pt;
  font-weight: 700;
}

.pdf-error {
  margin: 10mm auto;
  max-width: 160mm;
  color: var(--error);
  font-weight: 600;
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  .premium-pdf-body {
    background: var(--white);
  }

  .premium-pdf {
    width: auto;
    margin: 0;
  }
}
