/* =========================================================
   Branding: Solicitud Crédito Personal
   Paleta: teal oscuro + lima + verde bandera + grises
   ========================================================= */
:root {
  --brand-dark:   #2c5f5c;   /* Títulos - teal petróleo */
  --brand-lime:   #8bab3a;   /* Subtítulos + acentos */
  --brand-green:  #1f7a3a;   /* Botón */
  --brand-green-h:#155c2b;   /* Botón hover */
  --card-bg:      #e6e6e6;   /* Fondo tarjeta gris */
  --input-bg:     #f0f0f0;   /* Fondo input gris claro */
  --input-border: #cfcfcf;
  --divider:      #b8b8b8;
  --text:         #333333;
  --muted:        #6b7280;
  --danger:       #b91c1c;
  --warn:         #d97706;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Site header / Banner ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo {
  height: 80px;
  width: auto;
  display: block;
  object-fit: contain;
}
.menu-btn {
  background: transparent;
  border: 0;
  padding: 10px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 2px;
  transition: background .15s;
  min-width: unset;
  letter-spacing: 0;
  text-transform: none;
  font-weight: normal;
}
.menu-btn:hover { background: #f4f4f4; }
.menu-btn span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: #4a4a4a;
  border-radius: 1px;
}

.wrapper { max-width: 780px; margin: 0 auto; padding: 32px 16px; }

@media (max-width: 560px) {
  .site-header-inner { padding: 8px 16px; }
  .brand-logo { height: 80px; }
}
.hidden { display: none; }

/* ---------- Encabezado de página ---------- */
.page-header {
  padding: 0 4px 20px;
}
.page-header h1 {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .5px;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.page-header .lead {
  color: var(--brand-lime);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

/* ---------- Tarjeta gris ---------- */
.form-card {
  background: var(--card-bg);
  padding: 28px 28px 24px;
  border-radius: 2px;
  animation: fadeIn .3s ease;
}
.form-card.center { text-align: center; }
.form-card.center h2 { color: var(--brand-dark); margin: 12px 0 4px; }

.section-title {
  color: var(--brand-lime);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .5px;
  padding-bottom: 4px;
  margin: 0 0 18px;
  text-transform: uppercase;
}

/* ---------- Grid 2 columnas ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; }
.field label {
  display: block;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field .req {
  color: var(--brand-lime);
  font-weight: 400;
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 0;
  margin-left: 4px;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  font-size: 14.5px;
  font-family: inherit;
  color: #111;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #a0a0a0; font-style: italic; }
input:focus, select:focus {
  border-color: var(--input-border);
  background: #fff;
  box-shadow: none;
  outline: none;
}
.input-money {
  position: relative;
  display: block;
}
.input-money-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #2c5f5c;
  font-weight: 700;
  font-size: 14.5px;
  pointer-events: none;
  z-index: 1;
}
.input-money input {
  padding-left: 38px;
  width: 100%;
  box-sizing: border-box;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%232c5f5c' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.divider {
  height: 1px;
  background: var(--divider);
  margin: 24px 0 20px;
}

.actions { display: flex; justify-content: center; margin-top: 4px; }

.btn-primary, .btn-secondary {
  padding: 12px 42px;
  border: 0;
  border-radius: 2px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .15s, transform .05s;
  font-family: inherit;
}
.btn-primary {
  background: var(--brand-green);
  color: #fff;
  min-width: 220px;
}
.btn-primary:hover  { background: var(--brand-green-h); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid var(--input-border);
}
.btn-secondary:hover { background: #f4f4f4; }

.error {
  color: var(--danger);
  font-size: 13.5px;
  min-height: 18px;
  margin: 0 0 6px;
  text-align: center;
  font-weight: 600;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 10px 0 18px;
}
.muted { color: var(--muted); margin: 4px 0 0; }

/* ---------- Loading spinner ---------- */
.spinner {
  width: 54px; height: 54px;
  margin: 12px auto 14px;
  border: 5px solid #d5d5d5;
  border-top-color: var(--brand-green);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

/* ---------- Processing view ---------- */
.processing-header { text-align: center; margin-bottom: 20px; }
.processing-icon {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-h));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(21,92,43,.35);
  animation: pop .3s ease;
}
.processing-header h2 {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 18px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 700;
}

.progress-fill-hidden { display: none; }
.progress-wrap { margin: 6px 0 22px; }
.progress-bar {
  width: 100%; height: 10px;
  background: #d5d5d5;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-lime));
  border-radius: 2px;
  transition: width .4s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
#progressPct { font-weight: 700; color: var(--brand-green); }

/* ===== Stepper horizontal estilo tracking ===== */
.steps-horizontal {
  list-style: none;
  padding: 28px 0 8px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  counter-reset: step;
}
.steps-horizontal::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: #d5d5d5;
  z-index: 0;
}
.steps-horizontal .step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  position: relative;
  z-index: 1;
  text-align: center;
  opacity: .55;
  transition: opacity .3s;
}
.steps-horizontal .step.active,
.steps-horizontal .step.done { opacity: 1; }

