/* =========================================================
   IRSI – Índice de Retribución Social Individual
   CSS Global | Marco · 2026
   ========================================================= */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta */
  --primary:      #1a6b4a;
  --primary-light:#2ea66e;
  --primary-dark: #0f4530;
  --accent:       #f4a830;
  --accent-dark:  #c47a10;
  --bg:           #f7faf8;
  --bg-card:      #ffffff;
  --text:         #1c2b22;
  --text-muted:   #6b7e74;
  --border:       #d4e8dc;
  --red:          #e05252;
  --orange:       #f08c3a;
  --yellow:       #e8c84a;
  --green:        #3db87a;
  --emerald:      #1a6b4a;

  /* Dimensiones */
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(26,107,74,0.10);
  --shadow-lg:    0 8px 40px rgba(26,107,74,0.16);

  /* Tipografía */
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ---------- HERO HEADER ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: white;
  padding: 56px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  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 fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%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");
  pointer-events: none;
}
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -.02em;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: clamp(14px, 2vw, 17px);
  opacity: .85;
  max-width: 580px;
  margin: 0 auto 28px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 26px; font-weight: 800; }
.hero-stat span { font-size: 12px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- PROGRESS BAR ---------- */
.progress-wrap {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.progress-inner {
  max-width: 720px;
  margin: 0 auto;
}
.progress-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.progress-label strong { color: var(--primary); font-weight: 700; }
.progress-label span { color: var(--text-muted); }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.progress-steps {
  display: flex; gap: 6px; margin-top: 10px;
}
.progress-steps .step-dot {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--border);
  transition: background .4s;
}
.progress-steps .step-dot.active { background: var(--primary); }
.progress-steps .step-dot.done { background: var(--primary-light); }

/* ---------- MAIN LAYOUT ---------- */
.main-container {
  max-width: 720px;
  margin: -36px auto 0;
  padding: 0 16px 80px;
  position: relative;
}

/* ---------- STEP CARD ---------- */
.step-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 36px;
  box-shadow: var(--shadow);
  animation: slideUp .4s cubic-bezier(.4,0,.2,1);
  display: none;
}
.step-card.active { display: block; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-header { margin-bottom: 28px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  margin-bottom: 12px;
}
.step-title {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}
.step-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- ODS BADGE ---------- */
.ods-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #e8f5ee, #d0f0e0);
  color: var(--primary);
  border: 1px solid #b0ddc0;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 11px; font-weight: 600;
  margin-bottom: 16px;
}

/* ---------- OPTIONS ---------- */
.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: all .22s ease;
  position: relative;
  user-select: none;
}
.option-btn:hover {
  border-color: var(--primary-light);
  background: #f0faf5;
  transform: translateX(3px);
}
.option-btn.selected {
  border-color: var(--primary);
  background: #e8f5ee;
  color: var(--primary-dark);
  font-weight: 600;
}
.option-btn.selected .opt-icon { background: var(--primary); color: white; }
.opt-icon {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  transition: all .22s;
}
.opt-text { flex: 1; }
.opt-score {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.option-btn.selected .opt-score { color: var(--primary); }

/* Multi-select badge */
.option-btn input[type="checkbox"] { display: none; }
.option-btn.multi.selected::after {
  content: '✓';
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- INGRESOS SLIDER VISUAL ---------- */
.income-grid {
  display: grid; gap: 10px;
}
.income-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: all .22s;
  font-family: var(--font);
}
.income-btn:hover { border-color: var(--primary-light); background: #f0faf5; }
.income-btn.selected { border-color: var(--primary); background: #e8f5ee; }
.income-label { font-size: 14px; font-weight: 600; }
.income-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.income-smmlv {
  background: var(--primary);
  color: white;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 11px; font-weight: 700;
}

/* ---------- NAVIGATION BUTTONS ---------- */
.nav-btns {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px; gap: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .22s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,107,74,.3); }
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary-light); color: var(--primary); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  font-size: 16px;
  padding: 14px 32px;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(244,168,48,.4); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ---------- OPT-IN SCREEN ---------- */
.optin-screen {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 44px 36px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .4s cubic-bezier(.4,0,.2,1);
  display: none;
  text-align: center;
}
.optin-screen.active { display: block; }

.optin-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}
.optin-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.optin-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }

