/* ==========================================================================
   Itu Garden — Páginas públicas (sorteio, regulamento, aviso)
   Folha única. Substitui site.css + site-v2.css + public-v3.css + public-v4.css.
   As cores da marca vêm do sorteio, injetadas em --brand-primary/--brand-accent.
   ========================================================================== */

:root {
  --brand-primary: #163c31;
  --brand-accent: #d7ab4b;
  --cream: #f5f1e8;
  --ink: #16332b;
  --muted: #6f7d76;
  --line: #e4e0d5;
  --surface: #ffffff;
  --danger: #a74139;
  --danger-soft: #fbecea;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 34px rgba(15, 42, 34, .1);
  --shadow-lg: 0 24px 60px rgba(15, 42, 34, .18);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
i.fi { font-style: normal; line-height: 1; }
img, canvas, svg, video { max-width: 100%; }

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

.eyebrow, .mini-kicker {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-accent);
}

/* --------------------------------------------------- Páginas de aviso - */

.simple-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 22%, rgba(215, 171, 75, .2), transparent 44%),
    linear-gradient(145deg, #0a251f, var(--brand-primary) 62%, #0f3128);
}
.simple-card {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 44px 38px;
  text-align: center;
  display: grid;
  gap: 13px;
  justify-items: center;
  box-shadow: var(--shadow-lg);
}
.simple-card img { width: 148px; max-height: 56px; object-fit: contain; filter: invert(1) brightness(.24); }
.simple-card h1 { font-size: 25px; line-height: 1.3; }
.simple-card p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.quiet-link { margin-top: 8px; font-size: 13px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.quiet-link:hover { color: var(--brand-primary); border-color: var(--brand-primary); }

/* ---------------------------------------------------- Página do sorteio - */

.dynamic-public-page { min-height: 100vh; display: flex; flex-direction: column; }

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(20px, 5vw, 56px);
  background: var(--brand-primary);
  color: #fff;
}
.public-nav img { width: 132px; max-height: 44px; object-fit: contain; }
.public-nav > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .26);
  color: rgba(255, 255, 255, .88);
}
.public-nav > span i { color: var(--brand-accent); }

.signup-experience {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: stretch;
}

.prize-visual {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 60px);
  color: #fff;
  background-size: cover;
  background-position: center;
  background-color: var(--brand-primary);
  background-image:
    radial-gradient(circle at 82% 18%, rgba(203, 167, 83, .24), transparent 30%),
    linear-gradient(135deg, #0a251f 0%, var(--brand-primary) 58%, #0f3128 100%);
}
.prize-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 32, 26, .28) 0%, rgba(9, 32, 26, .82) 100%);
}
.prize-copy { position: relative; z-index: 1; display: grid; gap: 14px; max-width: 34ch; }
.prize-copy > p { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--brand-accent); }
.prize-copy h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.16; font-weight: 700; }
.prize-chip {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding: 15px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px);
}
.prize-chip i { color: var(--brand-accent); font-size: 19px; }
.prize-chip b { font-size: 16px; }
.prize-chip small { font-size: 12.5px; color: rgba(255, 255, 255, .74); }

.signup-panel {
  background: var(--surface);
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  align-content: center;
}

.signup-heading { display: grid; gap: 6px; margin-bottom: 22px; }
.signup-heading h2 { font-size: clamp(22px, 3vw, 28px); }
.signup-heading > span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ Formulário - */

.dynamic-entry-form { display: grid; gap: 15px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 15px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.55;
  border: 1px solid #f0cbc8;
}

.dynamic-field { display: grid; gap: 6px; }
.dynamic-field > .field-label { font-size: 13px; font-weight: 600; display: flex; align-items: baseline; gap: 7px; }
.dynamic-field > .field-label em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); }
.dynamic-field input,
.dynamic-field select,
.dynamic-field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.dynamic-field input:focus,
.dynamic-field select:focus,
.dynamic-field textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(22, 60, 49, .11);
}
.dynamic-field textarea { resize: vertical; min-height: 86px; line-height: 1.55; }
.dynamic-field.has-error input,
.dynamic-field.has-error select,
.dynamic-field.has-error textarea,
.dynamic-field.client-error input,
.dynamic-field.client-error select,
.dynamic-field.client-error textarea { border-color: var(--danger); }
.dynamic-field > small,
.client-error-message { color: var(--danger); font-size: 12px; }

.field-control { position: relative; display: block; }
.field-control i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field-control:has(i) input { padding-left: 38px; }

.instagram-helper {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 12.5px;
}
.instagram-helper:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.minimal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  font-size: 13px;
  line-height: 1.6;
}
.minimal-consent input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; accent-color: var(--brand-primary); }
.minimal-consent a { color: var(--brand-primary); font-weight: 600; }
.minimal-consent.has-error, .minimal-consent.client-error { border-color: var(--danger); background: var(--danger-soft); }

.minimal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(15, 42, 34, .2);
  transition: transform .14s ease, box-shadow .18s ease, filter .16s ease;
}
.minimal-submit:hover { filter: brightness(1.1); box-shadow: 0 14px 32px rgba(15, 42, 34, .26); }
.minimal-submit:active { transform: translateY(1px); }
.minimal-submit[disabled] { opacity: .68; cursor: progress; }

.privacy-note { display: flex; align-items: center; gap: 7px; justify-content: center; font-size: 11.5px; color: var(--muted); }
.privacy-note i { color: var(--brand-primary); }

.cf-turnstile { display: flex; justify-content: center; }

