/* =========================================================
   Aulão Gratuito — Altis Lisboa — V4
   Fonte de verdade visual: Referencia/referencia-desktop.png
   e Referencia/referencia-mobile.png
   ========================================================= */

@font-face {
  font-family: 'Rizoma';
  src: url('fonts/RizomaM-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paleta extraída por amostragem de pixels das referências */
  --hero-dark-1: #0d2318;   /* verde escuro topo do hero */
  --hero-dark-2: #04140c;   /* verde quase preto, cantos/profundidade */
  --form-card-bg: #0e2a1e;  /* verde do card de formulário (levemente mais claro que o hero) */
  --footer-bg: #04140c;

  --gold: #c9a052;
  --gold-strong: #d8ae5e;
  --gold-dark: #a9803c;

  --cream: #f2efe6;
  --cream-card: #f7f4ec;
  --input-bg: #f6f3ee;

  --text-dark: #1c2b22;
  --text-muted-dark: #5c6b61;
  --text-cream: #f5f2ea;
  --text-muted-light: rgba(245, 242, 234, 0.68);

  --shadow-card: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  --radius-lg: 28px;
  --radius-md: 14px;
  --radius-full: 999px;

  --font-display: 'Rizoma', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --container-width: 1440px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p, blockquote { margin: 0; }
button { font-family: inherit; }
svg { flex-shrink: 0; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

.text-gold { color: var(--gold-strong); }
strong.text-gold { font-weight: 700; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  background: radial-gradient(120% 140% at 8% 0%, var(--hero-dark-1) 0%, var(--hero-dark-2) 62%);
  overflow: hidden;
  padding-top: 44px;
  padding-bottom: 0;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(60% 50% at 78% 8%, rgba(210, 170, 100, 0.16) 0%, rgba(210, 170, 100, 0) 60%),
    linear-gradient(115deg, rgba(4, 20, 12, 0.94) 0%, rgba(4, 20, 12, 0.55) 42%, rgba(4, 20, 12, 0.15) 62%, rgba(4, 20, 12, 0) 78%);
  pointer-events: none;
}

.hero__photo {
  position: absolute;
  z-index: 0;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo--desktop {
  /* Posicionamento real acontece em @media (min-width: 1025px), onde a foto
     vira um background full-bleed atrás de todo o .hero — ver bloco
     desktop mais abaixo. */
  display: none;
}

.hero__photo--mobile {
  top: 0;
  left: 0;
  width: 100%;
  height: 580px;
  display: block;
}
.hero__photo--mobile img {
  object-position: 50% 12%;
}
.hero__photo--mobile::after {
  content: '';
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: block;
  padding-bottom: 48px;
}

.hero__content {
  max-width: 640px;
  padding-top: 8px;
}

.hero__logo {
  width: 260px;
  height: auto;
  margin-bottom: 28px;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-cream);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.hero__paragraph {
  margin-top: 22px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-muted-light);
  max-width: 560px;
}

.hero__divider {
  width: 68px;
  height: 3px;
  background: var(--gold);
  margin: 26px 0 24px;
  border-radius: var(--radius-full);
}

/* ---------- info bar (data / hora / formato) ---------- */
.info-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(201, 160, 82, 0.45);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.info-bar::-webkit-scrollbar {
  display: none;
}

.info-bar__item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-bar__icon {
  width: 24px;
  height: 24px;
  color: var(--gold);
  flex-shrink: 0;
}

.info-bar__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  white-space: nowrap;
}
.info-bar__text strong {
  color: var(--text-cream);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.info-bar__text span {
  color: var(--text-muted-light);
  font-size: 0.82rem;
}

.info-bar__divider {
  width: 1px;
  height: 30px;
  background: rgba(201, 160, 82, 0.35);
}

/* ---------- CTA mobile (abre o form-card em pop-up) + backdrop ---------- */
/* O CTA só existe/aparece no mobile — ver @media (max-width: 1025px) abaixo.
   No desktop o form-card já é exibido inline, então ele não é usado lá.
   O backdrop, porém, é compartilhado: também aparece no desktop quando o
   pop-up de "obrigado" (.form-card.is-success) é exibido — ver mais abaixo. */
.btn-cta.btn-cta--mobile-open {
  display: none;
}

.modal-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 20, 12, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
}

/* Pop-up de "obrigado" pós-inscrição: vira modal centralizado em qualquer
   largura de tela (diferente do .is-open do mobile, que só vira modal
   abaixo de 1025px — no desktop o form normal fica inline). Nesse momento
   a promessa/subpromessa do hero ficam escondidas (ver .thankyou-active). */
.form-card.is-success {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  margin: 0;
  transform: translate(-50%, -50%);
  /* Independente do .is-open (mobile): se o estado de sucesso está ativo,
     o pop-up tem que estar visível sempre, em qualquer largura de tela. */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.form-card.is-success .form-card__close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(245, 242, 234, 0.1);
  color: var(--text-cream);
  cursor: pointer;
}
.form-card.is-success .form-card__close svg { width: 16px; height: 16px; }

body.thankyou-active .hero__headline,
body.thankyou-active .hero__paragraph {
  visibility: hidden;
}

/* =========================================================
   FORM CARD
   ========================================================= */
.form-card {
  background: var(--form-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 34px 30px;
  margin-top: 40px;
}

.form-card__close {
  display: none;
}

.form-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-cream);
  font-size: 1.7rem;
  text-align: center;
  line-height: 1.25;
}

.form-card__subtitle {
  text-align: center;
  color: var(--text-muted-light);
  font-size: 0.86rem;
  margin-top: 8px;
  margin-bottom: 22px;
}

#captureForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: var(--radius-full);
  padding: 0 16px;
  height: 52px;
}

