/* =================================================================
   MARFIL × ORION — Landing promocional
   styles.css  ·  organizado por secciones
   ================================================================= */

/* ----------------------------- TOKENS ---------------------------- */
:root {
  /* Colores */
  --azul-marfil:    #082b73;
  --azul-profundo:  #06205a;
  --azul-hero:      #0a1f4d;
  --rojo-marfil:    #ed1c24;
  --rojo-hover:     #c8141b;
  --amarillo-promo: #ffc400;
  --blanco:         #ffffff;
  --gris-claro:     #f4f5f8;
  --gris-borde:     #d4d9e3;
  --gris-texto:     #4a5168;
  --azul-btn:       #1f3a93;

  /* Radios */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Sombras */
  --sh-sm: 0 2px 8px rgba(8,43,115,.12);
  --sh-md: 0 8px 24px rgba(8,43,115,.18);
  --sh-lg: 0 14px 40px rgba(6,32,90,.28);

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 48px);

  /* Tipografía */
  --ff: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ----------------------------- RESET ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff);
  color: var(--azul-marfil);
  background: var(--blanco);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.txt-yellow { color: var(--amarillo-promo); }

/* :focus accesible global */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, label:focus-visible {
  outline: 3px solid var(--amarillo-promo);
  outline-offset: 2px;
}

/* ------------------------- BOTONES BASE -------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: none;
  font-weight: 800;
  letter-spacing: .3px;
  text-decoration: none;
  border-radius: var(--r-pill);
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn__chevron {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  font-size: 1.2rem;
  line-height: 1;
}
.btn--cta {
  background: var(--rojo-marfil);
  color: var(--blanco);
  padding: 16px 30px;
  font-size: 1.05rem;
  box-shadow: var(--sh-md);
}
.btn--cta:hover { background: var(--rojo-hover); transform: translateY(-2px); }
.btn--cta:active { transform: translateY(0); }
.btn--blue {
  background: var(--azul-btn);
  color: var(--blanco);
  padding: 12px 26px;
  font-size: .82rem;
}
.btn--blue:hover { background: var(--azul-marfil); }

/* --------------------- TÍTULOS DE SECCIÓN ------------------------ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 900;
  color: var(--azul-marfil);
  letter-spacing: .5px;
  margin: 0 0 36px;
}
.section-title--light { color: var(--blanco); }
.section-title__rule {
  display: inline-block;
  width: clamp(28px, 7vw, 90px);
  height: 4px;
  border-radius: 4px;
  background: var(--rojo-marfil);
}
.section-title__rule--yellow { background: var(--amarillo-promo); }

/* =================================================================
   1. HERO  (Opción A — arte completo como imagen)
   ================================================================= */
.hero--image {
  position: relative;
  background: var(--azul-hero);
  line-height: 0;            /* elimina espacio bajo la imagen */
}
.hero__bg {
  display: block;
  position: relative;
  text-decoration: none;
}
.hero__bg-img {
  display: block;
  width: 100%;
  height: auto;
}
/* Zona clickeable invisible sobre el botón del arte
   (coordenadas en % medidas sobre la imagen real) */
.hero__hotspot {
  position: absolute;
  left: 7.6%;
  top: 84.9%;
  width: 29%;     /* 36.6% - 7.6% */
  height: 8.2%;   /* 93.1% - 84.9% */
  cursor: pointer;
  border-radius: var(--r-pill);
}
.hero__hotspot:focus-visible {
  outline: 3px solid var(--amarillo-promo);
  outline-offset: 3px;
}

/* Helper accesibilidad: contenido solo para lectores de pantalla / SEO */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =================================================================
   2. ¿CÓMO PARTICIPAR?
   ================================================================= */
.steps { background: var(--gris-claro); padding: 60px 0; }
.steps__list {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.step {
  flex: 1 1 180px;
  max-width: 220px;
  text-align: center;
}
.step__icon { width: 96px; height: 96px; margin: 0 auto 16px; object-fit: contain; }
.step__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--azul-marfil);
  letter-spacing: .3px;
}
.step__text { margin: 0; font-size: .9rem; color: var(--gris-texto); }
.step__arrow {
  align-self: center;
  margin-top: 30px;
  color: var(--azul-marfil);
  font-size: 1.8rem;
  font-weight: 700;
  opacity: .5;
}

/* =================================================================
   3. PREMIOS SEMANALES  (Opción A — arte completo como imagen)
   ================================================================= */
.prizes--image {
  background: var(--azul-marfil);
  line-height: 0;
}
.prizes__img {
  display: block;
  width: 100%;
  height: auto;
}

