:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --text: #3f4750;
  --text-muted: #8c9298;
  --border: #e5e5e5;
  --primary: #4d8f3a;
  --primary-hover: #5a9b47;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  /* Alias legado (componentes existentes) */
  --color-primary: #3f4750;
  --color-secondary: #f2f2f2;
  --color-accent: #4d8f3a;
  --color-accent-hover: #5a9b47;
  --color-text-dark: #3f4750;
  --color-text-light: #ffffff;
  --color-muted: #8c9298;
  --color-border: #e5e5e5;
  --color-comarca-default: #4d8f3a;
  --color-comarca-hover: #5a9b47;
  --color-comarca-border: #b8d4ae;
}

/* Hero: ambiente premium — velos verdes suaves + ligera profundidad */
.hero-section{
  background:linear-gradient(
    165deg,
    #ffffff 0%,
    #f8fbf7 28%,
    #eef4ec 58%,
    var(--bg) 100%
  );
  border-bottom:1px solid rgba(63,71,80,0.06);
  box-shadow:0 24px 48px -28px rgba(0,0,0,0.06);
}

.hero-texture{
  background-image:
    radial-gradient(ellipse 85% 65% at 12% 18%, rgba(77,143,58,0.12), transparent 58%),
    radial-gradient(ellipse 75% 55% at 88% 12%, rgba(77,143,58,0.07), transparent 52%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(63,71,80,0.04), transparent 55%);
}

.hero-eyebrow-pill{
  background:linear-gradient(135deg, #ffffff 0%, #f4faf2 100%);
  border-color:rgba(77,143,58,0.2);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.06),
    0 0 0 1px rgba(255,255,255,0.9) inset;
}

.stat-pill{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:var(--shadow);
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  color:var(--text);
}

.stat-pill-dark{
  display:inline-flex;
  align-items:center;
  border:1px solid rgba(77,143,58,0.22);
  background:rgba(77,143,58,0.08);
  padding:10px 14px;
  border-radius:999px;
  font-weight:800;
  font-size:14px;
  color:var(--text);
}

/* Landing: modal vídeo Mateo — barra de controles legible sobre fondo oscuro */
.mateo-intro-dialog__video{
  vertical-align:middle;
}

/* Sobre Mateo: recorte circular centrado en rostro/torso */
.mateo-portrait{
  object-position:center 46%;
}
@media (min-width:640px){
  .mateo-portrait{
    object-position:center 44%;
  }
}
.mateo-intro-dialog__video::-webkit-media-controls-panel{
  background:linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
}

/* EL PROBLEMA: flip tarjeta clara / reverso con acento verde */
/* width:100% evita que la grid colapse: las caras son absolute y no miden al padre */
.problem-flip{
  perspective:1000px;
  width:100%;
  min-width:0;
  min-height:200px;
}
.problem-flip-inner{
  position:relative;
  width:100%;
  min-width:0;
  height:100%;
  min-height:200px;
  transition:transform 0.65s cubic-bezier(0.4,0,0.2,1);
  transform-style:preserve-3d;
}
@media (hover:hover) and (pointer:fine){
  .problem-flip:hover .problem-flip-inner,
  .problem-flip:focus-within .problem-flip-inner{
    transform:rotateY(180deg);
  }
}
@media (hover:none){
  .problem-flip-inner{
    transform:rotateY(180deg);
  }
}
.problem-flip-face{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border-radius:14px;
  padding:16px 14px 12px;
  box-sizing:border-box;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  box-shadow:var(--shadow);
}
.problem-flip-front{
  background:var(--surface);
  color:var(--primary);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}
