/* Leilah C Porttela · página do checklist "A feira começa antes da feira"
   Mobile first. Desktop (duas colunas, um ecrã) a partir de 1024px. */

:root {
  --carmim: #8A0A30;
  --noir-carmim: #4A0818;
  --lady: #A50D3B;
  --perola: #F7EFE9;
  --perola-2: #F1E3D9;
  --noir: #1D1A1B;
  --texto: #3A2A2D;
  --pessego: #DE8A62;
  --manteiga: #EFD7A4;
  --dourado: #C9965F;
  --linha: rgba(138, 10, 48, 0.28);
  --campo: #FFF9F5;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--perola);
  color: var(--texto);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
em { font-style: italic; color: var(--carmim); }

.page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ---------- Fundo: sol de fim de tarde + linhas de horizonte ---------- */
.bg { position: absolute; inset: 0; pointer-events: none; }
.bg__sun {
  position: absolute;
  width: 900px; height: 900px;
  right: -380px; top: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(239, 215, 164, 0.85) 0%,
    rgba(222, 138, 98, 0.45) 38%,
    rgba(165, 13, 59, 0.10) 62%,
    rgba(247, 239, 233, 0) 72%);
}
.bg__arcs { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg__arcs path { fill: none; stroke: var(--dourado); stroke-width: 1; opacity: 0.45; }
.bg__arcs path + path { opacity: 0.25; }

/* ---------- Faixa do topo ---------- */
.ribbon {
  position: relative;
  z-index: 2;
  align-self: center;
  margin: max(14px, env(safe-area-inset-top)) 16px 0;
  padding: 11px 22px;
  border-radius: 14px;
  background: var(--carmim);
  color: var(--perola);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 10px 30px -12px rgba(74, 8, 24, 0.55);
}

/* ---------- Layout ---------- */
.layout {
  position: relative;
  z-index: 2; /* acima do rodapé, para o painel de países */
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px 24px;
}
.intro { display: contents; }
.logo { order: 1; width: 150px; height: auto; margin: 0 auto 26px; }
.eyebrow { order: 2; }
.title { order: 3; }
.lead { order: 4; }
.visual { order: 5; }
.form, .success, .thanks { order: 6; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--carmim);
  text-align: center;
  margin-bottom: 14px;
}
.eyebrow span { color: var(--dourado); margin: 0 6px; }

.title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 11vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--noir);
  text-align: center;
  text-wrap: balance;
}
.title em { font-weight: 300; }

.lead {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--texto);
  text-align: center;
  text-wrap: pretty;
}