.steps-horizontal .step-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #b6b6b6;
  position: relative;
  transition: all .3s;
  flex-shrink: 0;
}
.steps-horizontal .step.active .step-icon {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 4px rgba(31,122,58,.15);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.steps-horizontal .step.done .step-icon {
  background: var(--brand-green);
  border-color: var(--brand-green);
}
.steps-horizontal .step.done .step-icon::after {
  content: '';
  position: absolute;
  left: 6px; top: 3px;
  width: 5px; height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.steps-horizontal .step-body { width: 100%; }
.steps-horizontal .step-title {
  font-size: 13px;
  font-weight: 400;
  color: #555;
  line-height: 1.3;
  letter-spacing: .2px;
}
.steps-horizontal .step.active .step-title { color: var(--brand-green); font-weight: 500; }
.steps-horizontal .step.done .step-title { color: #333; }

.step-detail {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--brand-dark);
  min-height: 22px;
  font-style: italic;
  transition: opacity .3s;
}
.step-detail.fade { opacity: 0; }
.steps-horizontal .step-desc {
  display: none;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 4px rgba(31,122,58,.15); }
  50%     { box-shadow: 0 0 0 8px rgba(31,122,58,.05); }
}

@media (max-width: 640px) {
  .steps-horizontal .step-title { font-size: 11px; }
  .steps-horizontal::before { top: 36px; }
}

/* ===== Stepper vertical (fallback, legado) ===== */
.steps:not(.steps-horizontal) { list-style: none; padding: 0; margin: 0; }
.steps:not(.steps-horizontal) .step {
  display: flex; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #d5d5d5;
  opacity: .45;
  transition: opacity .3s;
}
.steps:not(.steps-horizontal) .step:last-child { border-bottom: 0; }
.steps:not(.steps-horizontal) .step.active,
.steps:not(.steps-horizontal) .step.done { opacity: 1; }

.steps:not(.steps-horizontal) .step-icon {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #b8b8b8;
  background: #fff;
  margin-top: 2px;
  position: relative;
  transition: all .3s;
}
.step.active .step-icon {
  border-color: var(--brand-green);
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}
.step.done .step-icon {
  background: var(--brand-green);
  border-color: var(--brand-green);
}
.step.done .step-icon::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.step-body { flex: 1; }
.step-title { font-size: 14.5px; font-weight: 700; color: #111; }
.step-desc  { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.step.active .step-title { color: var(--brand-green); }

/* ---------- Success view ---------- */
.check-hero { text-align: center; margin: 4px 0 18px; }
.checkmark {
  width: 68px; height: 68px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--brand-green);
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: pop .3s ease;
  box-shadow: 0 6px 16px rgba(21,92,43,.3);
}

.notice {
  padding: 14px 16px;
  margin: 12px 0;
  border-left: 3px solid #b8b8b8;
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  border-radius: 2px;
}
.notice p { margin: 4px 0 0; color: #374151; }
.notice-title {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .3px;
  color: #111;
}
.notice-primary { border-left-color: var(--brand-green); }
.notice-primary .notice-title { color: var(--brand-dark); }
.notice-success { border-left-color: #16a34a; background: #f2faf4; }
.notice-success .notice-title { color: #15803d; }
.notice-warning { border-left-color: var(--warn); background: #fffbeb; }
.notice-warning .notice-title { color: #b45309; }

/* ---------- Menú overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .25s ease, visibility 0s;
}
body.menu-open { overflow: hidden; }

.menu-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  min-height: 64px;
  border-bottom: 1px solid #eee;
}
.menu-close {
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-close:hover { background: #f4f4f4; }

.menu-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.menu-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  text-align: center;
  width: 100%;
  max-width: 480px;
}
.menu-nav a {
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: .3px;
  transition: color .15s;
  display: inline-block;
}
.menu-nav a:hover { color: var(--brand-green); }

.menu-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--brand-green);
  color: #fff;
  text-decoration: none;
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background .15s;
  position: relative;
}
.menu-cta:hover { background: var(--brand-green-h); }
.menu-cta svg {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 560px) {
  .menu-nav a { font-size: 22px; }
  .menu-nav ul { gap: 18px; }
  .menu-cta { font-size: 16px; padding: 16px 20px; }
  .menu-cta svg { right: 16px; width: 18px; height: 18px; }
}

/* ---------- Site footer ---------- */
.site-footer {
  background: #e8e8e8;
  margin-top: 48px;
  color: #333;
}
.footer-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.footer-photo {
  width: 130px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.footer-contact { flex: 1; min-width: 0; }
.footer-title {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;
}
.footer-phone {
  color: var(--brand-lime);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 14px;
}
.footer-social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.footer-social a:hover { background: var(--brand-green-h); transform: translateY(-1px); }
.footer-social svg { width: 18px; height: 18px; display: block; }

.footer-bottom {
  border-top: 1px solid #c9c9c9;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-legal {
  margin: 0;
  color: #4b4b4b;
  font-size: 13px;
  line-height: 1.5;
}
.footer-star {
  width: 44px;
  height: 40px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .footer-main { flex-direction: column; align-items: flex-start; text-align: left; gap: 12px; padding: 20px 16px; }
  .footer-photo { width: 100px; }
  .footer-bottom { padding: 14px 16px; }
  .footer-legal { font-size: 12px; }
  .footer-star { width: 38px; height: 34px; }
}

/* ---------- Animaciones ---------- */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { transform: translateX(-100%);} 100% { transform: translateX(100%);} }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
@keyframes pop     { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
