/* ── E O FILME É… ──
   Estava embutido no próprio HTML. A página passa a carregar o style.css:
   medido em media=print antes e depois, a folha sai igual. */

  /* Estas folhas nao carregam o css/style.css, por isso repetem aqui a rede
     do [hidden]: sem ela, qualquer `display` declarado ganha ao atributo. */
  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  @page { size: A4 portrait; margin: 0; }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Nunito', sans-serif; background: #f0ecf8; }

  /* ── BARRA DE ECRÃ ── */
  .screen-only.bar {
    background: white; border-bottom: 1.5px solid #EDE6F8; padding: 12px 24px;
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 200;
  }
  .bar-back {
    font-size: 13px; font-weight: 800; color: #6B4FA6; text-decoration: none;
    padding: 8px 14px; border: 1.5px solid #C9B8E8; border-radius: 10px;
    transition: background .2s;
  }
  .bar-back:hover { background: #EDE6F8; }
  .bar-title { margin: 0; font-size: 15px; font-weight: 900; color: #3D2F4A; }
  .bar-title span { color: #865FCB; }
  .lang-toggle {
    background: none; border: 1.5px solid #C9B8E8; border-radius: 8px;
    padding: 5px 11px; font-family: 'Nunito', sans-serif; font-size: 12px;
    font-weight: 800; color: #6B4FA6; cursor: pointer;
  }
  .lang-toggle.active { background: #EDE6F8; }
  .lang-toggle:focus-visible, .bar-back:focus-visible, .btn-print:focus-visible {
    outline: 3px solid #6B4FA6; outline-offset: 2px;
  }
  .btn-print {
    background: #6B4FA6; border: none; border-radius: 10px; padding: 8px 20px;
    font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
    color: white; cursor: pointer;
  }
  .btn-print:hover { background: #7F77DD; }
  .ver-lbl {
    font-size: 12px; font-weight: 800; color: #6B4FA6;
    text-transform: uppercase; letter-spacing: .1em; margin-bottom: -20px;
  }

  .wrap { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 34px 12px 60px; }

  /* A4 retrato a 96dpi: 210mm x 297mm. Em mm e não em px, para o browser não
     arredondar de formas diferentes na impressão e criar páginas em branco. */
  .page {
    width: 210mm; height: 297mm;
    background: white; padding: 12mm 10mm;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(100,80,180,.18); border-radius: 6px;
  }

  /* ── CABEÇALHO DE CADA FOLHA ── */
  .f-hdr {
    display: flex; align-items: center; gap: 12px;
    background: #EDE6F8; border-radius: 12px; padding: 10px 14px; margin-bottom: 8mm;
  }
  .f-hdr.azul { background: #E4EEF9; }
  .f-hdr img { width: 40px; height: 40px; object-fit: contain; }
  .f-hdr-txt h2 { font-size: 17px; font-weight: 800; color: #7A50C6; margin: 0; }   /* era #865FCB: 3.83:1 */
  .f-hdr.azul .f-hdr-txt h2 { color: #1F69C1; }
  .f-hdr-txt p { font-size: 10px; color: #6B5C77; margin: 2px 0 0; }

  /* ── GRELHA DE CARTÕES ── */
  .cartoes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5mm; flex: 1; }
  .cartao {
    border: 1.2px dashed #B9A6DE; border-radius: 10px;
    display: flex; flex-direction: column; overflow: hidden;
  }
  .cartao-top {
    background: #865FCB; color: white;
    font-size: 6px; font-weight: 800; letter-spacing: .08em;
    text-align: center; padding: 3px 2px; text-transform: uppercase;
  }
  .cartao-corpo {
    flex: 1; background: #EDE6F8;
    display: flex; align-items: center; justify-content: center;
    padding: 6px 5px; text-align: center;
  }
  .cartao-nome { font-size: 10px; font-weight: 600; color: #3D2F4A; line-height: 1.3; }
  .cartao-linha { width: 70%; border-bottom: 1px solid #B9A6DE; height: 1px; }
  .azul .cartao-top { background: #2376D8; }   /* era #4A90E2: 3.29:1 com o branco */
  .azul .cartao-corpo { background: #E4EEF9; }
  .azul .cartao { border-color: #9FC0EA; }
  .azul .cartao-linha { border-color: #9FC0EA; }

  /* ── PÁGINA DE INSTRUÇÕES ── */
  .instr-capa { align-items: center; text-align: center; padding-top: 24mm; }
  .instr-capa img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 10px; }
  .instr-capa h2 { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 700; color: #865FCB; }
  .instr-capa .sub { font-size: 12px; color: #6B5C77; margin: 6px 0 12px; }
  .instr-capa hr { width: 80%; border: none; border-top: 1px solid #D9CEF0; margin-bottom: 10mm; }
  .passos { width: 100%; display: flex; flex-direction: column; gap: 4mm; }
  .passo {
    display: flex; gap: 12px; align-items: flex-start; text-align: left;
    background: white; border: 1.2px solid #E3DAF5; border-radius: 12px; padding: 10px 14px;
  }
  .passo-n {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    background: #865FCB; color: white; font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
  }
  .passo h3 { font-size: 13px; font-weight: 800; color: #3D2F4A; margin: 0 0 2px; }
  .passo p { font-size: 10.5px; color: #6B5C77; line-height: 1.5; margin: 0; }

  .f-rodape {
    margin-top: 6mm; text-align: center;
    font-size: 8px; color: #826E98; letter-spacing: .05em;   /* era #A99BB8: 2.60:1 */
  }

  @media print {
    .screen-only { display: none !important; }
    body { background: white; }
    .wrap { gap: 0; padding: 0; }
    .page { box-shadow: none; border-radius: 0; page-break-after: always; }
    .page:last-child { page-break-after: auto; }
  }
  /* Ajuste ao ecrã: estas folhas têm largura fixa de A4 e transbordavam no
     telemóvel. O zoom encolhe tudo em bloco sem mexer nas medidas de impressão. */
  @media screen and (max-width: 900px) { .wrap { zoom: 0.62; } }
  @media screen and (max-width: 560px) { .wrap { zoom: 0.42; } }
  @media screen and (max-width: 400px) {
    .wrap { zoom: 0.32; }
    .screen-only.bar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  }