.optin-preview {
  background: linear-gradient(135deg, #f0faf5, #e8f5ee);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.optin-preview::after {
  content: '';
  position: absolute; inset: 0;
  backdrop-filter: blur(6px);
  background: rgba(247,250,248,.5);
  display: flex; align-items: center; justify-content: center;
}
.optin-preview-content {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.preview-metric { text-align: center; }
.preview-metric strong { display: block; font-size: 28px; font-weight: 800; color: var(--primary); }
.preview-metric span { font-size: 11px; color: var(--text-muted); }
.blur-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(247,250,248,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
}
.blur-overlay .lock-icon { font-size: 28px; }
.blur-overlay p { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.optin-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  transition: border-color .2s;
  background: var(--bg);
}
.form-group input:focus { outline: none; border-color: var(--primary); background: white; }
.form-group input.error { border-color: var(--red); }
.form-group .err-msg { color: var(--red); font-size: 12px; margin-top: 4px; display: none; }
.form-group.has-error .err-msg { display: block; }

.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left; font-size: 13px; color: var(--text-muted);
}
.consent-row input[type="checkbox"] {
  width: 16px; min-width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--primary);
}

/* ---------- RESULTS SCREEN ---------- */
.results-screen {
  display: none;
  animation: slideUp .5s cubic-bezier(.4,0,.2,1);
}
.results-screen.active { display: block; }

/* Score ring */
.score-ring-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 20px;
}
.ring-container {
  position: relative;
  width: 200px; height: 200px;
  margin: 0 auto 24px;
}
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 12; }
.ring-fill {
  fill: none; stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.5s cubic-bezier(.4,0,.2,1);
}
.ring-score-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-score-num {
  font-size: 48px; font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ring-score-max { font-size: 16px; color: var(--text-muted); margin-top: 2px; }

.nivel-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  border-radius: 99px;
  font-size: 16px; font-weight: 700;
  margin-bottom: 12px;
}
.nivel-badge.emergente   { background: #ffe8e8; color: #c0392b; border: 1.5px solid #f5b7b1; }
.nivel-badge.desarrollo  { background: #fff4e0; color: #d35400; border: 1.5px solid #f9bf7b; }
.nivel-badge.consolidado { background: #e8f8f5; color: #1e8449; border: 1.5px solid #a9dfbf; }
.nivel-badge.ejemplar    { background: #e8f5ee; color: var(--primary-dark); border: 1.5px solid #aed6bb; }

.score-desc { font-size: 15px; color: var(--text-muted); max-width: 460px; margin: 0 auto; }

/* Dimension cards */
.dim-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.dim-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.dim-icon { font-size: 28px; margin-bottom: 8px; }
.dim-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.dim-score {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.dim-bar { height: 5px; background: var(--border); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 99px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }

/* ODS Alignment */
.ods-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.section-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 18px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.ods-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ods-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid;
}

/* Recommendations */
.reco-list { display: flex; flex-direction: column; gap: 12px; }
.reco-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.reco-icon { font-size: 20px; min-width: 28px; }
.reco-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.reco-text p { font-size: 13px; color: var(--text-muted); }

/* Share & CTA */
.cta-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: white;
  margin-bottom: 20px;
}
.cta-section h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.cta-section p { font-size: 14px; opacity: .8; margin-bottom: 24px; }
.share-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all .2s;
}
.share-btn:hover { transform: translateY(-2px); }
.share-wa  { background: #25D366; color: white; }
.share-li  { background: #0A66C2; color: white; }
.share-tw  { background: #1DA1F2; color: white; }
.share-copy { background: rgba(255,255,255,.2); color: white; border: 1px solid rgba(255,255,255,.3); }

/* ---------- INTRO CARD ---------- */
.intro-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 36px;
  box-shadow: var(--shadow);
  text-align: center;
}
.intro-card.active { display: block; }
.intro-ods-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin: 24px 0;
}
.ods-mini {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  text-align: center;
  color: white;
}

/* ---------- INTRO QUESTIONS ---------- */
.intro-q {
  background: #f0faf5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.intro-q p { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.intro-radio { display: flex; gap: 10px; flex-wrap: wrap; }
.intro-radio label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-size: 13px; cursor: pointer;
  transition: all .2s;
}
.intro-radio input { accent-color: var(--primary); }
.intro-radio label:hover { border-color: var(--primary-light); background: white; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  z-index: 1000;
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--primary); }
.toast.error   { background: var(--red); }

/* ---------- VALIDATION ---------- */
.error-msg {
  background: #fff0f0;
  border: 1px solid #f5b7b1;
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.error-msg.show { display: block; }

/* ---------- LOADING ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(247,250,248,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  display: none;
}
.loading-overlay.show { display: flex; }
.loader {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text-muted); font-weight: 500; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .step-card, .optin-screen, .score-ring-wrap, .ods-section, .cta-section { padding: 24px 18px; }
  .dim-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .nav-btns { flex-direction: column; }
  .nav-btns .btn { width: 100%; justify-content: center; }
  .optin-preview-content { grid-template-columns: 1fr; }
}