.problem-flip-front-main{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1rem;
  width:100%;
  min-height:0;
}
.problem-flip-front-line{
  margin:0;
  max-width:14rem;
  padding:0 8px 0.75rem;
  text-align:center;
  font-size:0.75rem;
  font-weight:600;
  line-height:1.45;
  letter-spacing:0.01em;
  color:var(--text-muted);
}
@media (min-width:768px){
  .problem-flip-front-line{
    font-size:0.8125rem;
    max-width:15rem;
  }
}
.problem-flip-icon-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  border-radius:16px;
  background:rgba(77,143,58,0.08);
  border:1px solid rgba(77,143,58,0.2);
}
.problem-flip-icon-wrap::after{
  content:"";
  position:absolute;
  inset:-5px;
  border-radius:20px;
  border:2px solid rgba(77,143,58,0.25);
  animation:problemFlipPulse 2.4s ease-out infinite;
  pointer-events:none;
}
@keyframes problemFlipPulse{
  0%{ transform:scale(0.94); opacity:0.5; }
  70%{ transform:scale(1.06); opacity:0; }
  100%{ opacity:0; }
}
.problem-flip-cue{
  flex-shrink:0;
  display:flex;
  justify-content:center;
  padding-top:0.625rem;
  color:rgba(77,143,58,0.45);
}
.problem-flip-cue-svg{
  animation:problemFlipCue 2.8s ease-in-out infinite;
}
@keyframes problemFlipCue{
  0%,100%{ transform:translateY(0) rotateY(0deg); opacity:0.45; }
  50%{ transform:translateY(-3px) rotateY(16deg); opacity:0.75; }
}
@media (prefers-reduced-motion:reduce){
  .problem-flip-icon-wrap::after,
  .problem-flip-cue-svg{
    animation:none;
  }
}
.problem-flip-back{
  background:linear-gradient(165deg,#f7faf6 0%,#eef4ec 100%);
  color:var(--text);
  transform:rotateY(180deg);
  border:1px solid rgba(77,143,58,0.2);
  box-shadow:var(--shadow);
}
.problem-flip-back h3{
  color:var(--text);
  font-size:1.0625rem;
  line-height:1.3;
}
@media (min-width:768px){
  .problem-flip-back h3{
    font-size:1.125rem;
  }
}
.problem-flip-back .problem-flip-desc{
  color:var(--text-muted);
  font-size:0.9375rem;
  line-height:1.55;
}
.problem-flip:focus-visible{
  outline:2px solid var(--color-accent);
  outline-offset:3px;
  border-radius:16px;
}
@media (prefers-reduced-motion:reduce){
  .problem-flip-inner{
    transition:none;
  }
  @media (hover:hover) and (pointer:fine){
    .problem-flip:hover .problem-flip-inner,
    .problem-flip:focus-within .problem-flip-inner{
      transform:none;
    }
  }
  .problem-flip-inner{
    transform:rotateY(180deg);
  }
}

.step-card{
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:var(--shadow);
  border-radius:16px;
  padding:22px;
}
.step-num{
  font-weight:900;
  font-size:38px;
  line-height:1;
  letter-spacing:-0.02em;
  color:var(--color-accent);
}

.benefit-pill{
  display:inline-flex;
  align-items:center;
  border:1px solid rgba(77,143,58,0.25);
  background:rgba(77,143,58,0.08);
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  color:var(--text);
}

/* Encuesta: texto oscuro legible sobre tarjeta blanca (no heredar claro del section) */
#survey-form,
#survey-form .radio-card,
#survey-form label,
#survey-form legend{
  color:var(--color-primary);
}

.site-footer{
  background:var(--surface);
  border-top:1px solid var(--border);
  box-shadow:0 -12px 40px rgba(0,0,0,0.04);
  padding-top:3.75rem;
  padding-bottom:3.5rem;
  color:var(--text-muted);
}

/* Botón flotante WhatsApp (páginas públicas) */
.whatsapp-float{
  position:fixed;
  right:max(1.25rem, env(safe-area-inset-right, 0px));
  bottom:max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index:45;
  display:flex;
  align-items:center;
  justify-content:center;
  width:3.5rem;
  height:3.5rem;
  border-radius:9999px;
  background:#25d366;
  color:#fff;
  box-shadow:
    0 10px 28px rgba(0,0,0,0.16),
    0 0 0 1px rgba(255,255,255,0.25) inset;
  transition:transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.whatsapp-float:hover{
  transform:scale(1.06);
  background:#20bd5a;
  box-shadow:0 14px 36px rgba(37,211,102,0.38);
}
.whatsapp-float:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:3px;
}
.whatsapp-float svg{
  width:1.65rem;
  height:1.65rem;
}
@media (min-width:640px){
  .whatsapp-float{
    width:3.75rem;
    height:3.75rem;
  }
  .whatsapp-float svg{
    width:1.75rem;
    height:1.75rem;
  }
}