.input-group__icon {
  width: 19px;
  height: 19px;
  color: #8a8577;
  margin-right: 10px;
  flex-shrink: 0;
}

.input-group input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--text-dark);
  min-width: 0;
  min-height: 44px;
}
.input-group input::placeholder { color: #8f8a7c; }

.btn-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gold);
  color: var(--hero-dark-2);
  border: none;
  border-radius: var(--radius-full);
  padding: 16px 20px;
  min-height: 56px;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-cta:hover { background: var(--gold-strong); transform: translateY(-1px); }
.btn-cta:active { transform: translateY(0); }
.btn-cta:focus-visible { outline: 3px solid var(--text-cream); outline-offset: 2px; }

.btn-cta__icon { width: 20px; height: 20px; }

.btn-cta__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(4, 20, 12, 0.25);
  border-top-color: var(--hero-dark-2);
  animation: spin 0.7s linear infinite;
}

.btn-cta.is-loading .btn-cta__spinner { display: inline-block; }
.btn-cta.is-loading .btn-cta__icon,
.btn-cta.is-loading .btn-cta__label { opacity: 0.55; }
.btn-cta.is-loading { cursor: wait; pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-card__disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  color: var(--text-muted-light);
  font-size: 0.78rem;
  margin-top: 14px;
}
.form-card__disclaimer svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex-shrink: 0;
}

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  color: var(--text-cream);
  padding: 8px 4px 4px;
}
.form-success[hidden] { display: none; }
.form-success svg {
  width: 44px;
  height: 44px;
  color: var(--gold-strong);
  flex-shrink: 0;
}
.form-success h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--text-cream);
  line-height: 1.25;
}
.form-success p { font-size: 0.94rem; line-height: 1.55; color: var(--text-muted-light); max-width: 340px; }
.form-success p strong { color: var(--gold-strong); font-weight: 700; }
.form-success .btn-cta {
  width: 100%;
  margin-top: 6px;
  text-decoration: none;
}

.form-card.is-success #captureForm { display: none; }
.form-card.is-success .form-card__subtitle { display: none; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--footer-bg);
  padding: 26px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer__logo {
  width: auto;
  height: 22px;
  flex-shrink: 0;
}
.footer__brand span {
  color: var(--text-muted-light);
  font-size: 0.85rem;
}

.footer__items {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted-light);
  font-size: 0.83rem;
  white-space: nowrap;
}
.footer__item svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
  flex-shrink: 0;
}

/* =========================================================
   RESPONSIVE — breakpoint principal 1024px
   ========================================================= */

/* ----- Desktop / tablet-landscape (>= 1025px) ----- */
@media (min-width: 1025px) {
  .hero__photo--mobile { display: none; }

  /* A foto agora é um background full-bleed atrás de todo o .hero (mesmo
     padrão da versão mobile), e não mais um item de grid: isso garante que
     ela cubra a seção inteira de ponta a ponta, como na referência.
     O texto e o form-card ficam posicionados nas duas pontas por cima dela,
     com a imagem visível no vão entre os dois. */
  .hero__photo--desktop {
    display: block;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 66% 22%;
  }

  .hero__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    padding-top: 20px;
    padding-bottom: 64px;
  }

  .hero__content {
    padding-top: 26px;
    flex: 0 1 640px;
  }

  .form-card {
    margin-top: 0;
    align-self: start;
    flex: 0 0 424px;
  }
}