/* ---------- Visual: retrato, páginas e tablet ---------- */
.visual {
  position: relative;
  margin: 28px auto 8px;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1.02;
}
.portrait {
  position: absolute;
  right: -14%;
  bottom: 0;
  height: 96%;
  width: auto;
  max-width: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.stack {
  position: absolute;
  left: 12%;
  bottom: 4%;
  width: 50%;
  aspect-ratio: 900 / 1273;
}
.sheet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 18px 40px -18px rgba(29, 26, 27, 0.45);
}
.sheet--1 { transform: translate(-24%, 5%) rotate(-11deg); }
.sheet--2 { transform: translate(-12%, 1%) rotate(-5deg); }
.device {
  position: absolute;
  inset: -3.5%;
  padding: 3.5%;
  border-radius: 18px;
  background: linear-gradient(145deg, #2b2628, #151213);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 30px 60px -20px rgba(29, 26, 27, 0.6),
    0 12px 24px -12px rgba(74, 8, 24, 0.5);
}
.device img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.facts {
  position: absolute;
  right: 0;
  bottom: 6%;
  display: grid;
  gap: 6px;
}
.facts li {
  padding: 7px 12px;
  border-radius: 100px;
  background: rgba(247, 239, 233, 0.9);
  border: 1px solid var(--linha);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  font-size: 12px;
  color: var(--texto);
  white-space: nowrap;
}
.facts strong { font-family: var(--serif); font-weight: 400; font-size: 16px; color: var(--carmim); margin-right: 3px; }

/* ---------- Formulário ---------- */
.form { display: grid; gap: 14px; margin-top: 20px; }
.form__row { display: grid; gap: 14px; }

.field { position: relative; display: block; }
.field__label {
  position: absolute;
  top: -8px; left: 14px;
  padding: 0 6px;
  background: linear-gradient(to bottom, transparent 50%, var(--campo) 50%);
  font-size: 12px;
  font-weight: 500;
  color: var(--carmim);
  line-height: 16px;
}
.field input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: 1px solid var(--linha);
  border-radius: 12px;
  background: var(--campo);
  font: 400 16px/1 var(--sans);
  color: var(--noir);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.field input::placeholder { color: rgba(58, 42, 45, 0.45); }
.field input:focus {
  outline: none;
  border-color: var(--carmim);
  box-shadow: 0 0 0 4px rgba(138, 10, 48, 0.12);
}
.field input[aria-invalid="true"] { border-color: var(--lady); }

/* WhatsApp: indicativo + número */
.ddi { z-index: 5; }
.phone {
  display: flex;
  height: 54px;
  border: 1px solid var(--linha);
  border-radius: 12px;
  background: var(--campo);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.phone:focus-within { border-color: var(--carmim); box-shadow: 0 0 0 4px rgba(138, 10, 48, 0.12); }
.phone:has([aria-invalid="true"]) { border-color: var(--lady); }
.ddi__btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 14px;
  border: 0;
  border-right: 1px solid var(--linha);
  border-radius: 12px 0 0 12px;
  background: transparent;
  font: 500 16px/1 var(--sans);
  color: var(--noir);
  cursor: pointer;
  transition: background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .ddi__btn:hover { background: rgba(138, 10, 48, 0.05); } }
.ddi__btn:focus-visible { outline: 2px solid var(--dourado); outline-offset: -3px; }
.ddi__flag, .ddi__option img, .ddi__iso { flex: 0 0 auto; width: 22px; height: 16px; border-radius: 3px; }
.ddi__flag { display: grid; place-items: center; }
.ddi__flag img, .ddi__option img {
  width: 22px; height: 16px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(29, 26, 27, 0.08);
}
.ddi__iso {
  display: grid; place-items: center;
  background: rgba(138, 10, 48, 0.08);
  font: 500 9px/1 var(--mono);
  color: var(--carmim);
}
.ddi__chevron {
  width: 12px; height: 12px;
  fill: none; stroke: var(--carmim); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.ddi.is-open .ddi__chevron { transform: rotate(180deg); }

/* Painel: dropdown no computador, folha inferior no telemóvel */
.ddi__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  max-height: 340px;
  border: 1px solid var(--linha);
  border-radius: 14px;
  background: #FFFBF8;
  box-shadow: 0 24px 50px -20px rgba(74, 8, 24, 0.45), 0 6px 16px -8px rgba(29, 26, 27, 0.18);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 160ms ease, transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.ddi--up .ddi__panel { top: auto; bottom: calc(100% + 8px); transform-origin: bottom center; transform: translateY(6px) scale(0.98); }
.ddi.is-open .ddi__panel { opacity: 1; transform: none; }
.ddi__panel[hidden], .ddi__backdrop[hidden] { display: none; }

.ddi__head { display: none; }
.ddi__search {
  position: relative;
  flex: 0 0 auto;
  padding: 10px;
  border-bottom: 1px solid rgba(138, 10, 48, 0.12);
}
.ddi__search svg {
  position: absolute; left: 22px; top: 50%;
  width: 17px; height: 17px;
  transform: translateY(-50%);
  fill: none; stroke: var(--carmim); stroke-width: 1.7; stroke-linecap: round;
  opacity: 0.7;
}
.ddi .ddi__search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--perola);
  font: 400 15px/1 var(--sans);
  color: var(--noir);
}
.ddi .ddi__search input:focus { outline: none; border-color: var(--linha); box-shadow: none; background: #fff; }

.ddi__list {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 10, 48, 0.25) transparent;
}
.ddi__group {
  padding: 12px 10px 6px;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dourado);
}
.ddi__group:first-child { padding-top: 6px; }
.ddi__option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  color: var(--noir);
}
.ddi__option.is-active { background: var(--perola-2); }
.ddi__option[aria-selected="true"] { background: rgba(138, 10, 48, 0.08); color: var(--carmim); font-weight: 500; }
.ddi__option[aria-selected="true"] .ddi__dial::after { content: "✓"; margin-left: 8px; color: var(--carmim); }
.ddi__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddi__dial { font: 400 13px/1 var(--mono); color: rgba(58, 42, 45, 0.6); }
.ddi__empty { padding: 20px 12px; font-size: 14px; color: rgba(58, 42, 45, 0.6); text-align: center; }

