/* ===========================================================================
   Alquimia Cocktail Academy — Landing de captura
   Identidad: editorial / botánico / apothecary. HTML+CSS plano, sin frameworks.
   =========================================================================== */

:root {
  /* Paleta (contexto maestro) */
  --bg:        #F3EFE8;  /* crema/mármol */
  --surface:   #FBF9F4;  /* superficie un punto más clara (mockup, inputs) */
  --ink:       #211E1A;  /* texto tinta */
  --muted:     #5C5448;  /* texto secundario (6.5:1 sobre --bg) */
  --border:    #DED7CB;  /* bordes */
  --campari:   #B23A2E;  /* acento — SOLO detalle clave (5.2:1 sobre --bg) */
  --campari-d: #8E2D24;  /* acento oscuro para hover/active */

  /* Tipografía */
  --serif: "Libre Caslon Display", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Radios y sombra */
  --r-sm: 6px;
  --r-md: 10px;
  --shadow-card:
    0 1px 2px rgba(33,30,26,.05),
    0 30px 60px -28px rgba(33,30,26,.30);

  /* Curva de salida (ease-out-expo) */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset esencial -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Foco visible accesible en todo elemento interactivo */
:focus-visible {
  outline: 2px solid var(--campari);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- Estructura general ---------------------------------------------------- */
.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas:
    "brand art"
    "copy  art"
    "form  art";
  column-gap: clamp(2.5rem, 6vw, 6rem);
  row-gap: clamp(0.9rem, 1.4vw, 1.15rem);
}

/* --- Marca ----------------------------------------------------------------- */
.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.3;
}
.brand__name span {
  display: block;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.22em;
  font-size: 0.6875rem;
}

/* --- Copy (titular + lead) ------------------------------------------------- */
.copy { grid-area: copy; }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.05rem, 1.3rem + 2.7vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 0.9rem;
}
h1 .accent { color: var(--campari); }

.lead {
  color: var(--muted);
  font-size: clamp(1.02rem, 1rem + 0.3vw, 1.14rem);
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 46ch;
  margin: 0;
}
.lead em {
  font-style: italic;
  color: var(--ink);
}

/* --- Formulario ------------------------------------------------------------ */
.form-card { grid-area: form; max-width: 30rem; }

.signup { display: grid; gap: 0.7rem; }

.field { display: grid; gap: 0.35rem; }
.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field label .opt { color: var(--muted); font-weight: 400; }

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input::placeholder { color: #6E665A; } /* 5.3:1 sobre --surface */
.field input:focus {
  outline: none;
  border-color: var(--campari);
  box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.16);
}

/* Consentimiento GDPR */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  margin-top: 0.15rem;
}
.consent input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--campari);
  flex: none;
}
.consent label {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
.consent a { color: var(--ink); text-underline-offset: 2px; }
.consent a:hover { color: var(--campari); }

/* Botón */
.btn {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.95rem 1.4rem;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--campari);
  color: var(--surface);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease),
              box-shadow 0.18s var(--ease);
  box-shadow: 0 8px 18px -10px rgba(178, 58, 46, 0.6);
}
.btn:hover { background: var(--campari-d); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.05em; height: 1.05em; }
/* El botón también funciona como enlace de descarga en el estado de éxito */
a.btn { text-decoration: none; }
.btn--download { margin-top: 0.6rem; }

/* Honeypot anti-spam (Brevo): fuera de pantalla, no enfocable, invisible a personas */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.microcopy {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Prueba social */
.proof {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--muted);
}
.proof strong { color: var(--ink); font-weight: 600; }
.proof .handle { display: block; margin-top: 0.15rem; font-size: 0.8125rem; }

/* Estado de éxito */
.success {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.success h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.success h2 svg { width: 1.35rem; height: 1.35rem; color: var(--campari); flex: none; }
/* Recibe foco por accesibilidad (se anuncia vía aria-live); no es un control,
   así que evitamos el aro de foco alrededor de toda la tarjeta. */
.success:focus, .success:focus-visible { outline: none; }
.success p { margin: 0; color: var(--muted); font-size: 0.95rem; }
[hidden] { display: none !important; }

/* --- Mockup del PDF (imagen propia, SVG) ----------------------------------- */
.visual {
  grid-area: art;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 420px;
}
.mockup {
  margin: 0;
  position: relative;
  aspect-ratio: 1 / 1.32;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: clamp(1.4rem, 3.5%, 2.2rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-align: center;
  overflow: hidden;
}
/* marco interior fino, detalle editorial */
.mockup::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  pointer-events: none;
}
.mockup__tag {
  position: relative;
  z-index: 1;
  justify-self: center;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--campari);
  border: 1px solid currentColor;
  border-radius: 100px;
  padding: 0.3rem 0.7rem;
}
.mockup__head { position: relative; z-index: 1; margin-top: 1.1rem; }
.mockup__title {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-size: clamp(1.15rem, 1rem + 1.1vw, 1.55rem);
  margin: 0;
}
.mockup__sub {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.mockup__tree {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 78%;
  margin: 0.4rem auto;
  color: var(--ink);
}
.mockup__foot {
  position: relative;
  z-index: 1;
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.mockup__foot b { color: var(--ink); font-weight: 600; }

/* Trazos del árbol */
.tree-branch {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.75;
}
.tree-node {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.tree-node--root { fill: var(--campari); stroke: var(--campari); }

/* ===========================================================================
   Responsive — móvil (≤ 780px): una columna, CTA accesible arriba
   =========================================================================== */
@media (max-width: 780px) {
  .wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "copy"
      "art"
      "form";
    align-content: start;
    padding-block: clamp(2rem, 8vw, 3rem);
    row-gap: 1.6rem;
  }
  .copy, .form-card { max-width: 100%; }

  /* La portada crece a su contenido (sin aspect-ratio fijo que lo recorte) */
  .visual { max-width: 270px; justify-self: center; }
  .mockup { aspect-ratio: auto; padding: 1.6rem 1.4rem 1.4rem; }
  .mockup__title { font-size: 1.25rem; }
  .mockup__tree { width: 62%; margin: 0.2rem auto; }

  h1 { margin-bottom: 0.9rem; }
}

/* Pantallas muy estrechas (≤ 360px): aire justo */
@media (max-width: 360px) {
  .visual { max-width: 240px; }
}

/* ===========================================================================
   Motion — entrada sutil. Solo si el usuario no pide reducirla.
   El contenido es visible por defecto; la animación solo lo realza.
   =========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .brand, .copy, .form-card, .visual { animation: rise 0.8s var(--ease) both; }
  .brand     { animation-delay: 0.02s; }
  .copy      { animation-delay: 0.10s; }
  .visual    { animation-delay: 0.16s; }
  .form-card { animation-delay: 0.24s; }

  /* Los cócteles "brotan" en el árbol */
  .tree-node { animation: node-in 0.5s var(--ease) both; }
  .tree-node:nth-of-type(1) { animation-delay: 0.45s; }
  .tree-node:nth-of-type(2) { animation-delay: 0.53s; }
  .tree-node:nth-of-type(3) { animation-delay: 0.61s; }
  .tree-node:nth-of-type(4) { animation-delay: 0.69s; }
  .tree-node:nth-of-type(5) { animation-delay: 0.77s; }
  .tree-node:nth-of-type(6) { animation-delay: 0.85s; }
  .tree-node--root          { animation-delay: 0.95s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes node-in {
    from { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: center; }
    to   { opacity: 1; transform: none; }
  }
}
