/* Lista do teste da Plataforma i-Gov TI.
   Cores e fonte do guia da marca do Instituto i (as mesmas da plataforma,
   mentor-iegm/src/app/globals.css). Sem dependências externas: a Rubik é
   servida daqui e nada sai do domínio além do envio do formulário.
   Cantos: superfícies 16px, imagem 12px, campos e botões 10px. */

@font-face {
  font-family: "Rubik";
  src: url("assets/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f4f4;            /* off-white da marca */
  --surface: #ffffff;
  --ink: #241a2a;
  --heading: #2c2e81;       /* índigo da marca */
  --muted: #6b635c;
  --line: #e1ddd9;          /* decorativa */
  --field-line: #8f8680;    /* borda de campo, 3,5:1 no branco */
  --accent: #5c257f;        /* roxo da marca: a única cor de ação */
  --accent-ink: #f5f4f4;
  --accent-hover: #4a1d67;
  --error: #bc1818;
  --dots: #f9af15;
  --curve: #00afac;
  --shadow: 0 1px 2px rgb(92 37 127 / 0.06), 0 12px 32px -12px rgb(92 37 127 / 0.18);
  --filete: linear-gradient(90deg, #f9af15, 66%, #e74011);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16121a;
    --surface: #211b27;
    --ink: #efeaf2;
    --heading: #c9c9f6;
    --muted: #b3aab8;
    --line: #3a3242;
    --field-line: #8c8293;
    --accent: #cfaee6;
    --accent-ink: #1e0f2a;
    --accent-hover: #ddc4ef;
    --error: #ff9a90;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.55);
  }
}

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

/* O hidden vale mesmo em elemento com display próprio (o .form é grid). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { margin: 0; color: var(--heading); font-weight: 600; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip:focus { top: 12px; color: var(--accent-ink); }

/* Barra de cima */

.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--heading);
  text-decoration: none;
  font-weight: 500;
}
.brand img { height: 32px; width: auto; }
.brand__divider { width: 1px; height: 24px; background: var(--line); }
.brand:hover { color: var(--heading); }

/* No celular estreito a barra fica numa linha só: logo e botão. */
@media (max-width: 419px) {
  .brand__divider, .brand__name { display: none; }
}

.topbar__cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.topbar__cta:hover { background: var(--accent-hover); color: var(--accent-ink); }

/* Hero */

.hero { position: relative; overflow: hidden; }

.hero__decor { display: none; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "form" "shot";
  gap: 32px;
  padding-block: 40px 56px;
}

.hero__copy { grid-area: copy; }
.hero__shot { grid-area: shot; margin: 0; }
.hero__form { grid-area: form; }

.filete {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--filete);
  margin-bottom: 20px;
}

h1 {
  font-size: clamp(2.125rem, 1.55rem + 2.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
  text-wrap: balance;
}

.lead {
  margin: 16px 0 0;
  max-width: 44ch;
  font-size: 1.125rem;
  color: var(--muted);
  text-wrap: pretty;
}

.hero__shot img {
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero__shot figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Formulário */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.panel__title { font-size: 1.375rem; line-height: 1.25; }

.panel__text { margin: 8px 0 0; color: var(--muted); font-size: 0.9375rem; }

.form { display: grid; gap: 14px; }

.form__row { display: grid; gap: 14px; }

@media (min-width: 480px) {
  .form__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.form .panel__text { margin-top: -8px; margin-bottom: 4px; }

.field { display: grid; gap: 6px; }

.field label { font-weight: 500; font-size: 0.9375rem; }

.field__optional { font-weight: 400; color: var(--muted); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field input:focus-visible { outline-offset: 1px; border-color: var(--accent); }

.field input[aria-invalid="true"] { border-color: var(--error); }

.field__help, .field__error { margin: 0; font-size: 0.875rem; }
.field__help { color: var(--muted); }
.field__error { color: var(--error); font-weight: 500; }

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 10px;
}
.field--check input {
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.field--check label { font-weight: 400; line-height: 1.5; }
.field--check .field__error { grid-column: 2; }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--error);
  color: var(--error);
  font-size: 0.9375rem;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.button:hover { background: var(--accent-hover); }
.button:active { transform: translateY(1px); }
.button[disabled] { cursor: progress; opacity: 0.75; }

.privacy { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.55; }

.done:focus { outline: none; }

/* Entrega */

.deliver { border-top: 1px solid var(--line); background: var(--surface); }

.deliver__grid {
  display: grid;
  gap: 24px;
  padding-block: 56px 64px;
}

.deliver h2 {
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.deliver__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }

.deliver__list li { padding-top: 16px; border-top: 1px solid var(--line); }

.deliver__list h3 { font-size: 1.125rem; line-height: 1.3; }

.deliver__list p { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }

/* Rodapé */

.footer { border-top: 1px solid var(--line); }

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px 28px;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer p { margin: 0; }

/* A partir de 768px */

@media (min-width: 768px) {
  .wrap { padding-inline: 32px; }

  .hero__decor {
    display: block;
    position: absolute;
    inset: 0 0 auto auto;
    width: 420px;
    height: 260px;
    pointer-events: none;
  }
  .dots {
    position: absolute;
    top: 8px;
    right: 0;
    width: 220px;
    height: 220px;
    background-image: radial-gradient(circle, var(--dots) 1.3px, transparent 1.7px);
    background-size: 9px 9px;
    opacity: 0.7;
    -webkit-mask-image: radial-gradient(circle at 100% 0%, transparent 34%, #000 35%, #000 68%, transparent 69%);
    mask-image: radial-gradient(circle at 100% 0%, transparent 34%, #000 35%, #000 68%, transparent 69%);
  }
  .curve { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--curve); }

  .panel { padding: 28px; }

  .deliver__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A partir de 1024px: texto e imagem à esquerda, formulário à direita */

@media (min-width: 1024px) {
  .topbar__cta { display: none; }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-areas: "copy form" "shot form";
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    row-gap: 36px;
    padding-block: 40px 72px;
  }
  .hero__form { align-self: start; position: relative; z-index: 1; }

  .deliver__grid {
    grid-template-columns: 4fr 8fr;
    column-gap: 56px;
    align-items: start;
  }
  .deliver__list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:active { transform: none; }
}

@media (forced-colors: active) {
  .hero__decor { display: none; }
}