.radio-card{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--color-border);
  border-radius:14px;
  padding:12px 14px;
  cursor:pointer;
  transition:all .2s ease;
}
.radio-card:hover{
  border-color:var(--color-accent);
  box-shadow:0 10px 20px rgba(0,0,0,0.06);
}
.radio-card input{
  accent-color:var(--color-accent);
}

/* Mapa: tooltip en body; posición solo vía transform en JS (evita bugs de clamp con width=0) */
.map-tooltip{
  position:fixed;
  left:0;
  top:0;
  display:none;
  max-width:min(280px,calc(100vw - 24px));
  background:var(--surface);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  font-size:13px;
  pointer-events:none;
  z-index:99999;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  transform:translate3d(0,0,0);
}
.map-tooltip.is-open{
  display:block;
}

/* Comarca paths (defaults overridden by JS once data loads) */
.comarca-path{
  fill:var(--color-comarca-default);
  stroke:var(--color-comarca-border);
  stroke-width:1;
  cursor:pointer;
  transition:fill .15s ease, opacity .15s ease;
}
.comarca-path[data-disabled="true"]{
  cursor:not-allowed;
}

/* Mapa Cataluña: escala al ancho del móvil sin min-width fijo */
#catalunya-map-container svg{
  width:100%;
  max-width:100%;
  height:auto;
  display:block;
}
.catalunya-map-shell{
  line-height:0;
}

/* Reveal animation */
.js-reveal.is-visible{
  opacity:1 !important;
  transform:translateY(0) !important;
  transition:opacity .7s ease, transform .7s ease;
}

/* Spinner */
.js-spinner{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid rgba(77,143,58,0.25);
  border-top-color:var(--primary);
  animation:spin 0.9s linear infinite;
}
@keyframes spin{
  to{ transform:rotate(360deg); }
}

/* Cómo funciona: timeline interactivo */
.ysp-timeline{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:18px;
  max-width:520px;
  margin:0 auto;
}
.ysp-timeline::before{
  content:"";
  position:absolute;
  z-index:0;
  left:32px; /* centro de la columna de marcadores (64px/2) */
  top:24px;
  bottom:24px;
  width:2px;
  background:repeating-linear-gradient(
    to bottom,
    rgba(77,143,58,0.45) 0px,
    rgba(77,143,58,0.45) 6px,
    transparent 6px,
    transparent 14px
  );
  opacity:0.9;
  pointer-events:none;
}

.ysp-timeline-step{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:64px 1fr;
  gap:16px;
  align-items:start;
  text-align:left;
  background:transparent;
  border:0;
  padding:10px 0;
  cursor:pointer;
}
.ysp-timeline-step:focus-visible{
  outline:2px solid rgba(77,143,58,0.5);
  outline-offset:6px;
  border-radius:14px;
}

.ysp-timeline-marker{
  width:48px;
  height:48px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  justify-self:center;
  font-weight:900;
  letter-spacing:0.02em;
  border:2px solid var(--color-accent);
  color:var(--color-accent);
  background:var(--surface);
  box-shadow:0 0 0 1px rgba(0,0,0,0.04) inset;
}
.ysp-timeline-title{
  display:block;
  font-weight:900;
  font-size:18px;
  color:var(--text);
}
.ysp-timeline-desc{
  display:block;
  margin-top:6px;
  font-size:14px;
  color:var(--text-muted);
  line-height:1.45;
}

.ysp-timeline-step:not(.is-active) .ysp-timeline-title{
  color:rgba(63,71,80,0.72);
}
.ysp-timeline-step:not(.is-active) .ysp-timeline-desc{
  color:rgba(140,146,152,0.85);
}
.ysp-timeline-step.is-active .ysp-timeline-marker{
  background:var(--color-accent);
  color:#fff;
  box-shadow:0 0 0 6px rgba(77,143,58,0.2);
}

.ysp-illu{
  display:none;
  opacity:0;
  transform:translateY(8px);
  transition:opacity .28s ease, transform .28s ease;
}
.ysp-illu.is-active{
  display:block;
  opacity:1;
  transform:translateY(0);
}