/* =================================================================
   4. FORMULARIO
   ================================================================= */
.register { background: var(--blanco); padding: 60px 0; }
.register__grid {
  display: grid;
  grid-template-columns: 320px 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}
.register__mascot { align-self: end; }
.register__mascot img { width: 100%; max-width: 360px; }

.form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gris-texto);
  margin-bottom: 4px;
}
.field__input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--r-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--azul-marfil);
  background: var(--blanco);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field__input::placeholder { color: #9aa3b8; }
.field__input:focus {
  border-color: var(--azul-marfil);
  box-shadow: 0 0 0 3px rgba(8,43,115,.12);
  outline: none;
}
.field__select { appearance: none; cursor: pointer;
  background-image: url("../img/select-arrow.svg");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field__input.is-invalid { border-color: var(--rojo-marfil); }
.field__error {
  min-height: 0;
  font-size: .75rem;
  color: var(--rojo-marfil);
  margin-top: 3px;
}

/* Términos */
.form__terms {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}
.form__checkbox { width: 18px; height: 18px; accent-color: var(--azul-marfil); cursor: pointer; }
.form__terms-label { font-size: .9rem; color: var(--gris-texto); }
.link { color: var(--azul-marfil); font-weight: 700; }
.form__terms .field__error { flex-basis: 100%; }

.form__submit { margin-top: 4px; }

/* Upload */
.upload__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--azul-marfil);
  margin: 0 0 16px;
  letter-spacing: .3px;
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  border: 2px dashed var(--gris-borde);
  border-radius: var(--r-md);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.is-dragover { border-color: var(--azul-marfil); background: rgba(8,43,115,.04); }
.dropzone__icon { opacity: .8; }
.dropzone__text { margin: 6px 0 0; font-weight: 600; color: var(--gris-texto); }
.dropzone__or { margin: 0; color: #9aa3b8; font-size: .85rem; }
.dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload__hint { font-size: .8rem; color: var(--gris-texto); text-align: center; margin: 14px 0 0; }
.upload__filename { font-size: .85rem; font-weight: 700; color: var(--azul-marfil); text-align: center; margin: 8px 0 0; word-break: break-all; }
.upload .field__error { text-align: center; display: block; }

/* =================================================================
   5. PRODUCTOS PARTICIPANTES
   ================================================================= */
.products { background: var(--azul-profundo); padding: 56px 0; }
.products__lead {
  margin: -8px 0 28px;
  text-align: center;
  color: var(--blanco);
  font-size: 1.05rem;
  font-weight: 600;
  opacity: .92;
}
.carousel {
  display: flex;
  align-items: center;
  gap: 12px;
}
.carousel__viewport { overflow: hidden; flex: 1; }
.carousel__track {
  display: flex;
  gap: 20px;
  transition: transform .4s ease;
  will-change: transform;
}
.product-card {
  flex: 0 0 calc((100% - 60px) / 4);   /* 4 visibles desktop */
  background: var(--blanco);
  border-radius: var(--r-md);
  padding: 22px 12px 18px;
  text-align: center;
  box-shadow: var(--sh-md);
}
.product-card__img {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.product-card__img img { max-height: 150px; width: auto; object-fit: contain; }
.product-card__name {
  margin: 0;
  font-size: .82rem;
  font-weight: 800;
  color: var(--azul-marfil);
  line-height: 1.25;
}
.carousel__arrow {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--rojo-marfil);
  color: var(--blanco);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-md);
  transition: background .2s ease, transform .15s ease;
}
.carousel__arrow:hover { background: var(--rojo-hover); transform: scale(1.06); }
.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.carousel__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.35);
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}
.carousel__dot.is-active { background: var(--rojo-marfil); transform: scale(1.2); }

/* =================================================================
   6 + 7. GANADORES + BLOQUE FINAL
   ================================================================= */
.winners-final { background: var(--gris-claro); }
.winners-final__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
}
.winners {
  padding: 48px var(--gutter);
}
.winners__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--azul-marfil);
  margin: 0 0 22px;
}
.winners__trophy { width: 34px; height: auto; }
.winners__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanco);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.winners__table th,
.winners__table td {
  padding: 13px 16px;
  text-align: left;
  font-size: .9rem;
  border-bottom: 1px solid var(--gris-borde);
}
.winners__table th {
  font-weight: 800;
  color: var(--azul-marfil);
  background: #eef1f7;
}
.winners__table td { color: var(--gris-texto); }
.winners__table tbody tr:last-child td { border-bottom: none; }
.winners__empty-row td {
  text-align: center;
  padding: 30px 22px;
}
.winners__empty-row strong {
  display: block;
  margin-bottom: 6px;
  color: var(--azul-marfil);
  font-size: 1rem;
}
.winners__empty-row span {
  display: block;
  max-width: 460px;
  margin: 0 auto;
  color: var(--gris-texto);
}

