/* CrediKip — tema claro sobre Bootstrap 5. Primero teléfono.
   Verde claro (#2FBF71) solo como fondo/acento de lo positivo, nunca como texto sobre blanco ni con texto blanco encima. */
:root {
  --ck-ink: #111111;
  --ck-bg: #ffffff;
  --ck-green-dark: #0b2b1f;
  --ck-green: #2fbf71;
  --ck-green-tint: #e7f7ee;
  --ck-amber: #b7791f;
  --ck-amber-tint: #fdf4e3;
  --ck-red: #b42318;
  --ck-red-tint: #fdecea;
  --ck-gray: #5b5f5d;
  --ck-line: #d9dedb;
  --ck-surface: #f5f7f6;
  --bs-body-color: var(--ck-ink);
  --bs-body-bg: var(--ck-bg);
  --bs-link-color: #0b2b1f;
  --bs-link-hover-color: #000;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html { scroll-behavior: smooth; }
body { font-size: 1rem; line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--ck-amber); outline-offset: 2px; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.7rem); font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--ck-gray); }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 1.75rem; padding-bottom: 1.75rem; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.lead-sm { font-size: 1.05rem; color: #2b2f2d; max-width: 60ch; }

/* Barra superior */
.topbar { background: var(--ck-green-dark); color: #fff; }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 10px; padding-bottom: 6px; }
.brand { color: #fff; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; text-decoration: none; padding: 4px 0; }
.brand:hover { color: #fff; }
.topbar-in { justify-content: space-between; }
.menu-toggle { display: none; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 8px 12px; font-weight: 650; min-height: 44px; }
.menu-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.menu-toggle:focus-visible { outline-color: #fff; }
.menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; content: ""; }
.menu-bars::before { position: absolute; top: -6px; }
.menu-bars::after { position: absolute; top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { top: 0; transform: rotate(-45deg); }
/* Móvil: sin JS el menú se ve en columna; con JS (clase `js`) se pliega tras el botón. */
.mainnav { flex: 1 1 100%; }
.mainnav ul { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0 0 8px; }
.mainnav a { display: block; color: #fff; text-decoration: none; padding: 12px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.mainnav a:hover { color: #fff; text-decoration: underline; }
.mainnav a[aria-current="page"] { font-weight: 800; box-shadow: inset 4px 0 0 #fff; padding-left: 12px; }
.js .menu-toggle { display: inline-flex; }
.js .mainnav { display: none; }
.js .mainnav.open { display: block; }
@media (min-width: 768px) {
  .js .menu-toggle, .menu-toggle { display: none; }
  .js .mainnav, .mainnav { display: block; flex: 1 1 auto; }
  .mainnav ul { flex-direction: row; justify-content: flex-end; gap: 2px; padding: 0; }
  .mainnav a { padding: 10px 12px; border-bottom: 3px solid transparent; font-size: 0.95rem; box-shadow: none; }
  .mainnav a:hover { border-bottom-color: #fff; text-decoration: none; }
  .mainnav a[aria-current="page"] { border-bottom-color: #fff; padding-left: 12px; box-shadow: none; }
}

/* Hero */
.hero { background: var(--ck-green-dark); color: #fff; padding: 2.5rem 0 3rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 7vw, 3.1rem); max-width: 18ch; }
.hero-lead { font-size: 1.15rem; max-width: 56ch; color: #e8efe9; }
.hero-note { color: #cfdad2; font-size: 0.9rem; margin-top: 0.5rem; }
.btn { border-radius: 10px; font-weight: 650; padding: 0.6rem 1.1rem; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 1.05rem; }
.btn-light { background: #fff; color: var(--ck-green-dark); border-color: #fff; }
.btn-light:hover { background: #eef3ef; color: #000; }
.btn-brand { background: var(--ck-green-dark); border-color: var(--ck-green-dark); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: #14402f; border-color: #14402f; color: #fff; }
.btn-brand[disabled] { opacity: 0.6; }
.btn-outline-dark { border-color: #3a3f3c; color: var(--ck-ink); }
.btn-link { color: var(--ck-green-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.25rem 0 0.5rem; }

/* Bloques */
.panel { background: #fff; border: 1px solid var(--ck-line); border-radius: 14px; padding: 1.1rem; margin: 1rem 0; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.steps { list-style: none; padding: 0; display: grid; gap: 1rem; counter-reset: s; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--ck-surface); border-radius: 14px; padding: 1rem; }
.num-badge { flex: none; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ck-green-dark); color: #fff; font-weight: 700; font-size: 0.85rem; }
.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 1.6rem; position: relative; margin-bottom: 0.4rem; }
.ticks li::before { content: "✔"; position: absolute; left: 0; color: var(--ck-green-dark); }

/* Avisos (el estado lleva ícono y texto, no solo color) */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--ck-line); border-left-width: 5px; background: var(--ck-surface); margin: 0.75rem 0; }
.notice-icon { font-weight: 800; flex: none; }
.notice-info { border-left-color: var(--ck-green-dark); }
.notice-ok { background: var(--ck-green-tint); border-left-color: var(--ck-green-dark); }
.notice-warn { background: var(--ck-amber-tint); border-left-color: var(--ck-amber); }
.notice-warn .notice-icon { color: var(--ck-amber); }
.notice-error { background: var(--ck-red-tint); border-left-color: var(--ck-red); }
.notice-error .notice-icon { color: var(--ck-red); }
.draft-banner { margin-top: 0; }

/* Formularios */
.form-label { font-weight: 600; }
.req { color: var(--ck-red); }
.opt { color: var(--ck-gray); font-weight: 400; font-size: 0.85rem; }
.form-control, .form-select { border-radius: 10px; border-color: #8b928e; min-height: 46px; font-size: 1rem; }
.form-control:focus, .form-select:focus { border-color: var(--ck-green-dark); box-shadow: 0 0 0 3px rgba(11, 43, 31, 0.25); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--ck-red); background-image: none; padding-right: 0.75rem; }
.input-group-text { background: var(--ck-surface); border-color: #8b928e; }
.form-text { color: var(--ck-gray); }
.field-error { color: var(--ck-red); font-weight: 600; font-size: 0.9rem; margin-top: 4px; }
.form-check-input { width: 1.2em; height: 1.2em; margin-top: 0.2em; border-color: #5b5f5d; }
.form-check-input:checked { background-color: var(--ck-green-dark); border-color: var(--ck-green-dark); }
.form-range::-webkit-slider-thumb { background: var(--ck-green-dark); }
.form-range::-moz-range-thumb { background: var(--ck-green-dark); }
details.more { margin: 1rem 0; border: 1px dashed var(--ck-line); border-radius: 12px; padding: 0.6rem 1rem; }
details.more summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset legend { float: none; }
.consents { border-top: 1px solid var(--ck-line); padding-top: 1rem; margin-top: 0.5rem; }
.code-block { background: var(--ck-surface); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.oauth-buttons { display: grid; gap: 8px; }
@media (min-width: 640px) { .oauth-buttons { grid-template-columns: repeat(3, 1fr); } }

/* Simulador */
.sim-wrap { max-width: 760px; }
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 1.25rem; gap: 6px; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-top: 4px solid var(--ck-line); font-size: 0.8rem; text-align: center; color: var(--ck-gray); }
.stepper li.current { border-top-color: var(--ck-green-dark); color: var(--ck-ink); font-weight: 700; }
.stepper li.done { border-top-color: var(--ck-green); color: var(--ck-ink); }
.stepper .num-badge { width: 24px; height: 24px; font-size: 0.75rem; background: #fff; color: var(--ck-gray); border: 2px solid var(--ck-line); }
.stepper li.current .num-badge { background: var(--ck-green-dark); color: #fff; border-color: var(--ck-green-dark); }
.stepper li.done .num-badge { background: var(--ck-green); color: #000; border-color: var(--ck-green); }
.card-list { display: grid; gap: 10px; padding: 0; }
.card-item { border: 1px solid var(--ck-line); border-radius: 14px; padding: 0.9rem 1rem; background: #fff; }
.card-item-main { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-item .debt { font-weight: 700; color: var(--ck-ink); }
.card-item-meta { color: var(--ck-gray); font-size: 0.875rem; margin: 4px 0 8px; }
.card-item-actions { display: flex; gap: 8px; }
.total-debt { display: flex; justify-content: space-between; border-top: 2px solid var(--ck-ink); padding-top: 8px; font-size: 1.1rem; }
.card-form { background: var(--ck-surface); }
.local-note { margin-top: 2rem; border-top: 1px solid var(--ck-line); padding-top: 0.75rem; }
.loading { text-align: center; padding: 3rem 0; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 5px solid var(--ck-line); border-top-color: var(--ck-green-dark); margin: 0 auto 1rem; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } html { scroll-behavior: auto; } }
.ts-host { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 50; }

/* Resumen */
.headline { background: var(--ck-surface); border: 1px solid var(--ck-line); border-radius: 16px; padding: 1.1rem; margin: 0.5rem 0 1rem; }
.headline-main { font-size: 1.35rem; font-weight: 750; line-height: 1.25; margin-bottom: 0.4rem; }
.headline-save { font-size: 1.05rem; margin-bottom: 1rem; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis > div { background: #fff; border: 1px solid var(--ck-line); border-radius: 12px; padding: 0.6rem 0.75rem; }
.kpis dt { font-size: 0.78rem; font-weight: 600; color: var(--ck-gray); }
.kpis dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 750; }
.kpis dd.pos { background: var(--ck-green-tint); border-radius: 8px; padding: 2px 6px; display: inline-block; color: var(--ck-green-dark); }
.table-wrap { overflow-x: auto; border: 1px solid var(--ck-line); border-radius: 12px; margin: 0.5rem 0 1rem; }
.table-wrap table { margin: 0; min-width: 520px; }
.table th, .table td { vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-plan { background: var(--ck-green-tint); }
.methods th[scope="row"] { min-width: 150px; }
.extra-phrase, .mode-note { font-weight: 600; min-height: 1.6em; }
.donors { padding-left: 1.1rem; }
.order { padding-left: 1.4rem; }
.disclaimer { border-top: 1px solid var(--ck-line); padding-top: 0.75rem; color: var(--ck-gray); font-size: 0.9rem; margin-top: 1.5rem; }
.cta { background: var(--ck-surface); }
.badge-state { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--ck-line); background: #fff; font-weight: 600; }
.state-done { background: var(--ck-green-tint); border-color: var(--ck-green-dark); color: var(--ck-green-dark); }
.soon, .soon-list .soon { color: var(--ck-gray); }
.soon-list { padding-left: 1.1rem; }
.danger-zone { border-color: var(--ck-red); }

/* Contenido */
.prose { max-width: 70ch; }
.article-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.article-list li { border-bottom: 1px solid var(--ck-line); padding-bottom: 1rem; }
.sortbar a[aria-current="true"] { font-weight: 800; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose blockquote { border-left: 4px solid var(--ck-green-dark); background: var(--ck-surface); margin: 1rem 0; padding: 0.5rem 1rem; }
.prose pre { background: var(--ck-surface); border: 1px solid var(--ck-line); padding: 0.75rem; overflow-x: auto; }
.prose code { overflow-wrap: anywhere; }
.prose hr { margin: 1.5rem 0; }
.kind-tag { display: inline-block; border: 1px solid var(--ck-green-dark); color: var(--ck-green-dark); border-radius: 999px; padding: 0 0.6rem; font-size: 0.75rem; font-weight: 700; vertical-align: middle; }
.tabs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 1rem; }
.tabs a { display: inline-block; min-height: 44px; line-height: 28px; padding: 8px 14px; border: 1px solid var(--ck-line); border-radius: 8px; text-decoration: none; color: var(--ck-ink); }
.tabs a[aria-current="page"] { background: var(--ck-green-dark); border-color: var(--ck-green-dark); color: #fff; font-weight: 700; }
.tabs a[aria-current="page"]::before { content: "✓ "; }
.js-only { display: none; }
.js .js-only { display: block; }
.js .idea-actions.js-only { display: flex; }
.idea-title { margin-bottom: 0.25rem; }
.idea-body { margin-bottom: 0.4rem; }
.idea-team { font-weight: 700; }
.idea-contrib { margin-bottom: 0.5rem; }
.idea-actions { gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.vote-btn { min-height: 44px; }
.vote-btn[aria-pressed="true"] { background: var(--ck-green-dark); color: #fff; border-color: var(--ck-green-dark); font-weight: 700; }
.idea-actions .btn-link { min-height: 44px; }
.report-form { border: 1px solid var(--ck-line); border-radius: 8px; padding: 0.75rem; margin-top: 0.5rem; background: var(--ck-surface); }
.idea-form-panel { margin-top: 2rem; }

/* Promoción cruzada y pie */
.promo { background: var(--ck-surface); border-top: 1px solid var(--ck-line); padding: 1.5rem 0; margin-top: 1.5rem; }
.promo-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .promo-grid { grid-template-columns: 1fr 1fr; } }
.promo-card { background: #fff; border: 1px solid var(--ck-line); border-radius: 12px; padding: 0.9rem 1rem; }
.promo-card p { margin: 0.2rem 0 0.4rem; color: #2b2f2d; }
.site-footer { background: var(--ck-green-dark); color: #e8efe9; padding: 1.5rem 0 2rem; }
.site-footer a { color: #fff; }
.site-footer .muted { color: #b8c6bd; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0.75rem 0; }
.footer-disclaimer { font-size: 0.9rem; max-width: 75ch; }
.site-footer .soon { color: #b8c6bd; }

/* Mi plan (M3) */
.plan-nav ul { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.plan-nav a { font-size: 0.9rem; }
.plan-section { scroll-margin-top: 12px; }
.empty { border: 1px dashed var(--ck-line); border-radius: 12px; padding: 1rem; background: var(--ck-surface); }
.empty p { margin: 0 0 4px; }
.mv-actions { white-space: nowrap; }
.mv-form-row td { background: var(--ck-surface); }
.mv-form { max-width: 360px; }
.state-skipped { color: var(--ck-gray); }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.pbar { position: relative; display: flex; align-items: center; gap: 10px; }
.pbar svg { flex: 1; height: 14px; border-radius: 7px; overflow: hidden; }
.pbar-big svg { height: 22px; border-radius: 11px; }
.pb-track { fill: #e3e8e5; }
.pb-fill { fill: var(--ck-green); }
.pbar svg { outline: 1px solid var(--ck-green-dark); outline-offset: -1px; }
.pbar-muted .pb-fill { fill: #9aa39e; }
.pb-text { font-weight: 700; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.card-bars { list-style: none; padding: 0; display: grid; gap: 10px; }
.cb-name { display: block; font-weight: 600; margin-bottom: 2px; }
.tag { font-size: 0.75rem; font-weight: 600; border: 1px solid var(--ck-gray); border-radius: 6px; padding: 0 6px; color: var(--ck-gray); }
.chart { margin: 0.5rem 0 1rem; }
.chart svg { width: 100%; height: auto; max-height: 300px; }
.ch-grid { stroke: var(--ck-line); stroke-width: 1; }
.ch-tick { fill: var(--ck-gray); font-size: 11px; }
.ch-line { stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ch-ink { stroke: var(--ck-ink); }
.ch-gray { stroke: var(--ck-gray); }
.ch-good { stroke: var(--ck-green-dark); }
.ch-dash { stroke-dasharray: 8 6; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.875rem; }
.ms-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.ms-list li { display: flex; gap: 12px; align-items: center; border: 1px solid var(--ck-line); border-radius: 12px; padding: 0.7rem 0.9rem; }
.ms-list li > div { flex: 1; }
.ms-reached { background: var(--ck-green-tint); border-color: var(--ck-green-dark); }
.ms-dot { font-weight: 800; width: 1.4em; text-align: center; }
.pb-title { margin-bottom: 4px; }

/* Comparador: tabla en pantallas anchas, tarjetas apiladas en teléfono */
.compare-table { width: 100%; }
.compare-table .src { font-size: 0.875rem; color: var(--ck-gray); overflow-wrap: anywhere; }
.compare-table .src-body { min-width: 0; }
@media (max-width: 639px) {
  .compare-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table th, .compare-table td { display: block; width: 100%; }
  .compare-table tr { border: 1px solid var(--ck-line); border-radius: 10px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
  .compare-table th[scope="row"] { font-size: 1.05rem; border: 0; padding: 0.25rem 0; }
  .compare-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.2rem 0; text-align: right; white-space: normal; }
  .compare-table td::before { content: attr(data-label); font-weight: 600; text-align: left; color: var(--ck-ink); flex: none; }
  .compare-table td.src { display: block; text-align: left; }
  .compare-table td.src::before { display: block; }
}

.is-suspended .idea-actions, .is-suspended .idea-form-panel { display: none !important; }
.my-ideas-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.status-tag { display: inline-block; border: 1px solid var(--ck-line); border-radius: 6px; padding: 0 0.4rem; font-weight: 600; }