@media (max-width: 639px) {
  .ddi__backdrop {
    position: fixed; inset: 0; z-index: 29;
    background: rgba(29, 26, 27, 0.4);
    opacity: 0;
    transition: opacity 200ms ease;
  }
  .ddi.is-open .ddi__backdrop { opacity: 1; }
  .ddi__panel, .ddi--up .ddi__panel {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    max-height: min(78vh, 620px);
    border: 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), opacity 1ms;
    opacity: 1;
  }
  .ddi.is-open .ddi__panel { transform: none; }
  .ddi__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px 4px 20px;
    font-family: var(--serif);
    font-size: 20px;
    color: var(--noir);
  }
  .ddi__head::before {
    content: "";
    position: absolute; top: 8px; left: 50%;
    width: 36px; height: 4px;
    border-radius: 4px;
    background: rgba(29, 26, 27, 0.15);
    transform: translateX(-50%);
  }
  .ddi__close {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: transparent;
    cursor: pointer;
  }
  .ddi__close svg { width: 20px; height: 20px; fill: none; stroke: var(--noir); stroke-width: 1.6; stroke-linecap: round; }
  .ddi__search { padding: 10px 14px; }
  .ddi__search svg { left: 26px; }
  .ddi .ddi__search input { font-size: 16px; }
  .ddi__option { min-height: 48px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ddi__panel, .ddi--up .ddi__panel { transition: none; }
}

.field .phone input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: transparent;
  box-shadow: none;
}
.field .phone input:focus { box-shadow: none; }

/* Armadilha para bots, fora do ecrã */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__error { font-size: 14px; color: var(--lady); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--carmim);
  color: var(--perola);
  font: 600 16px/1 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 30px -14px rgba(138, 10, 48, 0.7);
  transition: background-color 180ms ease, transform 160ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn__icon { width: 20px; height: 20px; fill: none; stroke: var(--manteiga); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
@media (hover: hover) {
  .btn:hover { background: var(--lady); }
  .btn:hover .btn__icon { transform: translateX(3px); }
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--dourado); outline-offset: 3px; }
.btn[aria-busy="true"] { opacity: 0.75; pointer-events: none; }

.legal { font-size: 12px; line-height: 1.5; color: rgba(58, 42, 45, 0.7); text-align: center; }
.legal a { color: var(--carmim); }

/* ---------- Estado de sucesso ---------- */
.success { display: grid; gap: 16px; margin-top: 20px; text-align: center; outline: none; }
.success[hidden] { display: none; }
.success .eyebrow, .success .lead { margin: 0; }
.success__title { font-family: var(--serif); font-weight: 300; font-size: 34px; line-height: 1.05; color: var(--noir); }
.link {
  justify-self: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--carmim);
  text-underline-offset: 4px;
}

