:root {
  --ant-blue: #004376;
  --ant-white: #ffffff;
  --ant-brand-size: 22px;
  --page-title-size: 30px;
  --section-title-size: 34px;
  --primary-blue: #005ea6;
  --border-blue: #005ea6;
  --soft-gray: #eef1f5;
  --text-gray: #4d5b6a;
  --card-border: #e3edf6;
  --radio-border: #c7d2df;
  --radio-active: #f2b500;
  --footer-logo-size: 110px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: #f5f6f8;
  color: #0b1a2b;
}

.ant-header {
  background: var(--ant-blue);
  color: var(--ant-white);
}

.ant-header__inner {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
}

.ant-header__brand {
  font-size: var(--ant-brand-size);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ant-header__powered {
  text-align: right;
  line-height: 1.1;
}

.ant-header__powered-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.ant-header__powered-logo {
  margin-top: 6px;
  display: flex;
  align-items: center;
}

.ant-header__powered-svg {
  width: 90px;
  height: auto;
  display: block;
  fill: #ffffff;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page__title {
  font-size: var(--page-title-size);
  font-weight: 400;
  color: #0b1a2b;
  margin-bottom: 6px;
}

.payments {
  margin: 48px auto 0;
  max-width: 860px;
  text-align: left;
}

.payments__title {
  font-size: var(--section-title-size);
  font-weight: 400;
  margin: 0;
  color: #0b1a2b;
}

.payments__subtitle {
  margin: 10px 0 28px;
  color: var(--text-gray);
  font-size: 16px;
}

.option-card {
  margin: 0 0 24px;
  width: 330px;
  min-height: 130px;
  border: 2px solid var(--border-blue);
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 14px;
  cursor: pointer;
}

.option-card__svg {
  width: 64px;
  height: 64px;
  display: block;
}

.option-card__label {
  font-size: 16px;
  color: #0b1a2b;
}

.form-card {
  margin: 24px 0 0;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 28px 32px 32px;
  text-align: left;
  box-shadow: 0 30px 40px rgba(12, 44, 77, 0.08);
}

.form-card__brand {
  text-align: center;
  font-weight: 400;
  color: #a8b0bb;
  margin-bottom: 4px;
  font-size: 22px;
}

.form-card__section-title {
  text-align: center;
  font-size: 14px;
  color: #1f2d3a;
  margin-bottom: 18px;
  font-weight: 600;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.radio-card {
  border: 1.5px solid var(--radio-border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.radio-card input {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--radio-active);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0;
}

.radio-card input:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--radio-active);
}

.radio-card__label {
  font-size: 16px;
  color: #0b1a2b;
}

.radio-card--active {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 1px var(--primary-blue);
}

.radio-card input:checked + .radio-card__label {
  font-weight: 400;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  color: #637284;
  margin-left: 4px;
}

.field input {
  height: 46px;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  background: transparent;
}

.field input:focus {
  border: none;
  box-shadow: none;
}

.field__hint {
  font-size: 13px;
  color: #4d5b6a;
  margin-left: 4px;
}

.btn-primary {
  height: 46px;
  padding: 0 28px;
  border: none;
  border-radius: 8px;
  background: #005ea6;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 102, 194, 0.25);
}

.ant-footer {
  background: #ffffff;
  border-top: 1px solid #e6edf5;
}

.ant-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.ant-footer__brand {
  color: #0b5ab5;
  font-size: 24px;
  font-weight: 600;
}

.ant-footer__powered {
  text-align: right;
  line-height: 1.1;
  color: #0b5ab5;
}

.ant-footer__powered-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.ant-footer__powered-logo {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ant-footer__powered-svg {
  width: var(--footer-logo-size);
  height: 90px;
  display: block;
  fill: #0b5ab5;
}

@media (max-width: 720px) {
  .ant-header__inner {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ant-header__brand {
    font-size: 22px;
  }

  .ant-header__powered {
    align-self: flex-end;
  }

  /* Ensure kushki SVG in header remains visible on small screens */
  .ant-header__powered-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
  }

  .ant-header__powered-svg {
    width: clamp(48px, 18vw, 110px);
    height: auto;
    display: block;
    visibility: visible;
    opacity: 1;
  }

  /* Refuerzo: forzar visibilidad en móviles si otras reglas colisionan */
  .ant-header__powered-logo {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .ant-header__powered-svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 110px;
  }

  /* Ocultar logo de Kushki en versión móvil (override con !important) */
  .ant-header__powered-logo,
  .ant-header__powered-svg {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
  }

  .page {
    padding: 24px 16px 48px;
  }

  .payments {
    text-align: left;
  }

  .payments__title {
    font-size: 26px;
  }

  .option-card {
    width: 100%;
  }

  .form-card {
    padding: 20px;
  }

  .radio-group {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .ant-footer__inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }

  .ant-footer__brand {
    font-size: 20px;
    text-align: center;
  }

  .ant-footer__powered-logo {
    justify-content: center;
    width: 100%;
  }

  .ant-footer__powered {
    text-align: center;
    width: 100%;
  }
}

/* Fluid typography */
.page__title {
  font-size: clamp(20px, 2.5vw, 30px);
}

.payments__title {
  font-size: clamp(24px, 3.2vw, 34px);
}

/* Make header/footer SVGs scale nicely */
.ant-header__powered-svg {
  width: clamp(60px, 8vw, 110px);
  height: auto;
}

.ant-footer__powered-svg {
  width: clamp(80px, 12vw, 140px);
  max-width: 100%;
  height: auto;
}

/* Ensure option card and images are flexible */
.option-card__svg,
.option-card__icon svg {
  width: 100%;
  max-width: 64px;
  height: auto;
}

/* loader and result styles */
.form-card__loader {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,0.08);
  border-top-color: #005ea6;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: #0b1a2b; font-weight: 600; }

.form-card__result { margin-top: 18px; }
.result-card { background: #ffffff; border-radius: 8px; padding: 16px; border: 1px solid var(--card-border); }
.result-title { font-weight: 600; margin-bottom: 12px; }
.result-row { display:flex; gap:12px; padding:6px 0; border-bottom:1px dashed #eef3f8; align-items:center }
.result-key { width:150px; color:#637284; font-size:13px }
.result-val { color:#0b1a2b; font-weight:600 }
.result-actions { margin-top:12px; display:flex; gap:8px }
.message.warning { color:#b23b3b; font-weight:600; padding:8px 0 }
.message.error { color:#b23b3b; font-weight:600; padding:8px 0 }

/* Consulta page styles */
.consult-header h2 { margin:0 0 6px; font-size:28px }
.consult-desc { margin:0 0 18px; color:var(--text-gray) }
.consult-alert { background:#fff5f5; border:1px solid #f5c2c2; padding:12px; border-radius:8px; margin-bottom:16px }
.alert-title { font-weight:700; color:#b23b3b }
.alert-body { margin-top:8px; color:#5a3740 }
.alert-note { margin-top:8px; font-size:12px; color:#6b6b6b }

.consult-payment { display:flex; gap:18px; align-items:center; margin:12px 0 18px }
.payment-left { display:flex; gap:12px; align-items:center }
.avatar { width:64px; height:64px; display:flex; align-items:center; justify-content:center; border-radius:8px; background:#eef6fb }
.avatar svg { width:48px; height:48px }
.titular-meta { display:flex; flex-direction:column; margin-left:10px; align-items:flex-start }
.titular-name { font-weight:700; font-size:16px }
.status.active {
  /* pill compacto, ancho según texto */
  background: #0b8a53; /* fondo verde sólido */
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 6px;
  font-size: 12px;
  display: inline-block;
  line-height: 1;
  width: auto;
  max-width: none;
}
.amounts { font-size:15px }
.amount-original-val { color:#b23b3b; font-weight:700 }
.amount-final-val { color:#0b8a53; font-weight:800 }
.amount-discount-val { color:#0b8a53; font-weight:700 }

.citation-table .table-title { font-weight:700; margin-bottom:8px }
.table-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:12px }
.table-grid .cell { background:#fff; padding:10px; border:1px solid #eef3f8; border-radius:6px }

.personal-form .form-title { font-weight:700; margin-bottom:8px }
.personal-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:12px }
.personal-grid .field input { width:100% }

@media (max-width:720px) {
  .consult-payment { flex-direction:column; align-items:flex-start; flex-wrap:wrap; gap:12px }
  .table-grid { grid-template-columns:1fr }
  .personal-grid { grid-template-columns:1fr }
}

/* Personal form: evitar borde interno en inputs (solo el contenedor .field tendrá borde) */
.personal-form { margin-top:28px }
.personal-form .form-title { font-size:18px; margin-bottom:12px; color:#12364a }
.personal-form .personal-grid { grid-template-columns: repeat(2,1fr); gap:12px }
.personal-form .field-wrapper { display:flex; flex-direction:column }
.personal-form .field { padding:10px 12px; border-radius:8px; border:1px solid #e6eef8; background:#fff; display:flex; align-items:center; height:44px }
.personal-form .field__label { font-size:13px; color:#0b1a2b; margin:0 0 8px 0; text-align:left; font-weight:600 }
.personal-form .field input { border:none !important; outline:none !important; background:transparent; height:100%; width:100%; padding:6px 8px; box-sizing:border-box; font-size:15px }
.personal-form .field:focus-within { box-shadow: 0 8px 20px rgba(2,115,255,0.06); }

/* Evitar que el input tenga su propio efecto de foco/hover — solo el contenedor .field debe mostrar el cambio */
.personal-form .field input:focus,
.personal-form .field input:hover,
.personal-form .field input:active {
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
}

/* Hover del contenedor: cambiar solo el color del borde, sin crear ilusión de doble recuadro */
.personal-form .field:hover {
  border-color: #d7eafc;
}

/* Focus dentro: resaltar borde y aplicar sombra exterior sutil sobre el contenedor */
.personal-form .field:focus-within {
  border-color: #bfe1ff;
  box-shadow: 0 6px 18px rgba(11,82,153,0.06);
}

/* Estilo específico para errores en el formulario de facturación: mostrar debajo del .field */
.personal-form .field-error { display:block; margin:6px 0 10px; font-size:12px; color:#b91c1c }
.personal-form .field + .field-error { margin-top:8px }

/* Modal popup styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,26,43,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.modal {
  background: #fff;
  padding: 20px 22px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 260px;
  box-shadow: 0 10px 30px rgba(8,30,50,0.2);
}
.modal-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,0.06);
  border-top-color: #005ea6;
  animation: spin 1s linear infinite;
}
.modal-message { font-weight:600; color:#0b1a2b }

@media (max-width:420px) {
  .modal { min-width: 200px; padding: 14px }
}

/* modal small close button */
.modal { position: relative; }
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #425063;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-close:hover { background: rgba(0,0,0,0.04); }

.modal-icon { display:flex; align-items:center; justify-content:center; width:44px }
.modal-error .error-circle {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:50%;
  background:#ffecec;
  color:#c0392b;
  font-weight:700;
}

/* disabled button look */
.btn-primary[disabled], .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none }

/* Small tweak: make buttons full width on very small screens */
@media (max-width: 420px) {
  .btn-primary {
    width: 100%;
    padding: 0 16px;
  }
}

/* Kushki payment styles (adaptado) */
.kbox{ width:100%; max-width:340px; background:#fff; border:1px solid #dfe6f0; border-radius:12px; overflow:hidden; box-shadow:0 6px 18px rgba(12,44,77,0.06); margin:18px auto }
.khead{ display:flex; align-items:center; gap:12px; padding:12px 20px; background:#f3f7fc; border-bottom:1px solid #e6eef8; color:#023365; font-weight:400; justify-content:center; position:relative }
.khead img{ width:20px; height:20px; position:absolute; left:14px; top:50%; transform:translateY(-50%); object-fit:contain }
.khead span{ flex:1; text-align:center; font-size:15px }
.kcontent{ padding:14px 16px }
.logos{ display:flex; justify-content:center; gap:12px; padding:8px 0 12px }
.logos img{ height:20px }
.field{ display:flex; align-items:center; gap:12px; padding:8px 12px; border:1px solid #e6eef8; border-radius:12px; background:#ffffff; margin-bottom:10px; transition: box-shadow .12s ease, border-color .12s ease, background .12s ease; box-sizing:border-box; height:44px }
.field:focus-within{ border-color: #cce4ff; box-shadow: 0 8px 20px rgba(2,115,255,0.06); }
.field:hover{ border-color:#e3f0ff }

/* Visual invalid state (red) applied on blur when field is empty or invalid */
.field.invalid{ border-color:#f5c2c2; background:#fff6f6 }
.field.invalid input{ color: #5a2a2a }
.field-error.visible{ display:block }
.field img{ width:18px; height:18px; opacity:0.85; flex:0 0 18px }
.field img.card-icon.visa{ width:36px; height:24px; flex:0 0 36px }
.field input{ border:none; outline:none; width:100%; font-size:15px; background:transparent; height:100%; line-height:20px }
.field-error{ display:none; margin:-6px 0 10px; font-size:12px; color:#b91c1c }
.field-error.visible{ display:block }
.row{ display:flex; gap:12px }
.row .field{ width:100%; margin-bottom:0 }
.paybtn{ width:100%; border:none; border-radius:28px; padding:14px 16px; height:48px; font-size:16px; font-weight:700; background:#cfcfcf; color:#ffffff; cursor:not-allowed; margin-top:12px }
.paybtn.enabled{ background:#005ea6; cursor:pointer; box-shadow:0 10px 24px rgba(0,94,166,0.18) }
.overlay{ position:absolute; inset:0; display:none; align-items:center; justify-content:center; background:rgba(255,255,255,.45); backdrop-filter:blur(6px); z-index:5 }
.overlay.show{ display:flex }
.loader-card{ width:min(320px,92%); background:transparent; border:none; padding:18px 16px; text-align:center; color:#023365 }
.spinner{ width:60px; height:60px; border-radius:50%; border:8px solid #dbe7f7; border-top-color:#023365; margin:0 auto; animation:spin 1s linear infinite }
.loader-title{ font-size:20px; margin:0 0 8px 0; font-weight:500 }
.loader-sub{ font-size:14px; margin:0 0 12px 0; color:#023365 }
.kfoot{ padding:14px 12px 20px; text-align:center }
.powered{ display:flex; align-items:center; justify-content:center; gap:10px; margin-top:8px; font-size:11px; letter-spacing:.6px; color:#111827; font-weight:700 }
.powered img{ height:34px }
.pci img{ height:28px }
.foottext{ max-width:360px; margin:8px auto 6px; font-size:13px; color:#7b8496; line-height:1.35 }
.kfoot img.kushki-main{ width:140px; height:auto; display:block; margin:8px auto }
@media (max-width:900px){ .kbox{ width:100%; max-width:420px; } }

/* Mobile: mejorar layout del formulario de pago */
@media (max-width:480px) {
  .kbox{ max-width: calc(100% - 24px); margin:12px auto; border-radius:10px; }
  .khead{ padding:10px 12px; font-size:16px }
  .khead img{ left:10px }
  .khead span{ font-size:15px }
  .kcontent{ padding:12px }
  .logos img{ height:18px }
  .field{ padding:10px 12px; height:48px; border-radius:10px; margin-bottom:10px }
  .field input{ font-size:15px }
  .row{ gap:10px }
  .row .field{ flex:1; min-width:0 }
  .rowwrap .row{ display:flex; gap:8px }
  .paybtn{ height:52px; font-size:16px; margin-top:10px }
  .kfoot .foottext{ font-size:13px; padding:0 8px }
  .powered img{ height:30px }
  .logos{ padding:6px 0 10px }
}

/* Evitar doble-borde interno: anular estilos de foco/borde en los inputs dentro de .kbox */
.kbox .field input,
.kbox .field input:focus,
.kbox .field input:focus-visible {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

/* Alinear placeholder y prefijo sin crear un rectángulo interno */
.kbox .field input { padding: 0 6px; margin: 0; }
.kbox .field img { margin-left: 6px }

/* Placeholder color para mejor contraste */
.kbox .field input::placeholder { color: #9aa6b2; }
