/* ==========================================================================
   ESTILOS - PORTAL DE MATEMÁTICAS (CENTRO INTEGRAL TALENTIA)
   Plataforma central para División, Multiplicación y Resta
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  
  --multiplica-from: #8b5cf6;
  --multiplica-to: #6366f1;
  --multiplica-glow: rgba(139, 92, 246, 0.28);
  
  --divide-from: #0284c7;
  --divide-to: #06b6d4;
  --divide-glow: rgba(2, 132, 199, 0.28);
  
  --resta-from: #059669;
  --resta-to: #10b981;
  --resta-glow: rgba(16, 185, 129, 0.28);
  
  --accent-orange: #f59e0b;
  --accent-amber: #fbbf24;
  
  --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 40%, #fdf2f8 80%, #fef3c7 100%);
  --surface-card: rgba(255, 255, 255, 0.94);
  --surface-border: rgba(226, 232, 240, 0.9);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  
  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.15);
  --shadow-hover: 0 25px 45px -12px rgba(79, 70, 229, 0.25);
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   DECORACIONES FLOTANTES EN EL FONDO
   ========================================================================== */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  opacity: 0.12;
  font-family: 'Fredoka', cursive;
  font-weight: 700;
  color: var(--primary);
  user-select: none;
  animation: floatSlow 18s ease-in-out infinite alternate;
}

.shape-1 { font-size: 5rem; top: 12%; left: 4%; animation-delay: 0s; color: var(--divide-from); }
.shape-2 { font-size: 4.5rem; top: 22%; right: 6%; animation-delay: 3s; color: var(--multiplica-from); }
.shape-3 { font-size: 5rem; top: 58%; left: 6%; animation-delay: 1.5s; color: var(--resta-from); }
.shape-4 { font-size: 4rem; top: 68%; right: 8%; animation-delay: 4.5s; color: var(--accent-orange); }
.shape-5 { font-size: 3.5rem; top: 88%; left: 20%; animation-delay: 2s; color: #ec4899; }
.shape-6 { font-size: 3.8rem; top: 4%; left: 48%; animation-delay: 5s; color: #8b5cf6; }
.shape-7 { font-size: 3rem; top: 40%; right: 2%; animation-delay: 2.5s; color: #0284c7; }
.shape-8 { font-size: 3.2rem; top: 82%; right: 25%; animation-delay: 3.5s; color: #10b981; }

@keyframes floatSlow {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(15deg); }
  100% { transform: translateY(15px) rotate(-10deg); }
}

/* ==========================================================================
   BANNER SUPERIOR DEDICATORIA
   ========================================================================== */
.floating-dedication-banner {
  position: relative;
  z-index: 20;
  background: linear-gradient(90deg, #fdf2f8 0%, #ede9fe 50%, #e0f2fe 100%);
  border-bottom: 1px solid rgba(224, 231, 255, 0.8);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.08);
}

.banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.92rem;
  color: #4338ca;
  text-align: center;
}

.banner-sparkle {
  font-size: 1.15rem;
  animation: pulseSparkle 2s ease-in-out infinite;
}

.talentia-name-link {
  color: #4f46e5;
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.2s;
}

.talentia-name-link:hover {
  color: #3730a3;
}

.btn-close-banner {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  color: #6366f1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s;
  margin-left: auto;
}

.btn-close-banner:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #3730a3;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* ==========================================================================
   HEADER PRINCIPAL
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  box-shadow: 0 6px 14px -3px rgba(79, 70, 229, 0.2);
  border: 2px solid #ffffff;
}

.brand-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.3px;
}

.btn-talentia-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1.5px solid #e0e7ff;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-talentia-link:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   PORTAL MAIN CONTAINER
   ========================================================================== */
.portal-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-md);
  padding: 40px;
  margin-bottom: 48px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50px;
  margin-bottom: 18px;
}

.hero-heading {
  font-family: 'Fredoka', cursive;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 18px;
}