/* Aviso exigido pelos termos do reCAPTCHA quando o selo flutuante é ocultado. */
.captcha-note { display: block; text-align: center; font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.captcha-note a { color: var(--muted); }
.captcha-note a:hover { color: var(--brand-primary); }

/* O selo flutuante do reCAPTCHA cobriria o botão de envio no celular. */
.grecaptcha-badge { visibility: hidden; }

/* --------------------------------------------------------- Confirmação - */

.minimal-success, .minimal-state { display: grid; gap: 14px; justify-items: center; text-align: center; }
.minimal-success h2, .minimal-state h2 { font-size: clamp(23px, 3vw, 29px); }
.minimal-success > p, .minimal-state > p { color: var(--muted); font-size: 14.5px; line-height: 1.7; max-width: 44ch; }
.minimal-state > i { font-size: 38px; color: var(--brand-accent); }

.success-check { width: 88px; height: 88px; }
.success-check svg { width: 100%; height: 100%; }
.success-check circle,
.success-check path {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-check circle { stroke: var(--brand-accent); stroke-dasharray: 283; stroke-dashoffset: 283; animation: draw-circle .7s ease forwards; }
.success-check path { stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw-check .4s .55s ease forwards; }
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.lucky-number {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--brand-primary);
  color: #fff;
}
.lucky-number small { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--brand-accent); font-weight: 700; }
.lucky-number strong {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(21px, 3.4vw, 28px);
  letter-spacing: .07em;
  word-break: break-all;
}
.lucky-number span { font-size: 12px; color: rgba(255, 255, 255, .68); }

.minimal-download {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.minimal-download:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* ------------------------------------------------------------- Rodapé - */

.minimal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px clamp(20px, 5vw, 56px);
  background: var(--brand-primary);
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
}
.minimal-footer span { display: flex; gap: 18px; flex-wrap: wrap; }
.minimal-footer a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.minimal-footer a:hover { color: #fff; text-decoration: underline; }

/* ------------------------------------------------------- Documentos legais - */

.legal-page { background: var(--cream); padding: clamp(24px, 5vw, 60px) 20px; }
.legal-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 52px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.back-link { justify-self: start; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--brand-primary); }
.legal-logo { width: 148px; max-height: 52px; object-fit: contain; }
.eyebrow.dark { color: var(--muted); }
.legal-shell h1 { font-size: clamp(23px, 3vw, 30px); }
.legal-shell article { font-size: 14.5px; line-height: 1.8; color: #2c4139; }
.legal-date { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

/* ------------------------------------------------------------ Animações - */

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }

.prize-copy > p { animation: fade-up .5s .05s ease-out both; }
.prize-copy h1 { animation: fade-up .6s .12s cubic-bezier(.2, .8, .3, 1) both; }
.prize-chip { animation: fade-up .6s .24s cubic-bezier(.2, .8, .3, 1) both; }
.signup-heading { animation: fade-up .5s .1s ease-out both; }

/* Os campos aparecem em cascata, guiando o olhar de cima para baixo. */
.dynamic-entry-form > * { animation: fade-up .44s ease-out both; }
.dynamic-entry-form > *:nth-child(2) { animation-delay: .06s; }
.dynamic-entry-form > *:nth-child(3) { animation-delay: .1s; }
.dynamic-entry-form > *:nth-child(4) { animation-delay: .14s; }
.dynamic-entry-form > *:nth-child(5) { animation-delay: .18s; }
.dynamic-entry-form > *:nth-child(6) { animation-delay: .22s; }
.dynamic-entry-form > *:nth-child(n+7) { animation-delay: .26s; }

.dynamic-field input,
.dynamic-field select,
.dynamic-field textarea { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.dynamic-field input:focus,
.dynamic-field textarea:focus { transform: translateY(-1px); }

/* O aviso de erro chacoalha uma vez, o suficiente para ser notado. */
.dynamic-field.client-error input,
.dynamic-field.client-error select,
.dynamic-field.client-error textarea,
.minimal-consent.client-error { animation: nudge .32s ease; }
@keyframes nudge {
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

.client-error-message, .form-alert { animation: fade-up .26s ease-out both; }

.minimal-submit i { transition: transform .2s ease; }
.minimal-submit:hover i { transform: translateX(4px); }

.minimal-success > * { animation: fade-up .5s ease-out both; }
.minimal-success > *:nth-child(2) { animation-delay: .12s; }
.minimal-success > *:nth-child(3) { animation-delay: .2s; }
.minimal-success > *:nth-child(4) { animation-delay: .28s; }
.minimal-success > *:nth-child(5) { animation-delay: .36s; }
.minimal-success > *:nth-child(6) { animation-delay: .44s; }

.lucky-number { position: relative; overflow: hidden; }
/* Brilho que percorre o número da sorte uma única vez. */
.lucky-number::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .22) 50%, transparent 62%);
  transform: translateX(-100%);
  animation: sheen 1.5s .7s ease-out;
}
@keyframes sheen { to { transform: translateX(100%); } }

.minimal-state > i { animation: fade-up .5s ease-out both; }

/* ------------------------------------------------------------ Responsivo - */

@media (max-width: 940px) {
  .signup-experience { grid-template-columns: minmax(0, 1fr); }
  .prize-visual { min-height: 320px; }
}

@media (max-width: 560px) {
  .public-nav { justify-content: center; text-align: center; }
  .minimal-footer { justify-content: center; text-align: center; }
  .minimal-footer span { justify-content: center; }
}

/* Quem pediu menos movimento no sistema recebe a página estática. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
