/* ==========================================================================
   Guía práctica de crédito personal — estilos
   Mobile-first · sin frameworks
   ========================================================================== */

:root {
  --navy-900: #14263d;
  --navy-800: #1e3a5f;
  --blue-700: #2f6497;
  --blue-600: #2b5d8f;
  --blue-100: #e3ebf4;
  --blue-50: #f4f7fb;
  --line: #cbd8e8;
  --text: #1f2a37;
  --muted: #4a5a6e;
  --white: #ffffff;
  --amber-50: #fff8e6;
  --amber-600: #8a5a00;
  --amber-line: #e8c46a;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 38, 61, .06), 0 4px 16px rgba(20, 38, 61, .06);
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--blue-600); text-underline-offset: 3px; }
a:hover { color: var(--navy-800); }

:focus-visible {
  outline: 3px solid var(--blue-700);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  color: var(--navy-900);
  line-height: 1.25;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.875rem, 5.5vw, 2.875rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  background: var(--navy-900);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: 12px; color: var(--white); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Barra de aviso (fija) ---------- */
.notice-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-900);
  color: var(--white);
  font-size: .8125rem;
  line-height: 1.45;
  padding: 8px 0;
  text-align: center;
}
.notice-bar p { margin: 0; }
@media (min-width: 768px) {
  .notice-bar { font-size: .875rem; }
}

/* ---------- Encabezado ---------- */
.site-header {
  border-bottom: 1px solid var(--blue-100);
  background: var(--white);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy-900);
  text-decoration: none;
  line-height: 1.2;
}
.brand img { width: 32px; height: 32px; }
.brand:hover { color: var(--navy-900); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-900);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--blue-100);
  box-shadow: var(--shadow);
  z-index: 40;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 20px 16px;
}
.site-nav a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-100);
}
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a:hover { color: var(--blue-600); }

/* Sin JS: menú siempre visible */
.no-js .nav-toggle { display: none; }
.no-js .site-nav { display: block; }
.no-js .site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 0 12px; }
.no-js .site-nav a { border: 0; padding: 4px 0; }
.no-js .site-header__inner { flex-wrap: wrap; }

