/* ==========================================================================
   VARIABLES Y ANIMACIONES BASE (AQUÍ MUEVES COLORES Y TAMAÑOS)
   ========================================================================== */
:root {
  /* Colores Principales */
  --gold: #b89a5b;
  --gold-dark: #97793f;
  --gold-light: #e6d8b8;
  --ink: #2b2b2b; /* Color de texto oscuro para fondos blancos */
  --green-dark: #1e241f;
  --green-mid: #2c372f;
  --off-white: #fdfcf9;
  --gray-light: #e8e7e3;
  --gray-text: #5c615b;
  
  /* Tipografías Modernas y Geométricas */
  --serif: 'Montserrat', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Sombras y Bordes */
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  
  /* Configuración de tamaño de bordes redondeados */
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* Grosor de la línea inferior de las tarjetas de nivel */
  --level-border-width: 8px; 
  
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Retrasos en cascada (Stagger) para grids */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse-bg {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes shine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ==========================================================================
   1. HEADER Y NAVEGACIÓN COMPARTIDA
   ========================================================================== */
.site-header { background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); border-bottom: 1px solid var(--gray-light); position: sticky; top: 0; z-index: 50; }
.header-inner { align-items: center; display: grid; grid-template-columns: 1fr auto 1fr; min-height: 72px; }
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.2em; }
.brand span { color: var(--gold); }
.header-actions { align-items: center; display: flex; gap: 18px; justify-content: flex-end; }
.header-actions a { align-items: center; display: flex; font-size: 0.68rem; gap: 6px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--ink); transition: var(--transition); }
.header-actions a:hover { color: var(--gold); }
.main-nav { display: flex; gap: 34px; justify-content: center; }
.main-nav a { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--ink); position: relative; }
.main-nav a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 2px; background: var(--gold); transition: width 0.3s ease; }
.main-nav a:hover::after, .main-nav [aria-current='page']::after { width: 100%; }

/* ==========================================================================
   2. HERO EMBAJADORES (CON PATRÓN SUTIL ANIMADO)
   ========================================================================== */
.ambassador-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding-block: 80px;
  overflow: hidden;
  color: #ffffff;
}

.hero-background-pattern {
  position: absolute;
  inset: -10%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='[http://www.w3.org/2000/svg](http://www.w3.org/2000/svg)' width='140' height='242' viewBox='0 0 140 242'%3E%3Cg fill='none' stroke='rgba(212, 175, 55, 0.08)' stroke-width='1.5'%3E%3Ccircle cx='-70' cy='-121' r='140'/%3E%3Ccircle cx='70' cy='-121' r='140'/%3E%3Ccircle cx='210' cy='-121' r='140'/%3E%3Ccircle cx='0' cy='0' r='140'/%3E%3Ccircle cx='140' cy='0' r='140'/%3E%3Ccircle cx='-70' cy='121' r='140'/%3E%3Ccircle cx='70' cy='121' r='140'/%3E%3Ccircle cx='210' cy='121' r='140'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 140px 242px;
  z-index: 1;
  animation: pulse-bg 20s infinite ease-in-out;
}

.ambassador-hero-grid { position: relative; z-index: 2; }
.ambassador-hero-copy { max-width: 600px; }
.ambassador-hero .eyebrow { color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; font-size: 0.8rem; margin-bottom: 15px; display: block; font-family: var(--sans); }
.ambassador-hero h1 { font-family: var(--serif); font-size: clamp(2.5rem, 4.5vw, 4.2rem); font-weight: 800; line-height: 1.1; margin-bottom: 20px; text-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.ambassador-hero p:not(.eyebrow) { color: rgba(255,255,255,0.85); font-size: 1.1rem; font-family: var(--sans); line-height: 1.6; margin-bottom: 35px; }

/* Botones con efectos */
.btn-primary { 
  display: inline-flex; justify-content: center; align-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); 
  color: #ffffff; padding: 15px 36px; font-family: var(--sans); font-size: 0.85rem; 
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; 
  border-radius: 8px; border: none; cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 15px rgba(184, 154, 91, 0.4);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(184, 154, 91, 0.6); }

