/* ==========================================================================
   DondeRinde - Hoja de Estilo Oficial (Fintech UI System)
   Colores de Marca: Navy #0A1931, Blue #0056B3, Green #00A859, Lime #7ED957
   ========================================================================== */

:root {
  --navy: #0A1931;
  --navy-dark: #061021;
  --navy-light: #152A4A;
  --blue: #0056B3;
  --blue-hover: #004494;
  --green: #00A859;
  --green-light: #e6f7ef;
  --lime: #7ED957;
  --lime-soft: #f1fbe9;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navbar */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo,
.brand-logo img,
img.brand-logo,
a.brand-logo img {
  height: 40px;
  max-height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--blue);
}

.header-badge {
  background: var(--lime-soft);
  color: var(--green);
  border: 1px solid var(--lime);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 168, 89, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--lime);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero h1 span {
  color: var(--lime);
}

.hero p {
  font-size: 1.15rem;
  color: var(--gray-300);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Tabs System */
.tabs-nav-container {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.5rem 0;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.tab-btn.active {
  background: var(--navy);
  color: var(--white);
}

.tab-btn.active .tab-icon {
  filter: brightness(0) invert(1);
}

/* Quick Interactive Simulator */
.simulator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.sim-header h3 {
  font-size: 1.2rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 0.85rem;
  color: var(--gray-400);
  font-weight: 600;
}

.sim-input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease;
}

.sim-input:focus {
  border-color: var(--blue);
  background: var(--white);
}

.sim-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

/* Live Sim Output Banner */
.sim-results-banner {
  background: linear-gradient(to right, #0A1931, #152A4A);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.sim-stat .label {
  font-size: 0.75rem;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sim-stat .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--lime);
  margin-top: 0.2rem;
}

.sim-stat .sub {
  font-size: 0.75rem;
  color: var(--gray-300);
}

.protection-alert-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-safe {
  background: var(--green-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.5rem 0 1.25rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  border-color: var(--blue);
}

.card:active {
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.inst-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.inst-product {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.15rem;
}

.rate-badge {
  text-align: right;
}

.rate-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}

.rate-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  text-transform: uppercase;
  font-weight: 600;
}

.card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: var(--gray-50);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.82rem;
}

.spec-item .spec-label {
  color: var(--gray-500);
  display: block;
}

.spec-item .spec-value {
  font-weight: 700;
  color: var(--gray-800);
}

.badge-protection {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-ipab {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-prosofipo {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-focoop {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-cetes {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Audit Footer on Cards */
.card-audit {
  border-top: 1px solid var(--gray-100);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.btn-audit {
  background: transparent;
  border: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  margin-top: 0.75rem;
  transition: background 0.2s ease;
}

.btn-cta:hover {
  background: var(--blue);
}

/* Modal for Audit Verification */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 49, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--gray-100);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--navy-dark);
  color: var(--gray-400);
  padding: 4rem 0 2rem;
  font-size: 0.88rem;
  border-top: 1px solid var(--navy-light);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 1rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--lime);
}

.footer-disclaimer {
  border-top: 1px solid var(--navy-light);
  padding-top: 2rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .navbar {
    height: 60px;
  }
  .nav-links {
    display: none;
  }
}

/* Scenario Quick Pickers */
.scenario-pickers {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.picker-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.picker-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  min-width: 60px;
}

.pill-btn {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--navy);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--gray-100);
  border-color: var(--blue);
}

.pill-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.pill-btn.special-pill {
  border-color: var(--lime);
  background: var(--lime-soft);
  color: #065f46;
}

.pill-btn.special-pill.active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

/* Card Rate Conditions Badge */
.badge-condition {
  display: inline-block;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
}

.metric-tag {
  font-size: 0.72rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Chart Styles */
.chart-dot {
  cursor: pointer;
  transition: r 0.15s ease, stroke-width 0.15s ease;
}
.chart-dot:hover {
  r: 7;
  stroke: var(--white);
  stroke-width: 2px;
}
.legend-item:hover {
  opacity: 0.75;
}

/* ==========================================================================
   Radar Económico & Calendario Oficial UI
   ========================================================================== */
.radar-home-banner {
  background: var(--navy-dark);
  border-bottom: 1px solid var(--navy-light);
  padding: 0.6rem 0;
  color: var(--white);
  font-size: 0.85rem;
}

.radar-ticker-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.radar-ticker-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--lime);
  flex-shrink: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(126, 217, 87, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(126, 217, 87, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(126, 217, 87, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(126, 217, 87, 0); }
}

.radar-ticker-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  padding: 0.1rem 0;
}

.radar-ticker-item {
  color: var(--gray-300);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.15s;
}

.radar-ticker-item:hover {
  color: var(--white);
}

.radar-ticker-item strong {
  color: var(--white);
}

.btn-radar-link {
  background: transparent;
  color: var(--lime);
  border: 1px solid rgba(126, 217, 87, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-radar-link:hover {
  background: var(--lime);
  color: var(--navy-dark);
}

/* Radar Cards Feed */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.radar-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.radar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.radar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radar-inst-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.radar-inst-banxico { background: #e0e7ff; color: #3730a3; }
.radar-inst-inegi { background: #ccfbf1; color: #115e59; }
.radar-inst-shcp { background: #fae8ff; color: #86198f; }
.radar-inst-bmv { background: #fef3c7; color: #92400e; }
.radar-inst-biva { background: #e0f2fe; color: #0369a1; }

.radar-impact-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.radar-impact-high { background: #fee2e2; color: #991b1b; }
.radar-impact-medium { background: #fef9c3; color: #854d0e; }
.radar-impact-low { background: #f1f5f9; color: #475569; }

.radar-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin: 0.35rem 0;
}

.radar-card-date {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.radar-what-changed {
  background: var(--gray-50);
  border-left: 3px solid var(--blue);
  padding: 0.6rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--gray-700);
  line-height: 1.45;
}

.radar-why-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  color: #166534;
  line-height: 1.4;
}

.radar-why-box strong {
  color: #14532d;
  display: block;
  margin-bottom: 0.2rem;
}

.radar-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.radar-btn-sim {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.radar-btn-sim:hover {
  background: var(--blue);
}

.radar-official-link {
  font-size: 0.78rem;
  color: var(--blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.radar-official-link:hover {
  text-decoration: underline;
}

/* Timeline & Calendario Oficial */
.radar-calendar-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.radar-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.radar-table th {
  background: var(--gray-100);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

.radar-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

.radar-table tr:hover td {
  background: var(--gray-50);
}

.radar-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.status-scheduled { background: #e0f2fe; color: #0369a1; }
.status-today { background: #fef08a; color: #854d0e; }
.status-published { background: #dcfce7; color: #15803d; }

/* Escenario Alternativo Banner */
.scenario-alert-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: #92400e;
}

.scenario-alert-banner button {
  background: #f59e0b;
  color: var(--white);
  border: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.scenario-alert-banner button:hover {
  background: #d97706;
}