/* ----- Mobile / tablet-portrait (<= 1024px) ----- */
/* Nota: usamos max-width:1025px (não 1024px) de propósito. Em telas com
   devicePixelRatio fracionário (ex.: 225% no Windows), o Chromium pode
   arredondar a largura efetiva do viewport para baixo ao avaliar
   min-width, fazendo min-width:1025px falhar exatamente em 1025px CSS.
   Se o breakpoint mobile fosse max-width:1024px, essa mesma largura
   cairia num vão onde NENHUMA das duas media queries bate (nem desktop
   nem mobile), quebrando o layout (card sobrepondo a foto, coluna de
   texto com largura errada). Com max-width:1025px há uma sobreposição
   segura de 1px entre as duas queries: nesse caso o mobile (que vem
   depois no arquivo) sempre vence, então o layout cai limpo para mobile
   em vez de ficar num estado híbrido quebrado. */
@media (max-width: 1025px) {
  .hero { padding-top: 24px; }

  .hero__gradient {
    background:
      radial-gradient(70% 45% at 70% 6%, rgba(210, 170, 100, 0.18) 0%, rgba(210, 170, 100, 0) 60%),
      linear-gradient(180deg, rgba(4, 20, 12, 0.35) 0%, rgba(4, 20, 12, 0.55) 38%, var(--hero-dark-2) 74%);
  }

  .hero__logo { width: 190px; margin-bottom: 16px; }

  /* Na foto mobile (bg-mobile), a modelo fica na metade direita do quadro
     e a esquerda é fundo escuro/desfocado — o texto precisa ficar restrito
     a essa faixa escura para não passar por cima dela, igual à referência.
     Com a promessa curta, sobra espaço vertical de sobra: a fonte pode
     ficar maior que a versão anterior (headline longa) sem estourar a
     primeira dobra nem invadir a foto. */
  .hero__content { max-width: 58%; }

  .hero__headline { font-size: clamp(1.7rem, 8.2vw, 2.3rem); line-height: 1.2; }

  .hero__paragraph {
    max-width: 100%;
    margin-top: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .hero__divider { margin: 18px 0; }

  .info-bar {
    width: 100%;
    justify-content: flex-start;
    gap: clamp(6px, 2.5vw, 14px);
    padding: 12px clamp(10px, 4vw, 16px);
  }
  .info-bar__item { gap: clamp(6px, 2vw, 10px); }
  .info-bar__icon {
    width: clamp(18px, 5vw, 22px);
    height: clamp(18px, 5vw, 22px);
  }
  .info-bar__text strong { font-size: clamp(0.72rem, 3.2vw, 0.86rem); }
  .info-bar__text span { font-size: clamp(0.64rem, 2.8vw, 0.76rem); }
  .info-bar__divider { height: 24px; flex-shrink: 0; }

  /* CTA fica na primeira dobra; ao clicar, abre o form-card como pop-up */
  .btn-cta.btn-cta--mobile-open {
    display: flex;
    width: 100%;
    margin-top: 22px;
  }

  .form-card {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 100;
    width: calc(100% - 32px);
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    margin-top: 0;
    padding: 40px 22px 26px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }
  .form-card.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .form-card__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(245, 242, 234, 0.1);
    color: var(--text-cream);
    cursor: pointer;
  }
  .form-card__close svg { width: 16px; height: 16px; }

  .footer__items { display: none; }
  .footer__inner { justify-content: center; }
  .footer__brand { text-align: center; }
}

@media (max-width: 640px) {
  .hero { padding-top: 20px; }
  .hero__logo { margin-bottom: 14px; }
  .hero__paragraph { margin-top: 14px; }
  .hero__divider { margin: 16px 0; }

  .info-bar { padding: 10px clamp(10px, 4vw, 14px); }

  .form-card__title { font-size: 1.4rem; }
  .btn-cta { font-size: 0.82rem; padding: 15px 12px; }
  .btn-cta__label { line-height: 1.2; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-cta, .btn-cta__spinner { animation: none !important; transition: none !important; }
}