/* ---------- Página de obrigado ---------- */
.title--obrigado { font-size: clamp(38px, 10vw, 54px); }
.page--obrigado .visual { order: 7; margin-top: 36px; }
.thanks { display: grid; gap: 22px; margin-top: 8px; }
.steps, .next {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--linha);
  background: rgba(255, 249, 245, 0.78);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.steps__title, .next__eyebrow, .social p {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--carmim);
}
.steps ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: baseline; }
.steps li span { font-family: var(--serif); font-size: 20px; color: var(--dourado); }
.steps li p { font-size: 15px; line-height: 1.5; }
.steps strong { font-weight: 600; color: var(--noir); }
.next { background: var(--noir-carmim); border-color: transparent; color: var(--perola); display: grid; gap: 12px; }
.next__eyebrow { color: var(--manteiga); }
.next__text { font-family: var(--serif); font-size: 19px; line-height: 1.35; font-weight: 300; }
.btn--ghost {
  height: 52px;
  background: transparent;
  border: 1px solid rgba(239, 215, 164, 0.55);
  box-shadow: none;
}
@media (hover: hover) { .btn--ghost:hover { background: rgba(239, 215, 164, 0.12); } }
.social { display: flex; align-items: center; justify-content: center; gap: 16px; }
.social ul { display: flex; gap: 10px; }
.social a {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--linha);
  color: var(--carmim);
  transition: background-color 160ms ease, color 160ms ease;
}
.social svg { width: 16px; height: 16px; fill: currentColor; }
@media (hover: hover) { .social a:hover { background: var(--carmim); color: var(--perola); } }

/* ---------- Rodapé ---------- */
.footer {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 8px 16px max(18px, env(safe-area-inset-bottom));
  font-size: 12px;
  color: rgba(58, 42, 45, 0.6);
  text-align: center;
}
.footer__line {
  width: 180px; height: 1px;
  background: linear-gradient(to right, transparent, var(--dourado), transparent);
  position: relative;
}
.footer__line::after {
  content: "✦";
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -52%);
  padding: 0 8px;
  background: var(--perola);
  color: var(--dourado);
  font-size: 11px;
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .layout { max-width: 600px; padding-top: 36px; }
  .visual { max-width: 520px; }
  .form__row { grid-template-columns: 1fr 1fr; }
  .ribbon { font-size: 14px; padding: 12px 28px; }
}

/* ---------- Desktop: duas colunas num ecrã ---------- */
@media (min-width: 1024px) {
  .page { height: 100vh; min-height: 680px; }
  .ribbon { margin-top: 18px; }
  .bg__sun { width: 1200px; height: 1200px; right: -420px; top: -80px; }

  .layout {
    max-width: 1280px;
    display: grid;
    grid-template-columns: minmax(420px, 500px) 1fr;
    align-items: center;
    column-gap: clamp(32px, 5vw, 80px);
    padding: 12px 48px 8px;
    min-height: 0;
  }
  .intro { display: block; }
  .logo { width: 150px; margin: 0 0 22px; }
  .eyebrow, .title, .lead, .legal, .success { text-align: left; }
  .title { font-size: clamp(48px, 4.6vw, 66px); }
  .lead { font-size: 17px; max-width: 460px; }
  .form { margin-top: 28px; }
  .success { justify-items: start; margin-top: 28px; }
  .link { justify-self: start; }

  .visual {
    align-self: stretch;
    max-width: none;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
  }
  .portrait { right: -6%; bottom: 0; height: 96%; }
  .stack { left: 6%; bottom: 10%; width: auto; height: 68%; }
  .facts { right: 6%; bottom: 12%; }
  .facts li { font-size: 13px; padding: 8px 14px; }

  .footer { padding-top: 0; }

  .page--obrigado { height: auto; min-height: 100vh; }
  .page--obrigado .layout { align-items: start; padding-top: 40px; padding-bottom: 32px; }
  .page--obrigado .visual { position: sticky; top: 0; height: min(100vh, 860px); align-self: start; }
  .page--obrigado .stack { height: 62%; bottom: 14%; }
  .title--obrigado { font-size: clamp(44px, 4vw, 58px); }
  .social { justify-content: flex-start; }
}

@media (min-width: 1024px) and (max-height: 760px) {
  .logo { width: 120px; margin-bottom: 14px; }
  .title { font-size: 50px; }
  .lead { font-size: 16px; margin-top: 12px; }
  .form { margin-top: 20px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