.ysp-illu.is-anim{
  animation:yspFadeUp .32s ease both;
}
@keyframes yspFadeUp{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:translateY(0); }
}

/* Acceso: panel lateral (estilo premium / referencia KPI) */
.ysp-acceso-hero{
  background:
    radial-gradient(ellipse 70% 55% at 12% 35%, rgba(77,143,58,0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 88% 8%, rgba(77,143,58,0.14), transparent 52%),
    #2a3d32;
}

.ysp-acceso-stat{
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.05);
  padding:18px 10px;
  text-align:center;
  box-shadow:0 8px 32px rgba(0,0,0,0.3);
}
.ysp-acceso-stat-value{
  font-size:1.875rem;
  font-weight:900;
  letter-spacing:-0.03em;
  color:#fff;
  line-height:1.05;
}
@media (min-width:1280px){
  .ysp-acceso-stat{
    padding:22px 12px;
    border-radius:18px;
  }
  .ysp-acceso-stat-value{ font-size:2.125rem; }
}
@media (min-width:1536px){
  .ysp-acceso-stat-value{ font-size:2.35rem; }
}
.ysp-acceso-stat-label{
  margin-top:8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:rgba(255,255,255,0.45);
}
@media (min-width:1280px){
  .ysp-acceso-stat-label{ font-size:12px; }
}

.ysp-acceso-feature{
  display:flex;
  gap:16px;
  align-items:flex-start;
}
.ysp-acceso-feature-icon{
  flex-shrink:0;
  width:48px;
  height:48px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,0.1);
}
@media (min-width:1280px){
  .ysp-acceso-feature-icon{
    width:52px;
    height:52px;
    border-radius:16px;
  }
}
.ysp-acceso-feature-icon--gold{
  background:rgba(77,143,58,0.15);
  color:#86c775;
}
.ysp-acceso-feature-icon--green{
  background:rgba(34,197,94,0.12);
  color:#4ade80;
}
.ysp-acceso-feature-icon--amber{
  background:rgba(251,191,36,0.12);
  color:#fbbf24;
}

/* KPI en móvil (misma info que panel izquierdo) */
.ysp-acceso-stats--embed{
  border-radius:16px;
  background:rgba(0,0,0,0.2);
  border:1px solid rgba(255,255,255,0.1);
  padding:10px;
}
.ysp-acceso-stats--embed .ysp-acceso-stat{
  padding:10px 4px;
}
.ysp-acceso-stats--embed .ysp-acceso-stat-value{
  font-size:1.15rem;
}

