/*
 * Página "Em obras" (#395). Base: styles.css do Victor (2026-11-09), com quatro desvios:
 * Figtree auto-hospedada no lugar do Google Fonts; patinhas em arquivo (a CSP não aceita
 * data:); botão com texto escuro e foco em primary-700, borda de campo em neutral-500
 * (docs/DESIGN.md: branco sobre o laranja dá 2,16:1); e os estados novos do formulário
 * (frase de LGPD, erro e "Tentar de novo").
 */

/* Figtree, SIL OFL 1.1 (fonts/OFL.txt). Mesmos subconjuntos do app (src/ui/styles/app.css). */
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-variable-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; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-variable-latin-ext.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --orange: #FC9921;
  --orange-hover: #E88815;
  --brown: #32221C;
  --brown-secondary: #654F4B;
  --cream: #FFF0D9;
  --blob-a: #FFD093;
  --blob-b: #FFE9AD;
  --teal: #006668;
  --focus: #8C4A00;          /* primary-700: anel de foco e contorno do botão */
  --control-border: #7F706D; /* neutral-500: borda de controle, 4,51:1 */
  --error: #AC3827;          /* accent-700: texto de erro */
  --white: #FFFFFF;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(50, 34, 28, 0.08);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--brown);
  background: var(--cream);
  line-height: 1.45;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.bg__blob--tl {
  width: min(52vw, 420px);
  height: min(42vw, 340px);
  top: -12%;
  left: -10%;
  background: var(--blob-a);
  opacity: 0.85;
  border-radius: 60% 40% 55% 45% / 55% 45% 60% 40%;
}

.bg__blob--br {
  width: min(60vw, 520px);
  height: min(48vw, 400px);
  right: -14%;
  bottom: -16%;
  background: var(--blob-b);
  opacity: 0.9;
  border-radius: 45% 55% 40% 60% / 50% 40% 60% 50%;
}

.bg__blob--tr {
  width: min(28vw, 220px);
  height: min(22vw, 180px);
  top: 8%;
  right: 6%;
  background: var(--blob-a);
  opacity: 0.45;
  border-radius: 50% 50% 40% 60%;
}

.bg__paws {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("/assets/patinhas.svg");
  background-size: 180px 180px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/*
 * Logo oficial empilhado (#404), hoje a v6.2, proporção 1607×1773 depois de aparar o transparente.
 * A cabeça inteira (BRAND.md § 1, patas e bandana incluídas) tem cerca de 960 px na fonte de 2048;
 * a área de proteção é 1/4 dela, ou seja, 0,149 × a largura. O tamanho fica pequeno de propósito para não competir com o Fauno
 * em obras.
 */
.logo {
  --logo-largura: 104px;
  --logo-protecao: calc(var(--logo-largura) * 0.149);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--brown);
  align-self: center;
  min-height: 44px;
  margin-bottom: max(clamp(1rem, 3vw, 1.5rem), var(--logo-protecao));
  border-radius: 12px;
}

.logo:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.logo__img {
  width: var(--logo-largura);
  height: auto;
  flex-shrink: 0;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2rem);
  width: 100%;
}

.hero__art {
  width: min(100%, 420px);
  order: 1;
}

.hero__art picture,
.hero__art img {
  width: 100%;
}

.hero__art img {
  animation: floaty 4.5s ease-in-out infinite;
  filter: drop-shadow(0 18px 28px rgba(50, 34, 28, 0.12));
}

.hero__copy {
  order: 2;
  width: 100%;
  max-width: 34rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.85rem, 7vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--brown);
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  font-weight: 500;
  color: var(--brown-secondary);
  max-width: 28rem;
}