.btn-secondary { 
  display: inline-flex; justify-content: center; align-items: center;
  background-color: transparent; color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.5); 
  padding: 15px 36px; font-family: var(--sans); font-size: 0.85rem; font-weight: 700; 
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; border-radius: 8px; 
  transition: var(--transition); backdrop-filter: blur(5px);
}
.btn-secondary:hover { background-color: #ffffff; color: var(--ink); transform: translateY(-3px); }

/* ==========================================================================
   3. SECCIONES GENERALES Y BENEFICIOS
   ========================================================================== */
.benefits-section { padding-top: 100px; padding-bottom: 60px; }
.centered-heading { text-align: center; margin-inline: auto; margin-bottom: 60px; max-width: 650px; }
.centered-heading .eyebrow { color: var(--gray-text); font-size: 0.8rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 12px; display: block; }
.centered-heading h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 15px; color: var(--ink); }
.centered-heading p:not(.eyebrow) { color: var(--gray-text); font-family: var(--sans); font-size: 1.05rem; line-height: 1.6; }

.benefits-grid-4 { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.benefit-card { 
  background: #ffffff; border: 1px solid #f0efeb; padding: 45px 30px; 
  text-align: center; border-radius: var(--radius-lg); 
  transition: var(--transition); box-shadow: var(--shadow-sm); 
}
.benefit-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--gold-light); }

.benefit-card .benefit-icon { 
  width: 65px; height: 65px; margin: 0 auto 25px; 
  background: var(--off-white); border: 2px solid var(--gold); 
  border-radius: 50%; display: flex; align-items: center; justify-content: center; 
  color: var(--gold-dark); transition: var(--transition);
}
.benefit-card:hover .benefit-icon { background: var(--gold); color: #fff; transform: scale(1.1); }
.benefit-card h3 { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; margin-bottom: 12px; color: var(--ink); }
.benefit-card p { font-size: 0.95rem; font-family: var(--sans); color: var(--gray-text); line-height: 1.6; }

/* ==========================================================================
   4. NIVELES YAXCHÉ (DISEÑO BLANCO CON LÍNEA INFERIOR)
   ========================================================================== */
.levels-section { padding: 80px 20px; background: #fdfdfc; border-block: 1px solid var(--gray-light); }
.levels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; margin-top: 40px; }

/* Tarjeta Base de Nivel */
.level-card {
background-image: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)), url(../logos/arbol1.png);
background-size: cover;
background-position: left;
background-repeat: no-repeat;  padding: 35px 25px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex; 
  flex-direction: column; 
  gap: 15px;
  position: relative; 
  overflow: hidden;
  color: var(--ink);
  border: 1px solid var(--gray-light);
  /* Esta es la base para la línea de color de abajo */
  border-bottom: var(--level-border-width) solid transparent; 
}

.level-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: var(--shadow-lg); }

.level-card h3 { font-size: 1.3rem; margin: 0; font-weight: 700; letter-spacing: 0.05em; font-family: var(--sans); color: var(--ink); }
.level-discount { font-size: 3.5rem; font-weight: 800; line-height: 1; font-family: var(--serif); margin-block: 10px; display: block; }
.level-card p { font-size: 0.95rem; font-family: var(--sans); margin: 0; line-height: 1.5; color: var(--gray-text); }