.final-block { display: flex; }
.final-block img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =================================================================
   8. FOOTER
   ================================================================= */
.footer { background: var(--blanco); border-top: 1px solid var(--gris-borde); padding: 24px 0; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.footer__logos { display: flex; align-items: center; gap: 18px; }
.footer__logo { height: 38px; width: auto; }
.footer__legal { margin: 0; font-size: .82rem; color: var(--gris-texto); }
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: auto;
}
.footer__link { font-size: .82rem; font-weight: 700; color: var(--azul-marfil); text-decoration: none; }
.footer__link:hover { text-decoration: underline; }
.footer__social { display: flex; gap: 10px; }
.footer__social img { width: 34px; height: 34px; }

/* =================================================================
   MODAL
   ================================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6,32,90,.6); }
.modal__box {
  position: relative;
  background: var(--blanco);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  text-align: center;
  max-width: 380px;
  width: calc(100% - 40px);
  box-shadow: var(--sh-lg);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__check {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #1faa59;
  color: #fff;
  font-size: 2rem;
  display: grid;
  place-items: center;
}
.modal__title { margin: 0 0 6px; font-size: 1.4rem; font-weight: 900; color: var(--azul-marfil); }
.modal__text { margin: 0 0 22px; color: var(--gris-texto); }
.modal__btn { margin: 0 auto; }

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Laptop / tablet ancho */
@media (max-width: 1024px) {
  .register__grid { grid-template-columns: 1fr 1fr; }
  .register__mascot { display: none; }
  .product-card { flex: 0 0 calc((100% - 40px) / 3); }  /* 3 visibles */
}

/* Tablet */
@media (max-width: 768px) {
  .steps__list { gap: 18px; }
  .step__arrow { display: none; }
  .step { flex-basis: 40%; max-width: 260px; }

  .register__grid { grid-template-columns: 1fr; }

  .product-card { flex: 0 0 calc((100% - 20px) / 2); }   /* 2 visibles */

  .winners-final__grid { grid-template-columns: 1fr; }
  .final-block img { min-height: 200px; }

  .footer__inner { justify-content: center; text-align: center; }
  .footer__links { margin-left: 0; align-items: center; }
}

/* Mobile */
@media (max-width: 480px) {
  .form__fields { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1 !important; }

  .step { flex-basis: 100%; max-width: 300px; }

  .product-card { flex: 0 0 100%; }                       /* 1 visible */

  .carousel__arrow { width: 42px; height: 42px; font-size: 1.3rem; }

  .winners__table { table-layout: fixed; }
  .winners__table th,
  .winners__table td {
    padding: 10px 8px;
    font-size: .72rem;
    word-break: break-word;
  }
  .winners__empty-row td {
    padding: 24px 16px;
    font-size: .85rem;
  }

  .btn--cta { width: 100%; justify-content: center; }
}

/* =================================================================
   ANIMACIONES  (nivel sutil y elegante)
   ================================================================= */

/* --- Aparición al hacer scroll (scroll reveal) --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Retardo escalonado para elementos en secuencia (pasos, productos) */
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* --- Pulido de hover --- */
.step__icon { transition: transform .25s ease; }
.step:hover .step__icon { transform: translateY(-6px) scale(1.05); }

.product-card { transition: transform .25s ease, box-shadow .25s ease; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(8,43,115,.28); }

.prizes__img, .final-block img { transition: transform .4s ease; }

.winners__table tbody tr { transition: background .2s ease; }
.winners__table tbody tr:hover { background: #f3f6fc; }

/* Brillo sutil que recorre el botón CTA al pasar el mouse */
.btn--cta { position: relative; overflow: hidden; }
.btn--cta::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn--cta:hover::after { left: 130%; }

/* --- Confetti (se inyecta al participar) --- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 99;
}
.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  opacity: .95;
  will-change: transform, opacity;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-10vh) rotateZ(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotateZ(720deg); opacity: .9; }
}

/* Movimiento reducido: desactiva todas las animaciones */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .carousel__track { transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn--cta::after { display: none; }
  .confetti-layer { display: none; }
  .step:hover .step__icon,
  .product-card:hover { transform: none; }
}