.highlight-word {
  background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-description strong {
  color: var(--text-main);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-family: 'Fredoka', cursive;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 10px 25px -4px rgba(79, 70, 229, 0.45);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-cta-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 32px -4px rgba(79, 70, 229, 0.55);
}

.hero-stats-mini {
  display: flex;
  gap: 20px;
  align-items: center;
}

.mini-stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: 'Fredoka', cursive;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Media Image */
.hero-media {
  position: relative;
}

.image-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.25);
  border: 4px solid #ffffff;
  background: #ffffff;
  transition: transform 0.4s ease;
}

.image-wrapper:hover {
  transform: translateY(-4px) scale(1.015);
}

.hero-math-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 4px);
}

.img-badge-overlay {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   MODULES SECTION (TARJETAS DE OPERACIONES)
   ========================================================================== */
.modules-section {
  margin-bottom: 50px;
}

.section-title-wrapper {
  text-align: center;
  margin-bottom: 36px;
}

.section-subtitle {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-title {
  font-family: 'Fredoka', cursive;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.module-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-md);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
}

.card-multiplica .card-glow { background: linear-gradient(90deg, var(--multiplica-from), var(--multiplica-to)); }
.card-divide .card-glow { background: linear-gradient(90deg, var(--divide-from), var(--divide-to)); }
.card-resta .card-glow { background: linear-gradient(90deg, var(--resta-from), var(--resta-to)); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.icon-bubble {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', cursive;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  transition: transform 0.3s ease;
}

.module-card:hover .icon-bubble {
  transform: scale(1.12) rotate(5deg);
}

.bubble-multiplica { background: linear-gradient(135deg, var(--multiplica-from), var(--multiplica-to)); }
.bubble-divide { background: linear-gradient(135deg, var(--divide-from), var(--divide-to)); }
.bubble-resta { background: linear-gradient(135deg, var(--resta-from), var(--resta-to)); }

.card-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 50px;
  letter-spacing: 0.3px;
}

.tag-multiplica { background: #f3e8ff; color: #7e22ce; }
.tag-divide { background: #e0f2fe; color: #0369a1; }
.tag-resta { background: #d1fae5; color: #065f46; }

.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.card-features {
  list-style: none;
  margin-top: auto;
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-features li {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #10b981;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-footer {
  margin-top: 10px;
}

.btn-module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Fredoka', cursive;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.25s ease;
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.12);
}

.btn-module .arrow-icon {
  font-size: 1.25rem;
  transition: transform 0.25s ease;
}

.btn-module:hover .arrow-icon {
  transform: translateX(5px);
}

.btn-multiplica {
  background: linear-gradient(135deg, var(--multiplica-from), var(--multiplica-to));
}
.btn-multiplica:hover {
  box-shadow: 0 10px 24px -2px var(--multiplica-glow);
  filter: brightness(1.05);
}

.btn-divide {
  background: linear-gradient(135deg, var(--divide-from), var(--divide-to));
}
.btn-divide:hover {
  box-shadow: 0 10px 24px -2px var(--divide-glow);
  filter: brightness(1.05);
}

.btn-resta {
  background: linear-gradient(135deg, var(--resta-from), var(--resta-to));
}
.btn-resta:hover {
  box-shadow: 0 10px 24px -2px var(--resta-glow);
  filter: brightness(1.05);
}

/* ==========================================================================
   FEATURES HIGHLIGHT SECTION
   ========================================================================= */
.features-highlight-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  padding: 28px;
  backdrop-filter: blur(8px);
}

.feature-box {
  text-align: center;
  padding: 16px;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.feature-box h5 {
  font-family: 'Fredoka', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.feature-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.portal-footer {
  background: #ffffff;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 36px 24px 24px;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  font-size: 1.6rem;
  margin-bottom: 2px;
}

.footer-brand strong {
  font-family: 'Fredoka', cursive;
  font-size: 1.2rem;
  color: var(--text-main);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer-dedication {
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-dedication a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

.sub-dedication {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }
  
  .features-highlight-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 24px 20px;
  }
  
  .hero-heading {
    font-size: 1.9rem;
  }
  
  .hero-description {
    font-size: 0.98rem;
  }
  
  .header-container {
    padding: 12px 16px;
  }
  
  .brand-title {
    font-size: 1.35rem;
  }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-dedication {
    text-align: center;
  }
}