/* Clases de Colores para cada Nivel */
.level-rojo {
  border-bottom-color: #b95245;
}
.level-rojo .level-discount { color: #b95245; }

.level-amarillo {
  border-bottom-color: #d4af37;
}
.level-amarillo .level-discount { color: #d4af37; }

.level-negro {
  border-bottom-color: #111111;
}
.level-negro .level-discount { color: #111111; }

.level-blanco {
  border-bottom-color: #d4d8cf;
}
.level-blanco .level-discount { color: #5c615b; }

.level-verde {
  border-bottom-color: #4b6b55;
}
.level-verde .level-discount { color: #4b6b55; }


/* ==========================================================================
   5. PROGRAMA DE INVITACIONES / RECOMPENSAS
   ========================================================================== */
.rewards-section { padding-block: 80px; }
.rewards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; margin-top: 40px; }

.reward-card {
  background: #fff; border: 1px solid #f0efeb; border-radius: var(--radius-lg);
  padding: 30px 20px; text-align: center; position: relative;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.reward-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.reward-badge {
  display: inline-block; background: #f0f7f1; color: #2e7d32;
  font-weight: 700; font-family: var(--sans); font-size: 0.75rem; padding: 6px 12px;
  border-radius: 20px; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.reward-card h3 { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; margin-bottom: 10px; color: var(--ink); }
.reward-card p { font-size: 0.95rem; font-family: var(--sans); color: var(--gray-text); line-height: 1.5; }
.reward-icon { margin-bottom: 1rem; color: var(--green-mid); transition: var(--transition); }
.reward-card:hover .reward-icon { animation: float 2s ease-in-out infinite; color: var(--gold); }

/* Highlight Card (Kit Yaxché) */
.reward-card.highlight {
  border: 2px solid var(--gold); background: var(--off-white);
  transform: scale(1.05); z-index: 2;
}
.reward-card.highlight:hover { transform: scale(1.05) translateY(-5px); }
.reward-card.highlight .reward-icon { color: var(--gold-dark); }
.reward-badge.gold { background: rgba(184, 154, 91, 0.15); color: var(--gold-dark); }

/* Efecto Shimmer dinámico para la tarjeta premium */
.shimmer-effect {
  position: relative; overflow: hidden;
}
.shimmer-effect::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
  transform: skewX(-20deg); animation: shine 4s infinite;
}

/* ==========================================================================
   6. CÓMO FUNCIONA (3 PASOS)
   ========================================================================== */
.how-it-works-section { padding-block: 80px; background: #faf9f6; }
.steps-grid { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.step-card { text-align: center; padding: 40px 30px; background: #ffffff; border-radius: var(--radius-lg); border: 1px solid var(--gray-light); box-shadow: var(--shadow-sm); transition: var(--transition); }
.step-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--gold-light); }

.step-number {
  font-family: var(--serif); font-weight: 800; font-size: 2.2rem; color: var(--gold);
  background: var(--off-white); width: 75px; height: 75px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin: 0 auto 25px; border: 2px dashed var(--gold-light);
  transition: var(--transition);
}
.step-card:hover .step-number { background: var(--gold); color: #fff; border-style: solid; transform: scale(1.1); }
.step-card h3 { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--ink); margin-bottom: 15px; }
.step-card p { color: var(--gray-text); font-family: var(--sans); font-size: 0.95rem; line-height: 1.6; }

/* ==========================================================================
   7. PREGUNTAS FRECUENTES (FAQ)
   ========================================================================== */
.faq-section { padding-block: 100px; }
.faq-grid { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.faq-item {
  background: #ffffff; border: 1px solid var(--gray-light);
  border-radius: var(--radius-md); overflow: hidden; transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.faq-item:hover { border-color: var(--gold-light); box-shadow: var(--shadow-sm); }

.faq-item summary {
  padding: 25px 30px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  color: var(--ink); cursor: pointer;
  position: relative; list-style: none; user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  font-family: var(--sans); font-size: 1.8rem; color: var(--gold); font-weight: 300;
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after { content: '-'; transform: translateY(-50%) rotate(90deg); color: var(--gold-dark); }
.faq-item[open] summary { color: var(--gold-dark); border-bottom: 1px dashed var(--gray-light); }
.faq-content {
  padding: 25px 30px; color: var(--gray-text); font-family: var(--sans); font-size: 1rem; line-height: 1.7;
  animation: fadeUp 0.4s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   8. PORTAL (INVITACIÓN Y LOGIN)
   ========================================================================== */
.portal-section { padding-bottom: 120px; }
.portal-wrapper { 
  display: grid; grid-template-columns: 1.1fr 0.9fr; 
  background: #ffffff; border-radius: var(--radius-lg); 
  overflow: hidden; box-shadow: var(--shadow-lg); 
  border: 1px solid var(--gray-light); 
}

.portal-invite { 
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='[http://www.w3.org/2000/svg'%3E%3Cg](http://www.w3.org/2000/svg'%3E%3Cg) fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"), 
              linear-gradient(145deg, var(--green-mid), var(--green-dark)); 
  color: #ffffff; padding: 70px 60px; display: flex; flex-direction: column; justify-content: center; 
}
.portal-invite h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1.2; margin-bottom: 20px; }
.portal-invite p { color: rgba(255,255,255,0.85); font-family: var(--sans); font-size: 1.05rem; line-height: 1.7; margin-bottom: 40px; }

.portal-login { padding: 70px 60px; background: var(--off-white); }
.portal-login h3 { font-family: var(--serif); font-weight: 700; font-size: 2rem; margin-bottom: 10px; color: var(--ink); }
.portal-login > p { color: var(--gray-text); font-family: var(--sans); font-size: 1rem; margin-bottom: 35px; }

.alert-error { background: #fdf0ed; border: 1px solid #c05c4b; color: #c05c4b; padding: 12px; margin-bottom: 25px; text-align: center; font-size: 0.9rem; border-radius: 8px; font-weight: 500; font-family: var(--sans); }

.yaxche-form .form-group { margin-bottom: 25px; }
.yaxche-form label { display: block; font-size: 0.8rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-text); margin-bottom: 10px; }
.yaxche-form input[type="text"], .yaxche-form input[type="email"], .yaxche-form input[type="password"] { 
  width: 100%; padding: 16px 20px; border: 1px solid #d4d8cf; border-radius: 8px; 
  background: #ffffff; font-family: var(--sans); font-size: 1rem; color: var(--ink); 
  transition: var(--transition); box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}
.yaxche-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 154, 91, 0.1); }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.remember-me { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 0.9rem; text-transform: none !important; font-weight: 400 !important; cursor: pointer; }
.forgot-password { font-size: 0.85rem; font-family: var(--sans); color: var(--gold-dark); text-decoration: none; font-weight: 500; }
.forgot-password:hover { text-decoration: underline; color: var(--gold); }

.login-footer-prompt { text-align: center; margin-top: 35px; font-size: 0.95rem; font-family: var(--sans); color: var(--gray-text); border-top: 1px solid var(--gray-light); padding-top: 25px; }
.login-footer-prompt a { color: var(--gold-dark); font-weight: 700; text-decoration: none; transition: var(--transition); }
.login-footer-prompt a:hover { color: var(--gold); text-decoration: underline; }

/* Ajustes Responsive Generales */
@media (max-width: 992px) {
  .portal-wrapper { grid-template-columns: 1fr; }
  .reward-card.highlight { transform: scale(1); }
  .reward-card.highlight:hover { transform: translateY(-5px); }
}

@media (max-width: 768px) {
  .ambassador-hero { padding-block: 60px; text-align: center; }
  .ambassador-hero-copy { margin: 0 auto; }
  .ambassador-hero h1 { font-size: 2.8rem; }
  .benefits-grid-4, .levels-grid, .rewards-grid, .steps-grid { grid-template-columns: 1fr; }
  .portal-invite, .portal-login { padding: 40px 30px; }
  .faq-item summary { font-size: 1.1rem; padding: 20px; }
  .step-card { padding: 30px 20px; }
}