:root {
  --yellow: #ffd400;
  --yellow-soft: #ffe56a;

  --navy: #06111f;
  --navy-2: #0b1a2d;

  --white: #ffffff;
  --text-soft: #cbd3dd;
  --dark-text: #0f172a;

  /* OPCIÓN B: crema cálido transparente (sobre la imagen del hero) */
  --header-bg: #fff7eb;
  --header-bg-soft: rgba(255, 247, 235, 0.42);
  --header-text: #0f172a;
  --header-muted: #64748b;
  --card-light: #fffaf1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

/* HEADER: encima del hero para que se vea la imagen a través del crema */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;

  padding: 18px 7%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  z-index: 100;

  background: var(--header-bg-soft);
  color: var(--header-text);
  border-bottom: 1px solid rgba(255, 247, 235, 0.25);

  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    padding 0.3s ease;
}

.topbar.scrolled {
  position: fixed;
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(255, 247, 235, 0.55);
  border-bottom: 1px solid rgba(255, 247, 235, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;

  text-decoration: none;
  color: var(--header-text);
}

.logo-symbol {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;

  background: var(--yellow);
  color: var(--header-text);
  font-weight: 700;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--header-text);
}

.logo strong {
  color: var(--yellow);
}

.nav {
  display: flex;
  gap: 35px;
}

.nav a {
  text-decoration: none;
  color: var(--header-text);
  font-size: 0.9rem;
  font-weight: 500;

  transition: color 0.2s ease;
}

.nav a:hover {
  color: #b8860b;
}

/* BOTONES */

.btn-small,
.btn-primary {
  background: var(--yellow);
  color: #111;

  text-decoration: none;
  font-weight: 600;

  border: none;
  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-small {
  padding: 11px 23px;
  border-radius: 999px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;

  padding: 16px 27px;
  border-radius: 999px;
}

.btn-primary:hover,
.btn-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(255, 212, 0, 0.35);
}

/* HERO */

.hero {
  min-height: 100vh;

  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;

  padding: 120px 7% 90px;

  background:
    url("../images/imgcosta2.png")
    center center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;

  /* Izquierda oscura para leer el texto; derecha más clara para ver la imagen */
  background: linear-gradient(
    90deg,
    rgba(2, 7, 13, 0.96) 0%,
    rgba(5, 12, 22, 0.72) 35%,
    rgba(5, 12, 22, 0.04) 58%,
    rgba(5, 12, 22, 0) 85%
  );
}

.hero-lines {
  position: absolute;

  width: 520px;
  height: 520px;

  right: 10%;
  top: 18%;

  border: 1px solid rgba(255, 212, 0, 0.25);
  border-radius: 50%;

  opacity: 0.55;
}

.hero-lines::before {
  content: "";

  position: absolute;
  inset: 60px;

  border: 1px solid rgba(255, 212, 0, 0.18);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 5;

  width: min(680px, 90%);
}

.eyebrow,
.section-label {
  color: var(--yellow);

  font-size: 0.78rem;
  font-weight: 600;

  letter-spacing: 0.18em;
}

.eyebrow {
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.98;

  font-weight: 500;
  letter-spacing: -0.04em;

  margin-bottom: 30px;
}

.hero h1 span {
  display: block;
  color: var(--yellow);
}

.hero-text {
  max-width: 560px;

  color: var(--text-soft);

  font-size: 1.05rem;
  line-height: 1.7;

  margin-bottom: 35px;
}

/* TARJETAS FLOTANTES */

.services-floating {
  position: absolute;

  right: 6%;
  bottom: 8%;

  width: min(380px, 32vw);

  display: grid;
  gap: 12px;

  z-index: 6;
}

