/* ===== STEP 1 — LANDING (redesign: hero em grid + card CNPJ + galeria + passos) =====
   Compartilhado por principal.html e revendedor.html. O card branco do CNPJ
   mantém os IDs/estrutura que o common.js usa (cnpjInput, cnpjBtn, cnpjError,
   spinner, .btn-text); no revendedor entra o campo extra .rev-field. */

/* --- Hero vinho com textura de linhas + glow dourado --- */
.landing-hero {
  position: relative;
  overflow: hidden;
  color: #f6efe2;
  background-color: var(--wine);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 56px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 56px),
    radial-gradient(120% 90% at 50% 18%, var(--wine-3) 0%, var(--wine-2) 40%, var(--wine-1) 100%);
}

.landing-hero::before {
  content: '';
  position: absolute;
  right: -180px;
  top: -140px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 179, 102, 0.13) 0%, rgba(216, 179, 102, 0) 64%);
  pointer-events: none;
}

/* --- Topbar da landing (o header global some via body:has(#step1.active)) --- */
.landing-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px;
}

.landing-topbar__logo {
  height: 25px;
  width: auto;
}

/* --- Grid do hero: copy à esquerda, card branco à direita --- */
.hero-pad {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 452px;
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.06;
  margin: 0;
  color: #f6efe2;
}

.hero-title .accent {
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 20px 0 0;
  font-size: clamp(17px, 1.7vw, 20px);
  color: rgba(246, 239, 226, 0.78);
  font-weight: 400;
  max-width: 40ch;
  text-wrap: pretty;
}

/* Destaque dourado dentro do subtítulo. */
.hero-sub__gold {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.28em;
  color: var(--gold-2);
}

/* --- Card branco do CNPJ (consulta real: spinner, erros e toasts do common.js) --- */
.cnpj-block {
  width: 100%;
  max-width: 452px;
  justify-self: end;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 60px -24px rgba(20, 4, 6, 0.55), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  color: var(--ink);
}

.cnpj-block label {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 12px;
  color: var(--ink);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cnpj-block .input-group input,
.cnpj-block .rev-field input {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--card-border-strong);
  border-radius: 12px;
  font-size: 18px;
  color: var(--ink);
  background: #fdfaf3;
  letter-spacing: 0.3px;
  outline: none;
  transition: border-color 200ms;
}

.cnpj-block .input-group input:focus,
.cnpj-block .rev-field input:focus {
  border-color: var(--cta);
}

.cnpj-block .input-group input.error {
  border-color: var(--cta);
}

.cnpj-block__note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.cnpj-block__note svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.cnpj-block .cnpj-block__submit {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  letter-spacing: 0.2px;
}

/* --- 3 features abaixo do grid, ainda no vinho --- */
.hero-features {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(216, 179, 102, 0.22);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 32px;
}

.hero-feature {
  border-left: 2px solid var(--cta);
  padding-left: 16px;
}

.hero-feature__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.hero-feature__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(216, 179, 102, 0.55);
  background: rgba(216, 179, 102, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.hero-feature__icon svg {
  width: 15px;
  height: 15px;
}

.hero-feature__title {
  font-weight: 700;
  font-size: 15.5px;
  color: #f6efe2;
}

.hero-feature p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(246, 239, 226, 0.66);
  text-wrap: pretty;
}

/* --- Seção NA PRÁTICA (fundo #ece1cb) com galeria copa1–8 --- */
.landing-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.pratica {
  background: var(--bg-alt);
  border-top: 1px solid #e0d4ba;
  border-bottom: 1px solid #e0d4ba;
}

.pratica__head {
  max-width: 1140px;
  margin: 0 auto;
  padding: 64px 20px 0;
}

.pratica__head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.1;
  margin: 12px 0 0;
  color: var(--ink);
}

.pratica__gal {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.pratica__gal img {
  flex: 1 1 0;
  min-width: 120px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  position: relative;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.pratica__gal img:hover {
  transform: scale(1.04);
  z-index: 3;
  box-shadow: 0 4px 12px rgba(30, 18, 8, 0.18);
}

/* --- Lightbox da galeria (montado por js/lightbox.js) --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 15, 10, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}

.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox__close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Setas de navegação entre as imagens (montadas por js/lightbox.js) */
.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

@media (max-width: 767px) {
  .lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .lightbox__nav--prev {
    left: 8px;
  }

  .lightbox__nav--next {
    right: 8px;
  }
}

/* --- COMO FUNCIONA — 4 passos --- */
.landing-how {
  background: var(--bg);
  padding: 64px 0;
}

.landing-how__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.landing-how h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.1;
  margin: 12px 0 0;
  color: var(--ink);
}

.how-divider {
  border-top: 1px solid #ddd0b8;
  margin: 32px 0;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 32px;
}

.how-step {
  border-left: 1px solid #ddd0b8;
  padding-left: 24px;
}

.how-step:first-child {
  border-left: none;
  padding-left: 0;
}

.how-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--cta);
}

.how-step h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
  margin: 12px 0;
  color: var(--ink);
}

.how-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- Responsivo (breakpoints do redesign: 1080 galeria, 920 hero, 520 celular) --- */
@media (max-width: 1080px) {
  .pratica__gal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible;
  }

  .pratica__gal img {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .cnpj-block {
    justify-self: center;
  }

  .hero-features {
    grid-template-columns: 1fr;
    gap: 16px 0;
  }

  .how-steps {
    grid-template-columns: 1fr 1fr;
    row-gap: 32px;
  }

  .how-step {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 520px) {
  .landing-topbar {
    justify-content: center;
    padding: 16px 20px 4px;
  }

  .landing-topbar__logo {
    height: 18px;
  }

  .hero-pad {
    padding: 16px 20px 48px;
  }

  .hero-title {
    font-size: 27px;
    line-height: 1.14;
  }

  .hero-sub {
    font-size: 16px;
    margin-top: 16px;
  }

  .cnpj-block {
    padding: 20px;
    border-radius: 18px;
  }

  .cnpj-block .input-group input,
  .cnpj-block .rev-field input {
    padding: 13px 16px;
    font-size: 16px;
  }

  .pratica__head {
    padding: 48px 20px 0;
  }

  .pratica__gal {
    padding: 24px 20px 48px;
  }

  .pratica__gal img {
    height: 110px;
  }

  .landing-how {
    padding: 48px 0;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

  .how-step {
    border-top: 1px solid #ddd0b8;
    padding-top: 22px;
  }

  .how-step:first-child {
    border-top: none;
    padding-top: 0;
  }
}