.notify {
  width: 100%;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notify__field {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notify__input {
  width: 100%;
  appearance: none;
  border: 1.5px solid var(--control-border);
  background: var(--white);
  color: var(--brown);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.95rem 1.25rem;
  /* 44 px é o alvo de toque (DESIGN.md); o padding em svh do celular chegou a 43,3 px em 320×568 (#404). */
  min-height: 44px;
  border-radius: var(--radius-pill);
  outline: none;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notify__input::placeholder {
  color: rgba(101, 79, 75, 0.65);
}

.notify__input:focus-visible {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

.notify__btn {
  width: 100%;
  appearance: none;
  min-height: 44px;
  border: 1.5px solid var(--focus);
  cursor: pointer;
  background: var(--orange);
  color: var(--brown);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, transform 0.15s ease;
}

.notify__btn:hover {
  background: var(--orange-hover);
}

.notify__btn:focus-visible,
.notify__retry:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.notify__btn:disabled {
  cursor: progress;
  background: var(--orange-hover);
}

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

.notify__msg {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal);
}

.notify__msg[data-tom="erro"] {
  color: var(--error);
}

.notify__msg:empty {
  display: none;
}

.notify__lgpd {
  margin: 0;
  /* Evita quebrar "e-mail" no hífen com a palavra sozinha na última linha. */
  text-wrap: pretty;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brown-secondary);
}

.notify__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.75rem;
}

.notify__status:has(.notify__msg:empty) {
  display: none;
}

.notify__retry {
  appearance: none;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--focus);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--brown);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.notify__retry[hidden] {
  display: none;
}

.hero__note {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal);
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__art img {
    animation: none;
  }
}

/*
 * Celular cabe na tela sem rolar (diretiva do Victor, 2026-11-09, #404): no Chrome do iPhone o
 * campo ficava cortado e o botão e a LGPD ficavam fora da tela. Tudo que tem altura passa a
 * acompanhar a altura visível (svh, que já desconta as barras do navegador): logo de ~80 a
 * 96 px de altura, Fauno em obras limitado pela altura sem cortar, título e espaços menores.
 * O desktop (≥ 900 px) não usa nada disto.
 */
@media (max-width: 899px) {
  .page {
    min-height: 100svh;
    padding-block: clamp(0.75rem, 2.4svh, 1.5rem);
  }

  .logo {
    --logo-largura: clamp(64px, 11svh, 86px);
    margin-bottom: max(clamp(0.25rem, 1.2svh, 1rem), var(--logo-protecao));
  }

  .hero {
    gap: clamp(0.5rem, 2svh, 1.5rem);
  }

  .hero__art {
    width: auto;
    max-width: 100%;
  }

  .hero__art picture {
    display: block;
    width: auto;
  }

  .hero__art img {
    width: auto;
    max-width: 100%;
    max-height: clamp(140px, 30svh, 340px);
    margin-inline: auto;
  }

  .hero__copy {
    gap: clamp(0.4rem, 1.3svh, 0.85rem);
  }

  .hero__title {
    font-size: clamp(1.5rem, min(7vw, 4.3svh), 2.6rem);
  }

  .hero__subtitle {
    font-size: clamp(0.95rem, min(3.2vw, 2.5svh), 1.2rem);
  }

  .notify {
    margin-top: 0;
    gap: clamp(0.5rem, 1.3svh, 0.75rem);
  }

  .notify__input,
  .notify__btn {
    padding-block: clamp(0.55rem, 1.6svh, 0.95rem);
  }

  .notify__lgpd {
    font-size: clamp(0.8rem, 2.1svh, 0.875rem);
    line-height: 1.35;
  }

  .hero__note {
    margin-top: 0;
    font-size: clamp(0.85rem, 2.2svh, 0.95rem);
  }
}

@media (min-width: 900px) {
  .page {
    padding: clamp(2rem, 4vw, 3.5rem) clamp(2rem, 5vw, 3.5rem);
  }

  .logo {
    --logo-largura: 120px;
    align-self: flex-start;
    margin-bottom: max(1.5rem, var(--logo-protecao));
  }

  .hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(2rem, 5vw, 4rem);
  }

  .notify__status {
    justify-content: flex-start;
  }

  .hero__copy {
    order: 1;
    flex: 1 1 46%;
    align-items: flex-start;
    text-align: left;
    max-width: 32rem;
  }

  .hero__art {
    order: 2;
    flex: 1 1 48%;
    width: min(100%, 520px);
    max-width: 520px;
  }

  .hero__title {
    font-size: clamp(2.6rem, 4.2vw, 3.4rem);
  }

  .notify {
    flex-direction: row;
    align-items: stretch;
    gap: 0.75rem;
  }

  .notify__field {
    flex: 1 1 auto;
  }

  .notify__btn {
    width: auto;
    flex: 0 0 auto;
    min-width: 8.5rem;
    padding-inline: 1.6rem;
  }
}