/* Pastillas claras estilo OPCIÓN B */
.service-mini {
  display: grid;

  grid-template-columns: auto auto 1fr;
  column-gap: 14px;
  align-items: center;

  padding: 18px 20px;

  background: #ffffff;

  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;

  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.service-number {
  color: var(--yellow);
  /* Números 01/02/03 más grandes y visibles en las pastillas */
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  min-width: 2.2rem;
}

.service-icon-mini {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  border-radius: 50%;
  background: #fff4d6;

  color: var(--header-text);
}

.service-icon-mini svg {
  width: 20px;
  height: 20px;
}

.service-mini h3 {
  color: var(--header-text);
  margin-bottom: 5px;
  font-size: 0.98rem;
  line-height: 1.2;
}

.service-mini p {
  color: var(--header-muted);
  line-height: 1.45;
  font-size: 0.84rem;
}

/* SECCIONES GENERALES */

.section {
  padding: 110px 8%;
}

.section-label {
  margin-bottom: 25px;
}

/* SOBRE MI */

.about {
  background: #ffffff;
  color: var(--dark-text);
  /* Menos espacio abajo para que no quede tan lejos de Servicios */
  padding-top: 80px;
  padding-bottom: 50px;
}

.services.section {
  padding-top: 60px;
}

.about-grid {
  display: grid;
  /* Mitad texto | mitad imagen */
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-copy {
  max-width: 34rem;
}

.about h2 {
  /* Mismo tamaño que el título de Servicios */
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.08;
  margin-bottom: 28px;
}

/* Cada frase en su propia línea, sin partir palabras */
.about h2 .about-line {
  display: block;
  white-space: nowrap;
}

.about h2 .about-accent {
  color: var(--yellow);
}

.about-text {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #4e5967;
}

/* Imagen a la derecha, ocupando su mitad */
.about-media {
  margin: 0;
  width: 100%;
  max-width: 460px;
  justify-self: end;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 18px;
}

.about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* SERVICIOS */

.services {
  background: linear-gradient(
    180deg,
    #f7f7f4,
    #ffffff
  );

  color: var(--dark-text);
}

.section-heading {
  max-width: 700px;
  margin-bottom: 55px;
}

.section-heading h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
}

.section-heading h2 span {
  color: var(--yellow);
}

.services-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.service-card {
  position: relative;

  min-height: 360px;

  padding: 34px;

  background: white;

  border: 1px solid #e5e7eb;
  border-radius: 18px;

  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-7px);
  border-color: var(--yellow);
}

.service-icon {
  width: 55px;
  height: 55px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: rgba(255, 212, 0, 0.17);

  color: #162333;
  font-size: 1.7rem;

  margin-bottom: 30px;
}

.card-number {
  position: absolute;
  top: 30px;
  right: 30px;

  color: var(--yellow);
}

.service-card h3 {
  font-size: 1.35rem;
  margin-bottom: 20px;
}

.service-card p {
  color: #5b6572;
  line-height: 1.65;

  margin-bottom: 13px;
}

/* CONTACTO */

.contact {
  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: 0.8fr 1.5fr;

  gap: 80px;

  /* Espacio inferior para el footer encima de la imagen */
  padding-bottom: 160px;

  /* Imagen de monte con overlay, estilo home */
  background:
    url("../images/imgmonte.png")
    center center / cover no-repeat;
}

.contact-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;

  /* Más transparencia, sobre todo a la derecha para ver el monte */
  background: linear-gradient(
    90deg,
    rgba(2, 7, 13, 0.88) 0%,
    rgba(5, 12, 22, 0.65) 35%,
    rgba(5, 12, 22, 0.28) 65%,
    rgba(5, 12, 22, 0.12) 100%
  );
}

.contact-info,
.contact-form {
  position: relative;
  z-index: 1;
}

.contact-info h2 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  font-weight: 500;

  margin-bottom: 25px;
}

.contact-info > p {
  color: var(--text-soft);
  line-height: 1.7;

  margin-bottom: 40px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;

  gap: 15px;

  color: var(--text-soft);
}

.contact-detail span {
  color: var(--yellow);
}

.contact-form {
  background: white;
  color: var(--dark-text);

  padding: 35px;

  border-radius: 20px;

  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  color: #596273;
}

.form-group input,
.form-group textarea {
  width: 100%;

  padding: 14px;

  border: 1px solid #d7dce2;
  border-radius: 8px;

  outline: none;

  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--yellow);
}