.ysp-acceso-field{
  position:relative;
  display:flex;
  align-items:center;
}
.ysp-acceso-field-icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#9CA3AF;
  pointer-events:none;
}
.ysp-acceso-input{
  width:100%;
  border-radius:12px;
  border:1px solid var(--color-border);
  background:#FAFAF9;
  padding:12px 14px 12px 44px;
  font-size:15px;
  color:var(--color-text-dark);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.ysp-acceso-input::placeholder{
  color:#9CA3AF;
}
.ysp-acceso-input:focus{
  border-color:rgba(77,143,58,0.55);
  box-shadow:0 0 0 3px rgba(77,143,58,0.18);
}
.ysp-acceso-input--with-toggle{
  padding-right:48px;
}
.ysp-acceso-toggle-pw{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  padding:6px;
  border:0;
  background:transparent;
  color:#9CA3AF;
  cursor:pointer;
  border-radius:8px;
}
.ysp-acceso-toggle-pw:hover{
  color:var(--color-text-dark);
  background:rgba(0,0,0,0.04);
}
.ysp-acceso-input-plain{
  width:100%;
  border-radius:12px;
  border:1px solid var(--color-border);
  background:#FAFAF9;
  padding:12px 14px;
  font-size:15px;
  color:var(--color-text-dark);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.ysp-acceso-input-plain::placeholder{
  color:#9CA3AF;
}
.ysp-acceso-input-plain:focus{
  border-color:rgba(77,143,58,0.55);
  box-shadow:0 0 0 3px rgba(77,143,58,0.18);
}

/* Registro: segmentos jugador/entrenador (fondo claro) */
.ysp-acceso-rol{
  color:var(--color-muted);
  background:transparent;
  border:0;
  cursor:pointer;
}
.ysp-acceso-rol.is-active{
  background:var(--color-accent);
  color:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,0.06);
}
.ysp-acceso-rol:hover:not(.is-active){
  color:var(--color-text-dark);
  background:rgba(0,0,0,0.04);
}

@media (max-width: 640px){
  .ysp-timeline{
    max-width:100%;
  }
  .ysp-timeline::before{
    left:28px; /* 56px/2 */
  }
  .ysp-timeline-step{
    grid-template-columns:56px 1fr;
    gap:14px;
  }
  .ysp-timeline-marker{
    width:44px;
    height:44px;
  }
}

/* Modalidades PRO — tarjetas MONITOR / PLAYER */
.ysp-pro-benefit{
  display:flex;
  gap:10px;
  align-items:flex-start;
  line-height:1.45;
}
.ysp-pro-benefit-icon{
  flex-shrink:0;
  width:28px;
  height:28px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(77,143,58,0.12);
  color:var(--primary);
}
.ysp-pro-benefit-icon--player{
  background:rgba(63,71,80,0.1);
  color:var(--color-primary);
}
.ysp-pro-card-visual img{
  display:block;
}

/* Lista prioritaria: selector de modalidad (clic claro, estado seleccionado verde suave) */
.ysp-perfil-choice{
  position:relative;
  display:block;
  border-radius:1rem;
  border:2px solid var(--color-border);
  padding:1rem 1rem 1rem 1.125rem;
  cursor:pointer;
  background:#fff;
  transition:
    border-color .22s ease,
    background-color .22s ease,
    box-shadow .22s ease,
    transform .18s ease;
}
.ysp-perfil-choice:hover{
  border-color:rgba(77,143,58,0.42);
  background:rgba(77,143,58,0.04);
  box-shadow:0 2px 12px rgba(63,71,80,0.06);
}
.ysp-perfil-choice:active{
  transform:scale(0.985);
}
.ysp-perfil-choice:has(input:checked){
  border-color:var(--color-accent);
  background:linear-gradient(145deg, rgba(77,143,58,0.11) 0%, rgba(77,143,58,0.06) 100%);
  box-shadow:
    0 0 0 1px rgba(77,143,58,0.18),
    0 6px 20px rgba(77,143,58,0.12);
}
.ysp-perfil-choice:has(input:checked) .font-bold{
  color:var(--color-text-dark);
}
.ysp-perfil-choice-input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
  z-index:3;
  appearance:none;
  -webkit-appearance:none;
}
.ysp-perfil-choice-indicator{
  position:absolute;
  top:1rem;
  right:1rem;
  width:1.375rem;
  height:1.375rem;
  border-radius:999px;
  border:2px solid #d1d5db;
  background:#fff;
  z-index:2;
  transition:
    border-color .22s ease,
    background-color .22s ease,
    box-shadow .22s ease,
    transform .22s ease;
  pointer-events:none;
}
.ysp-perfil-choice:hover .ysp-perfil-choice-indicator{
  border-color:rgba(77,143,58,0.55);
}
.ysp-perfil-choice:has(input:checked) .ysp-perfil-choice-indicator{
  border-color:var(--color-accent);
  background-color:var(--color-accent);
  box-shadow:0 0 0 3px rgba(77,143,58,0.2);
  transform:scale(1.05);
}
.ysp-perfil-choice:has(input:checked) .ysp-perfil-choice-indicator::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:0.55rem;
  height:0.32rem;
  border:2px solid #fff;
  border-top:none;
  border-right:none;
  transform:translate(-50%,-60%) rotate(-45deg);
}
.ysp-perfil-choice-input:focus{
  outline:none;
}
.ysp-perfil-choice:has(.ysp-perfil-choice-input:focus-visible){
  outline:2px solid rgba(77,143,58,0.45);
  outline-offset:2px;
}
.ysp-perfil-choice:has(.ysp-perfil-choice-input:focus-visible) .ysp-perfil-choice-indicator{
  box-shadow:0 0 0 3px rgba(77,143,58,0.35);
}