@media (min-width: 880px) {
  .site-header { position: relative; }
  .nav-toggle { display: none; }
  .site-nav,
  .site-nav.is-open {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
  }
  .site-nav ul { display: flex; gap: 24px; padding: 0; }
  .site-nav a { padding: 6px 0; border: 0; font-size: .9375rem; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  text-align: center;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.btn--primary {
  background: var(--navy-800);
  color: var(--white);
  box-shadow: 0 2px 0 rgba(20, 38, 61, .25);
}
.btn--primary:hover { background: var(--navy-900); color: var(--white); }
.btn--block { width: 100%; }
@media (min-width: 560px) { .btn--block { width: auto; } }

.microcopy {
  margin: 12px 0 0;
  font-size: .9375rem;
  color: var(--muted);
}

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
.section--alt { background: var(--blue-50); }
@media (min-width: 768px) { .section { padding: 80px 0; } }

.section__lead { color: var(--muted); font-size: 1.125rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
  padding: 48px 0 56px;
}
.hero__grid { display: grid; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--navy-800);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero__subtitle {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 28px;
}
.hero__art { display: none; }

@media (min-width: 880px) {
  .hero { padding: 80px 0 88px; }
  .hero__grid { grid-template-columns: 1.4fr .8fr; }
  .hero__art { display: block; justify-self: center; width: 100%; max-width: 280px; }
}

/* ---------- Listas ---------- */
.check-list,
.x-list,
.people-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.check-list li,
.x-list li,
.people-list li {
  position: relative;
  padding: 14px 16px 14px 52px;
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
}
.check-list li::before,
.x-list li::before,
.people-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}
.check-list li::before {
  background-color: var(--navy-800);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.people-list li::before {
  background-color: var(--blue-100);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='5.5' r='2.6' fill='%231e3a5f'/%3E%3Cpath d='M3 14c.6-2.8 2.6-4.2 5-4.2s4.4 1.4 5 4.2' fill='%231e3a5f'/%3E%3C/svg%3E");
}
@media (min-width: 768px) {
  .check-list { grid-template-columns: 1fr 1fr; }
  .people-list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Sección de conformidad: Lo que NO es ---------- */
.not-box {
  background: var(--amber-50);
  border: 2px solid var(--amber-line);
  border-left-width: 8px;
  border-radius: var(--radius);
  padding: 28px 20px;
}
@media (min-width: 768px) { .not-box { padding: 40px 44px; } }
.not-box h2 { display: flex; align-items: center; gap: 12px; }
.not-box h2 svg { flex: none; width: 32px; height: 32px; }
.x-list li { border-color: #f0dca6; font-weight: 500; }
.x-list li::before {
  background-color: var(--amber-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 4.5l7 7m0-7l-7 7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Pasos ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.steps li {
  counter-increment: step;
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--white);
  font-weight: 700;
}
.steps p { margin: 0; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Garantía ---------- */
.guarantee {
  display: grid;
  gap: 20px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
}
.guarantee svg { width: 64px; height: 64px; }
.guarantee p:last-child { margin-bottom: 0; }
@media (min-width: 640px) {
  .guarantee { grid-template-columns: auto 1fr; padding: 36px 40px; gap: 28px; }
}

/* ---------- Sobre nosotros ---------- */
.company-card {
  margin-top: 24px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
}
.company-card dl { margin: 0; display: grid; gap: 10px; }
.company-card dt { font-size: .8125rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.company-card dd { margin: 0 0 6px; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .company-card dl { grid-template-columns: 160px 1fr; gap: 12px 20px; }
  .company-card dd { margin: 0; }
}

/* ---------- FAQ ---------- */
.faq { margin-top: 28px; display: grid; gap: 12px; }
.faq details {
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  background: var(--white);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 18px 56px 18px 20px;
  font-weight: 600;
  color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2.5px solid var(--navy-800);
  border-bottom: 2.5px solid var(--navy-800);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details[open] summary { border-bottom: 1px solid var(--blue-100); }
.faq__answer { padding: 16px 20px 18px; }
.faq__answer p { margin: 0; }

/* ---------- Cierre ---------- */
.closing {
  background: var(--navy-800);
  color: var(--white);
  text-align: center;
}
.closing h2 { color: var(--white); }
.closing .btn--primary { background: var(--white); color: var(--navy-900); }
.closing .btn--primary:hover { background: var(--blue-100); color: var(--navy-900); }
.closing .microcopy { color: #d5e1ee; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #d5e1ee;
  font-size: .9375rem;
  padding: 40px 0 28px;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: #d5e1ee; }
.footer__notice {
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  color: var(--white);
  font-weight: 600;
}
.footer__links {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer__links a { display: inline-block; padding: 6px 0; }
.footer__company { margin: 0 0 20px; font-style: normal; line-height: 1.6; overflow-wrap: anywhere; }
.footer__copy { margin: 0; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .875rem; }

/* ---------- Páginas legales ---------- */
.legal { padding: 40px 0 64px; }
.legal h1 { font-size: clamp(1.75rem, 5vw, 2.375rem); }
.legal h2 { font-size: 1.3125rem; margin-top: 2em; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li { margin-bottom: .4em; }
.legal__meta { color: var(--muted); font-size: .9375rem; }
.legal__back { display: inline-block; margin-bottom: 24px; font-weight: 600; }
.legal .callout {
  background: var(--amber-50);
  border: 1px solid var(--amber-line);
  border-left-width: 6px;
  border-radius: 8px;
  padding: 16px 18px;
  margin: 24px 0;
}
.legal .callout p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Checkout
   ========================================================================== */
[hidden] { display: none !important; }

.notice-bar--compact { font-size: .8125rem; padding: 6px 0; }

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
}
.secure-badge svg { flex: none; width: 14px; height: 14px; }

.checkout { background: var(--blue-50); padding: 24px 0 48px; }
.checkout__grid { display: grid; gap: 20px; align-items: start; }
.checkout__grid:not([data-step="form"]) .order-summary { order: 2; }
@media (min-width: 880px) {
  .checkout { padding: 48px 0 64px; }
  .checkout__grid { grid-template-columns: 1fr 360px; gap: 32px; }
  .order-summary { order: 2; position: sticky; top: 64px; }
}

.order-summary,
.checkout__panel {
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.order-summary { padding: 20px; }
.checkout__panel { padding: 24px 20px 28px; min-width: 0; }
@media (min-width: 640px) { .checkout__panel { padding: 36px 40px 40px; } }

.order-summary__title {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 14px;
}
.order-summary__product { display: flex; gap: 14px; align-items: flex-start; }
.order-summary__icon { flex: none; width: 44px; height: auto; }
.order-summary__name { margin: 0 0 4px; font-weight: 700; color: var(--navy-900); line-height: 1.35; font-size: 1rem; }
.order-summary__desc { margin: 0; color: var(--muted); font-size: .9375rem; }
.order-summary__lines { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--blue-100); }
.order-summary__lines div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .9375rem; }
.order-summary__lines dt { color: var(--muted); }
.order-summary__lines dd { margin: 0; text-align: right; }
.order-summary__total { margin-top: 8px; padding-top: 12px !important; border-top: 1px solid var(--blue-100); font-size: 1.125rem !important; }
.order-summary__total dt { color: var(--navy-900) !important; font-weight: 700; }
.order-summary__total dd { font-weight: 800; color: var(--navy-900); }
.order-summary__facts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: .875rem; color: var(--muted); }
.order-summary__facts li { position: relative; padding-left: 22px; }
.order-summary__facts li::before {
  content: "";
  position: absolute; left: 2px; top: 6px;
  width: 11px; height: 6px;
  border-left: 2px solid var(--navy-800);
  border-bottom: 2px solid var(--navy-800);
  transform: rotate(-45deg);
}

.checkout__title { font-size: clamp(1.5rem, 4.5vw, 1.875rem); outline: none; }
.checkout__subtitle { font-size: 1.125rem; margin-top: 28px; }
.checkout__lead { color: var(--muted); }
.checkout__meta { color: var(--muted); font-size: .9375rem; margin-bottom: .5em; }
.checkout__legal { margin: 16px 0 0; font-size: .875rem; color: var(--muted); }
.checkout__safety { margin: 20px 0 0; font-size: .875rem; font-weight: 600; color: var(--navy-800); }
.checkout__netstatus { margin: 8px 0 0; font-size: .875rem; color: var(--amber-600); }
.checkout__submit { width: 100%; margin: 8px 0 16px; }
.checkout__submit:disabled { opacity: .7; cursor: progress; }

.checkout__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 12px;
  padding: 14px 16px;
  background: var(--blue-50);
  border-radius: 8px;
  color: var(--navy-900);
}
.checkout__total strong { font-size: 1.25rem; }

.checkout__privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 760px;
  margin: 24px 0 0;
  font-size: .875rem;
  color: var(--muted);
}
.checkout__privacy svg { flex: none; width: 14px; height: 14px; margin-top: 4px; color: var(--navy-800); }
@media (min-width: 880px) { .checkout__privacy { max-width: calc(100% - 392px); } }

/* Formulario */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy-900); }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--white);
  border: 1px solid #9fb3c8;
  border-radius: 8px;
}
.field input:focus { outline: 3px solid var(--blue-700); outline-offset: 1px; border-color: var(--blue-700); }
.field input[aria-invalid="true"] { border-color: #b42318; }
.field__hint { margin: 6px 0 0; font-size: .875rem; color: var(--muted); }
.field__error { margin: 6px 0 0; font-size: .875rem; color: #b42318; font-weight: 600; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Alertas */
.alert { border-radius: 8px; padding: 14px 16px; margin: 16px 0; font-size: .9375rem; }
.alert p { margin: 0 0 .6em; }
.alert p:last-child { margin-bottom: 0; }
.alert--error { background: #fef3f2; border: 1px solid #f5c2bd; color: #912018; }
.alert--info { background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--text); }

/* Estado */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--navy-900);
  font-weight: 600;
  font-size: .9375rem;
}
.status-pill--waiting { background: var(--amber-50); border: 1px solid var(--amber-line); color: #6b4600; }
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Datos SPEI */
.pay-data { margin: 16px 0 0; border: 1px solid var(--blue-100); border-radius: var(--radius); overflow: hidden; }
.pay-data__row { padding: 12px 14px; border-bottom: 1px solid var(--blue-100); }
.pay-data__row:last-child { border-bottom: 0; }
.pay-data__row:nth-child(2) { background: var(--blue-50); }
.pay-data dt { font-size: .8125rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pay-data dd {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy-900);
}
.pay-data dd span { min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.copy-btn {
  flex: none;
  min-height: 40px;
  min-width: 84px;
  padding: 6px 12px;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--blue-50); }
.copy-btn.is-copied { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }

.howto { margin: 0; padding-left: 1.3em; }
.howto li { margin-bottom: .5em; }

.result { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.result svg { flex: none; width: 44px; height: 44px; }
.result .checkout__title { margin: 0; }