/* Aviso de límite de caracteres bajo el campo */
.field-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #7a8494;
}

.privacy {
  grid-column: 1 / -1;

  display: flex;
  align-items: flex-start;

  gap: 12px;

  color: #646c78;

  line-height: 1.45;
  font-size: 0.78rem;
}

.form-footer {
  grid-column: 1 / -1;

  display: flex;
  align-items: center;

  gap: 25px;
}

.form-status {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 1.4em;
}

/* Confirmación de envío bien visible */
.form-status--ok {
  color: #0f7a3a;
  background: #e8f8ee;
  border: 1px solid #b7e4c7;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}

.form-status--error {
  color: #9b1c1c;
  background: #fdecec;
  border: 1px solid #f5c2c2;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}

.form-status--loading {
  color: #334155;
}

/* FOOTER */

/* FOOTER — mismo lenguaje visual que el header (OPCIÓN B) */

/* Footer: mismo tratamiento que el header, encima de la imagen de contacto */
.footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;

  min-height: 110px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 30px;

  padding: 28px 7%;

  /* Un poco más legible que el header, misma idea transparente */
  background: rgba(255, 247, 235, 0.72);
  color: var(--header-text);
  font-size: 0.85rem;

  border-top: 1px solid rgba(255, 247, 235, 0.35);
}

.footer-brand {
  display: flex;
  align-items: center;

  gap: 12px;

  color: var(--header-text);
  font-weight: 600;
}

.footer strong {
  color: var(--yellow);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.footer-meta p {
  color: var(--header-text);
  font-weight: 500;
  opacity: 0.9;
}

.footer-meta a {
  color: var(--header-text);
  font-weight: 700;
  text-decoration: none;
}

.footer-meta a:hover {
  color: #b8860b;
  text-decoration: underline;
}

.privacy a {
  color: var(--yellow);
}

/* Campo trampa anti-bots: totalmente oculto */
.hp-field {
  display: none !important;
}

/* PÁGINA LEGAL */

.legal-page {
  background: #ffffff;
  color: var(--dark-text);
}

.legal {
  padding-top: 110px;
  max-width: 860px;
  margin: 0 auto;
}

.legal h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  margin-bottom: 40px;
  line-height: 1.15;
}

.legal-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  margin: 50px 0 30px;
  color: var(--navy);
}

.legal-block {
  margin-bottom: 32px;
}

.legal-block h2,
.legal-block h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--navy);
}

.legal-block p,
.legal-block li {
  color: #4e5967;
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal-block ul {
  padding-left: 1.2rem;
  margin-bottom: 12px;
}

.legal-block a {
  color: #0b1a2d;
  font-weight: 600;
}

.legal-back {
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ANIMACIONES */

.reveal {
  opacity: 0;

  transform: translateY(25px);

  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */

@media (max-width: 1000px) {
  .nav {
    display: none;
  }

  .hero {
    display: block;
  }

  .services-floating {
    position: relative;

    right: auto;
    bottom: auto;

    width: 100%;

    margin-top: 60px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-copy {
    max-width: none;
  }

  .about h2 .about-line {
    white-space: normal;
  }

  .about-media {
    justify-self: start;
    max-width: 380px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact {
    grid-template-columns: 1fr;
    /* En tablet/móvil el footer deja de flotar y va debajo del formulario */
    padding-bottom: 40px;
  }

  /* Evita que el footer tape el botón Enviar */
  .footer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    margin-top: 28px;
    min-height: 0;
  }
}

@media (max-width: 650px) {
  .topbar {
    padding: 20px 5%;
  }

  .logo-text {
    font-size: 1rem;
  }

  .btn-small {
    padding: 10px 17px;
  }

  .hero {
    padding: 110px 6% 65px;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .section {
    padding: 80px 6%;
  }

  .contact-form {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .form-group,
  .form-group.full,
  .privacy,
  .form-footer {
    grid-column: 1;
  }

  /* El botón Enviar queda siempre usable y por encima */
  .form-footer {
    position: relative;
    z-index: 3;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    padding: 22px 6%;
  }

  .footer-meta {
    align-items: center;
    text-align: center;
  }

  /* Si el banner de cookies está abierto, deja hueco abajo */
  body.cookie-banner-open {
    padding-bottom: 160px;
  }
}

/* ---------- Banner de cookies ---------- */

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;

  max-width: 640px;
  margin: 0 auto;

  background: rgba(255, 247, 235, 0.96);
  color: var(--header-text);

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);

  padding: 1.1rem 1.2rem;
}

/* Respeta el atributo hidden (si no, a veces el CSS lo deja visible/invisible mal) */
.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__content {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cookie-banner p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--header-text);
}

.cookie-banner a {
  color: var(--header-text);
  font-weight: 700;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.cookie-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
}

.cookie-btn--solid {
  background: var(--yellow);
  color: #111;
}

.cookie-btn--ghost {
  background: transparent;
  color: var(--header-text);
  border: 1px solid rgba(15, 23, 42, 0.18);
}

@media (max-width: 650px) {
  .cookie-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .cookie-banner__actions {
    justify-content: stretch;
  }

  .cookie-btn {
    flex: 1;
  }
}

/* =========================
   ASISTENTE ROBOT (misma esquina)
   Entra al hacer scroll + bocadillo + modal
========================= */

.robot-assistant {
  position: fixed;
  right: 25px;
  bottom: 20px;
  z-index: 10050;

  /* Empieza escondido fuera de pantalla */
  transform: translateX(180px);
  opacity: 0;

  transition:
    transform 0.7s cubic-bezier(.34, 1.56, .64, 1),
    opacity 0.5s ease,
    bottom 0.3s ease;
}

.robot-assistant.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.robot-assistant.jugando {
  right: 20px;
  bottom: 35px;
}

.robot-assistant.jugando .robot-bubble,
.robot-assistant.jugando .robot-nudge {
  display: none;
}

.robot-assistant.jugando .robot-image {
  pointer-events: none;
}

/* Si el banner de cookies está abierto, sube el robot para no taparlo */
body.cookie-banner-open .robot-assistant {
  bottom: 190px;
}

/* Flotación suave: la controla el escenario, no la imagen */
.robot-stage {
  position: relative;
  animation: robotFloat 3s ease-in-out infinite;
}

@keyframes robotFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.robot-image {
  width: 120px;
  height: auto;
  display: block;
  cursor: pointer;
  --robot-giro: 0deg;
  transform: rotate(var(--robot-giro)) scale(1);
  transition: transform 0.2s ease;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
}

.robot-image.robot-cerca {
  transform: rotate(var(--robot-giro)) scale(1.06);
}

.robot-image:hover {
  transform: rotate(var(--robot-giro)) scale(1.05);
}

.robot-image.robot-salto {
  animation: robotSalto 0.5s ease;
}

@keyframes robotSalto {
  0% {
    transform: translateY(0) scale(1);
  }

  40% {
    transform: translateY(-28px) scale(1.05);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

/* Gesto de atención al aparecer / aviso periódico */
.robot-image.atencion,
.robot-image.robot-atencion {
  animation: robotAtencion 0.7s ease 2;
}

@keyframes robotAtencion {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  25% {
    transform: rotate(-4deg) scale(1.04);
  }

  75% {
    transform: rotate(4deg) scale(1.04);
  }
}

/* Bocadillo a la izquierda del robot */
.robot-bubble {
  position: absolute;
  right: 90px;
  bottom: 110px;
  width: 220px;
  padding: 18px;
  background: var(--white);
  color: var(--dark-text);
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

/* Punta del bocadillo hacia el robot */
.robot-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 22px;
  width: 14px;
  height: 14px;
  background: var(--white);
  transform: rotate(45deg);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.04);
}

.robot-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.robot-bubble p {
  margin: 7px 0 14px;
  font-size: 14px;
  line-height: 1.4;
}

.robot-bubble-close {
  position: absolute;
  top: 5px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

.robot-reto-btn {
  border: none;
  background: var(--yellow);
  color: var(--dark-text);
  padding: 10px 17px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.robot-reto-btn:hover {
  transform: scale(1.05);
}

/* =========================
   MODAL RETA A LA IA
========================= */

.reto-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(10, 18, 32, 0.55);
  backdrop-filter: blur(5px);
  overflow-y: auto;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.reto-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.reto-modal-open {
  overflow: hidden;
}

.reto-content {
  position: relative;
  width: min(700px, 95%);
  padding: 40px;
  background: var(--white);
  color: var(--dark-text);
  border-radius: 25px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.reto-modal.show .reto-content {
  transform: scale(1);
}

.reto-subtitle {
  color: #eebd00;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.reto-content h2 {
  margin: 10px 0 5px;
  color: var(--dark-text);
  font-size: 32px;
}

.reto-content > p {
  color: #667085;
}

.reto-close {
  position: absolute;
  top: 12px;
  right: 18px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--dark-text);
}

.reto-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 28px;
}

.reto-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 160px;
  padding: 22px;
  background: var(--white);
  color: var(--dark-text);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.reto-option:hover {
  transform: translateY(-5px);
  border-color: var(--yellow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.reto-option span {
  font-size: 28px;
  margin-bottom: 14px;
}

.reto-option strong {
  color: var(--dark-text);
  font-size: 16px;
}

.reto-option small {
  margin-top: 7px;
  color: #667085;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .reto-options {
    grid-template-columns: 1fr;
  }

  .reto-content {
    padding: 30px 20px;
  }

  .reto-content h2 {
    font-size: 25px;
  }

  .robot-image {
    width: 90px;
  }

  .robot-assistant {
    right: 12px;
    bottom: 12px;
  }

  .robot-bubble {
    right: 0;
    bottom: 105px;
    width: 180px;
  }

  body.cookie-banner-open .robot-assistant {
    bottom: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .robot-assistant,
  .reto-content {
    transition: opacity 0.4s ease;
  }

  .robot-stage,
  .robot-image.atencion,
  .robot-image.robot-atencion,
  .robot-image.robot-salto {
    animation: none;
  }

  .reto-option:hover {
    transform: none;
  }
}

/* ===============================
   RETO DOCUMENTOS
================================ */

.reto-documentos {
  display: none;
}

.reto-documentos.show {
  display: block;
}

.reto-volver {
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  color: #667085;
  cursor: pointer;
  font-weight: 600;
}

.reto-volver:hover {
  color: var(--dark-text);
}

.reto-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 85px;
  height: 45px;
  margin: 18px 0;
  border-radius: 30px;
  background: #111827;
  color: var(--yellow);
  font-size: 20px;
  font-weight: 700;
}

.factura-demo {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.factura-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.factura-header div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.factura-header strong {
  font-size: 18px;
}

.factura-header small {
  color: #eebd00;
  letter-spacing: 2px;
  font-weight: 700;
}

.factura-numero {
  color: #667085;
  font-size: 13px;
}

.factura-datos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 0;
}

.factura-datos div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.factura-datos small {
  color: #98a2b3;
  font-size: 11px;
}

.factura-datos strong {
  font-size: 14px;
  color: #344054;
}

.factura-lineas {
  padding: 15px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.factura-lineas div,
.factura-totales div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  font-size: 14px;
}

.factura-lineas span,
.factura-totales span {
  color: #667085;
}

.factura-totales {
  padding-top: 15px;
  margin-left: auto;
  width: 55%;
}

.factura-total {
  margin-top: 5px;
  padding-top: 12px !important;
  border-top: 2px solid var(--yellow);
}

.factura-total strong {
  font-size: 18px;
  color: var(--dark-text);
}

.reto-respuesta {
  margin-top: 25px;
}

.reto-respuesta label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--dark-text);
}

.reto-input-row {
  display: flex;
  gap: 10px;
}

.reto-input-row input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  color: var(--dark-text);
  background: #ffffff;
}

.reto-input-row input:focus {
  border-color: var(--yellow);
}

.reto-input-row button {
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  background: var(--yellow);
  color: var(--dark-text);
  font-weight: 700;
  cursor: pointer;
}

.reto-resultado {
  display: none;
  margin-top: 20px;
  padding: 18px;
  border-radius: 15px;
  background: #f8f9fb;
  line-height: 1.6;
  color: #344054;
}

.reto-resultado.show {
  display: block;
}

.reto-resultado strong {
  color: var(--dark-text);
}

@media (max-width: 700px) {
  .reto-modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 20px 12px;
  }

  .reto-content {
    margin: 20px auto;
  }

  .factura-demo {
    padding: 18px;
  }

  .factura-datos {
    grid-template-columns: 1fr;
  }

  .factura-totales {
    width: 100%;
  }

  .reto-input-row {
    flex-direction: column;
  }

  .reto-input-row button {
    width: 100%;
  }
}

/* ===============================
   RETO CHATBOT
================================ */

.reto-chatbot {
  display: none;
}

.reto-chatbot.show {
  display: block;
}

.chat-cliente {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  margin-bottom: 25px;
  padding: 20px;
  background: #f8f9fb;
  border-radius: 18px;
}

.chat-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 50%;
  font-size: 22px;
}

.chat-cliente small {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.chat-cliente p {
  margin: 5px 0 0;
  color: #344054;
  line-height: 1.5;
}

.chat-respuestas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-respuesta {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px;
  background: white;
  color: var(--dark-text);
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-respuesta:hover:not(:disabled) {
  transform: translateX(5px);
  border-color: var(--yellow);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.06);
}

.chat-respuesta:disabled {
  cursor: default;
}

.chat-respuesta strong {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #111827;
  color: white;
}

.chat-respuesta span {
  color: #344054;
  line-height: 1.4;
}

.chat-respuesta.correcta {
  border-color: #22c55e;
  background: #f0fdf4;
}

.chat-respuesta.incorrecta {
  border-color: #ef4444;
  background: #fef2f2;
}

.chat-resultado {
  display: none;
  margin-top: 20px;
  padding: 18px;
  background: #f8f9fb;
  border-radius: 15px;
  line-height: 1.5;
  color: #344054;
}

.chat-resultado.show {
  display: block;
}

.chat-resultado strong {
  color: var(--dark-text);
}

@media (max-width: 700px) {
  .chat-cliente {
    padding: 15px;
  }

  .chat-respuesta {
    padding: 14px;
  }

  .chat-respuesta:hover:not(:disabled) {
    transform: none;
  }
}

/* ===============================
   RETO PROCESAMIENTO DE DOCUMENTOS
================================ */

.reto-procesamiento {
  display: none;
}

.reto-procesamiento.show {
  display: block;
}

.documento-demo {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 25px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.documento-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.documento-cabecera div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.documento-cabecera small {
  color: #eebd00;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 11px;
}

.documento-cabecera strong {
  font-size: 18px;
}

.documento-numero {
  color: #667085;
  font-size: 13px;
}

.documento-datos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px 0;
}

.documento-datos div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.documento-datos small {
  color: #98a2b3;
  font-size: 11px;
}

.documento-datos strong {
  font-size: 14px;
  color: #344054;
}

.documento-lineas {
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.documento-lineas div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}

.documento-lineas span {
  color: #667085;
}

.procesamiento-pregunta {
  margin-top: 24px;
  color: var(--dark-text);
  font-size: 17px;
}

.procesamiento-opciones {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.procesamiento-opcion {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px;
  background: white;
  color: var(--dark-text);
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.procesamiento-opcion:hover:not(:disabled) {
  transform: translateX(5px);
  border-color: var(--yellow);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.06);
}

.procesamiento-opcion:disabled {
  cursor: default;
}

.procesamiento-opcion strong {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  background: #111827;
  color: white;
  border-radius: 50%;
}

.procesamiento-opcion span {
  color: #344054;
  line-height: 1.45;
}

.procesamiento-opcion.correcta {
  border-color: #22c55e;
  background: #f0fdf4;
}

.procesamiento-opcion.incorrecta {
  border-color: #ef4444;
  background: #fef2f2;
}

.procesamiento-resultado {
  display: none;
  margin-top: 20px;
  padding: 18px;
  background: #f8f9fb;
  border-radius: 15px;
  line-height: 1.6;
  color: #344054;
}

.procesamiento-resultado.show {
  display: block;
}

.procesamiento-resultado strong {
  color: var(--dark-text);
}

.ia-analizando {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--dark-text);
}

.ia-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: procesamientoSpin 0.7s linear infinite;
}

@keyframes procesamientoSpin {
  to {
    transform: rotate(360deg);
  }
}

.ia-datos {
  margin-top: 15px;
}

.ia-dato {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 7px 0;
  border-bottom: 1px solid #e5e7eb;
}

.ia-dato span {
  color: #667085;
}

.ia-dato strong {
  color: var(--dark-text);
}

.ia-accion {
  margin-top: 17px;
  padding: 13px;
  background: #fff8d6;
  border-radius: 12px;
  color: #344054;
}

@media (max-width: 700px) {
  .documento-demo {
    padding: 17px;
  }

  .documento-datos {
    grid-template-columns: 1fr;
  }

  .documento-cabecera {
    flex-direction: column;
  }

  .procesamiento-opcion:hover {
    transform: none;
  }

  .ia-dato {
    flex-direction: column;
    gap: 2px;
  }
}

/* ===============================
   CTA DESPUÉS DEL RETO
================================ */

.reto-cta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.reto-cta p {
  margin: 0 0 12px;
  color: #344054;
  font-size: 14px;
}

.reto-cta a {
  display: inline-block;
  padding: 11px 20px;
  background: var(--yellow);
  color: var(--dark-text);
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.reto-cta a:hover {
  transform: translateY(-2px);
}

/* ===================================
   AJUSTES FINALES PARA MÓVIL
=================================== */

@media (max-width: 700px) {

  /* ROBOT */
  .robot-assistant {
    right: 10px;
    bottom: 10px;
  }

  .robot-image {
    width: 85px;
  }

  /* BOCADILLO */
  .robot-bubble {
    position: absolute;
    width: 190px;
    right: 55px;
    bottom: 85px;
    padding: 14px;
    font-size: 13px;
  }

  /* MODAL */
  .reto-modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 12px;
  }

  .reto-content {
    width: 100%;
    max-width: 100%;
    padding: 28px 18px;
    margin: 15px auto;
    border-radius: 20px;
  }

  .reto-content h2 {
    font-size: 24px;
  }

  /* MENÚ DE RETOS */
  .reto-options {
    grid-template-columns: 1fr;
  }

  /* FACTURA */
  .factura-demo {
    padding: 15px;
  }

  .factura-datos {
    grid-template-columns: 1fr;
  }

  .factura-totales {
    width: 100%;
  }

  /* RESPUESTA DOCUMENTOS */
  .reto-input-row {
    flex-direction: column;
  }

  .reto-input-row input {
    width: 100%;
    box-sizing: border-box;
  }

  .reto-input-row button {
    width: 100%;
  }

  /* CHATBOT */
  .chat-respuesta {
    padding: 14px;
  }

  /* PROCESAMIENTO */
  .procesamiento-opcion {
    padding: 14px;
  }

  /* En móvil no necesitamos efectos hover */
  .robot-image:hover,
  .reto-option:hover,
  .chat-respuesta:hover,
  .procesamiento-opcion:hover {
    transform: none;
  }
}

/* ==================================
   ROBOT: mini mensaje periódico
=================================== */

.robot-nudge {
  position: absolute;
  right: 85px;
  top: 15px;
  white-space: nowrap;
  padding: 7px 12px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.robot-nudge.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 700px) {
  .robot-nudge {
    right: 65px;
    top: 8px;
    font-size: 11px;
  }

  .robot-assistant.jugando {
    right: 8px;
    bottom: 10px;
  }

  .robot-assistant.jugando .robot-image {
    width: 70px;
  }
}
