:root {
  --bg: #eef4fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --primary: #1262c4;
  --primary-dark: #0d4fa3;
  --primary-soft: #edf5ff;
  --line: #dbe5f0;
  --success-bg: #eaf7ef;
  --success-text: #19733d;
  --danger-bg: #fff0f0;
  --danger-text: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(
      circle at top,
      #ffffff 0,
      #f7faff 35%,
      var(--bg) 100%
    );

  color: var(--text);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.card {
  width: min(760px, 100%);
  padding: 38px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(24, 62, 110, 0.14);
}

/* Encabezado */

.portal-header {
  margin-bottom: 28px;
  text-align: center;
}

.m2t-logo {
  display: block;
  width: 230px;
  max-width: 70vw;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  margin: 0 auto 18px;
}

.portal-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.portal-header h1 {
  margin: 0;
  font-size: clamp(27px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -1px;
}

.portal-description {
  max-width: 580px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* Aviso seguro */

.secure-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
  padding: 15px 17px;
  border: 1px solid #d2e4fb;
  border-radius: 15px;
  background: var(--primary-soft);
}

.secure-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.secure-notice strong {
  display: block;
  color: var(--primary-dark);
}

.secure-notice p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Formulario */

.form label {
  display: block;
  margin-bottom: 9px;
  font-weight: 800;
}

.form small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: flex;
  gap: 11px;
}

input {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #ffffff;
  color: var(--text);
  font-size: 18px;
}

input::placeholder {
  color: #98a2b3;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(18, 98, 196, 0.12);
}

button,
.pay-button {
  border: 0;
  border-radius: 13px;
  padding: 15px 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

button {
  background: var(--primary);
  color: #ffffff;
}

button:hover,
.pay-button:hover {
  transform: translateY(-1px);
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

/* Mensajes */

.message {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* Resultado */

.result {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.result h2 {
  margin: 5px 0 0;
  font-size: 26px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 14px;
  font-weight: 800;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 23px;
}

.detail {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.detail span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.detail strong {
  color: var(--text);
  font-size: 18px;
}

.total-box {
  border-color: #c9def8;
  background: var(--primary-soft);
}

.total-box strong {
  color: var(--primary-dark);
  font-size: 27px;
}

/* Webpay */

.pay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 19px;
  background: #172033;
  color: #ffffff;
}

.pay-button:hover {
  background: #0f1726;
}

.payment-security {
  margin-top: 15px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.payment-security strong {
  display: block;
  color: var(--text);
}

.payment-security p {
  margin: 4px 0 0;
}

/* Pie */

.portal-footer {
  margin-top: 31px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.portal-footer p {
  margin: 0;
  font-weight: 700;
  color: #475467;
}

.portal-footer small {
  display: block;
  margin-top: 5px;
}

/* Teléfonos */

@media (max-width: 620px) {
  .page-shell {
    padding: 16px 10px;
  }

  .card {
    padding: 24px 19px;
    border-radius: 20px;
  }

  .m2t-logo {
    width: 190px;
    max-height: 125px;
  }

  .portal-header h1 {
    font-size: 29px;
  }

  .portal-description {
    font-size: 15px;
  }

  .secure-notice {
    align-items: flex-start;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row button {
    width: 100%;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* =========================================================
   MEDIOS DE PAGO
   ========================================================= */

[hidden] {
  display: none !important;
}

.payment-heading {
  margin-top: 28px;
  margin-bottom: 18px;
  text-align: center;
}

.payment-heading h3 {
  margin: 6px 0 5px;
  color: var(--text);
  font-size: 24px;
}

.payment-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

/*
 * Se usa mayor especificidad para anular el estilo
 * azul general aplicado a todos los botones.
 */
.payment-methods .payment-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;

  width: 100%;
  min-height: 118px;
  margin: 0;
  padding: 19px;

  border: 1px solid var(--line);
  border-radius: 16px;

  color: var(--text);
  background: #ffffff;

  text-align: left;
  cursor: pointer;

  box-shadow: none;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.payment-methods .payment-option:hover {
  transform: translateY(-2px);

  border-color: var(--primary);
  background: #ffffff;

  box-shadow:
    0 10px 26px rgba(18, 98, 196, 0.12);
}

.payment-methods .payment-option:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.payment-option-title {
  display: block;
  width: 100%;
  margin-bottom: 8px;

  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

.payment-option-text {
  display: block;
  width: 100%;

  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

/* Webpay */

.payment-methods .webpay-option {
  border-top: 4px solid #f53241;
}

.webpay-option .payment-option-title {
  color: #20272d;
}

/* Mercado Pago */

.payment-methods .mercadopago-option {
  border-top: 4px solid #08a6df;
}

.mercadopago-option .payment-option-title {
  color: #087ca6;
}

/* Flow */

.payment-methods .flow-option {
  border-top: 4px solid #7357d8;
}

.flow-option .payment-option-title {
  color: #6047bb;
}

/* Transferencia */

.payment-methods .transfer-option {
  border-top: 4px solid var(--primary);
}

.transfer-option .payment-option-title {
  color: var(--primary-dark);
}

/* =========================================================
   PANEL DE TRANSFERENCIA
   ========================================================= */

.transfer-panel {
  margin-top: 16px;
  padding: 20px;

  border: 1px solid #c9def8;
  border-radius: 16px;

  background: var(--primary-soft);
}

.transfer-header h3 {
  margin: 5px 0;
  color: var(--text);
  font-size: 21px;
}

.transfer-header p {
  margin: 0;

  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.bank-data {
  margin-top: 17px;
  padding: 13px 15px;

  border: 1px solid #bedaf8;
  border-radius: 14px;

  background: #ffffff;
}

.bank-data > div {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 12px;

  padding: 8px 0;

  border-bottom: 1px dashed #c4d9ed;
}

.bank-data > div:last-child {
  border-bottom: 0;
}

.bank-data span {
  color: var(--muted);
  font-size: 13px;
}

.bank-data strong {
  color: var(--text);
  text-align: right;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/*
 * Sobrescribe también el estilo general de button.
 */
.transfer-panel .copy-bank-button {
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;

  border: 0;
  border-radius: 13px;

  color: #ffffff;
  background: var(--primary);

  font-weight: 800;
  cursor: pointer;
}

.transfer-panel .copy-bank-button:hover {
  background: var(--primary-dark);
}

.copy-status {
  min-height: 19px;
  margin: 8px 0 0;

  color: #19733d;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 650px) {
  .payment-methods {
    grid-template-columns: 1fr;
  }

  .payment-methods .payment-option {
    min-height: auto;
  }
}
/* =========================================================
   BOTONES DE PAGO MÁS VISIBLES
   ========================================================= */

.payment-methods .payment-option {
  position: relative;
  min-height: 126px;

  border-width: 2px;
  border-style: solid;

  box-shadow:
    0 8px 20px rgba(24, 62, 110, 0.10);

  overflow: hidden;
}

/* Flecha que indica acción */

.payment-methods .payment-option::after {
  content: "›";

  position: absolute;
  right: 18px;
  bottom: 14px;

  display: grid;
  place-items: center;

  width: 32px;
  height: 32px;

  border-radius: 50%;

  color: #ffffff;
  background: var(--primary);

  font-size: 25px;
  font-weight: 800;
  line-height: 1;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.payment-methods .payment-option:hover::after {
  transform: translateX(3px);
}

/* Texto inferior tipo botón */

.payment-option-text {
  max-width: calc(100% - 45px);
  padding-bottom: 28px;
}

/* Webpay */

.payment-methods .webpay-option {
  border-color: #f53241;
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #fff4f5 100%
    );
}

.webpay-option::after {
  background: #f53241 !important;
}

/* Mercado Pago */

.payment-methods .mercadopago-option {
  border-color: #08a6df;
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #effbff 100%
    );
}

.mercadopago-option::after {
  background: #08a6df !important;
}

/* Flow */

.payment-methods .flow-option {
  border-color: #7357d8;
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #f5f2ff 100%
    );
}

.flow-option::after {
  background: #7357d8 !important;
}

/* Transferencia */

.payment-methods .transfer-option {
  border-color: var(--primary);
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #eff6ff 100%
    );
}

.transfer-option::after {
  background: var(--primary) !important;
}

/* Estado al presionar */

.payment-methods .payment-option:active {
  transform: scale(0.98);

  box-shadow:
    0 3px 10px rgba(24, 62, 110, 0.15);
}

/* Accesibilidad por teclado */

.payment-methods .payment-option:focus-visible {
  outline: 4px solid rgba(18, 98, 196, 0.22);
  outline-offset: 3px;
}

/* =========================================================
   AJUSTE ESPECIAL PARA CELULAR
   ========================================================= */

@media (max-width: 650px) {
  .payment-methods {
    gap: 14px;
  }

  .payment-methods .payment-option {
    min-height: 112px;
    padding: 18px 58px 18px 18px;

    border-radius: 15px;

    box-shadow:
      0 7px 18px rgba(24, 62, 110, 0.13);
  }

  .payment-option-title {
    font-size: 18px;
  }

  .payment-option-text {
    max-width: 100%;
    padding-bottom: 0;
    font-size: 13px;
  }

  .payment-methods .payment-option::after {
    right: 15px;
    top: 50%;
    bottom: auto;

    width: 36px;
    height: 36px;

    transform: translateY(-50%);

    font-size: 28px;
  }

  .payment-methods .payment-option:hover::after {
    transform:
      translateY(-50%)
      translateX(3px);
  }
}

.payment-brand-logo {
  display: block;
  width: auto;
  max-width: 170px;
  height: 48px;
  margin-bottom: 15px;
  object-fit: contain;
  object-position: left center;
}

.santander-logo {
  max-width: 185px;
  height: 43px;
}

.payment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: auto;
  padding: 9px 15px;

  border-radius: 999px;

  color: #ffffff;
  background: var(--primary);

  font-size: 13px;
  font-weight: 800;
}

.webpay-option .payment-action {
  background: #f53241;
}

.mercadopago-option .payment-action {
  background: #08a6df;
}

.flow-option .payment-action {
  background: #7357d8;
}

.transfer-option .payment-action {
  background: #ec0000;
}

@media (max-width: 650px) {
  .payment-methods .payment-option {
    min-height: 145px;
    padding: 18px;
  }

  .payment-brand-logo {
    max-width: 150px;
    height: 42px;
  }

  .payment-action {
    margin-top: 14px;
  }
}

.payment-logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 62px;
  margin-bottom: 12px;
}

.payment-brand-logo {
  display: block;
  width: auto;
  max-width: 190px;
  height: 55px;
  object-fit: contain;
  object-position: left center;
}

.webpay-logo {
  max-width: 190px;
}

.mercadopago-logo {
  max-width: 185px;
}

.flow-logo {
  max-width: 155px;
}

.santander-logo {
  max-width: 190px;
}

.payment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding: 11px 14px;
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.webpay-action {
  background: #f53241;
}

.mercadopago-action {
  background: #08a6df;
}

.flow-action {
  background: #7357d8;
}

.santander-action {
  background: #ec0000;
}

.payment-methods .payment-option::after {
  display: none !important;
}

@media (max-width: 650px) {
  .payment-methods .payment-option {
    min-height: 185px;
    padding: 20px;
  }

  .payment-logo-container {
    justify-content: center;
  }

  .payment-brand-logo {
    max-width: 170px;
    height: 50px;
    object-position: center;
  }

  .payment-option-text {
    max-width: 100%;
    padding-bottom: 16px;
    text-align: center;
  }

  .payment-action {
    margin-top: auto;
  }
}

/* Ajuste especial tarjeta Webpay */

.webpay-option .payment-logo-container {
  min-height: 76px;
  align-items: center;
}

.webpay-option .webpay-logo {
  width: 230px;
  max-width: 90%;
  height: 68px;
  object-fit: contain;
  object-position: left center;
  transform: scale(1.12);
  transform-origin: left center;
}

.webpay-option .payment-option-text {
  margin-top: 2px;
}

/* Equilibrar el contenido de todas las tarjetas */

.payment-methods .payment-option {
  min-height: 228px;
}

.payment-logo-container {
  min-height: 76px;
}

.payment-option-text {
  min-height: 48px;
  margin-bottom: 16px;
}

.payment-action {
  margin-top: auto;
}

/* Ajuste móvil */

@media (max-width: 650px) {
  .webpay-option .payment-logo-container {
    justify-content: center;
  }

  .webpay-option .webpay-logo {
    width: 225px;
    max-width: 95%;
    height: 66px;
    object-position: center;
    transform: scale(1.14);
    transform-origin: center;
  }

  .payment-methods .payment-option {
    min-height: 220px;
  }

  .payment-option-text {
    min-height: auto;
  }
}

/* =========================================================
   Mejor legibilidad en celulares
   ========================================================= */

html {
  font-size: 16px;
}

body {
  font-size: 1rem;
  line-height: 1.55;
}

input,
button,
select,
textarea {
  font-size: 1rem;
}

/* Celulares */
@media (max-width: 600px) {
  html {
    font-size: 18px;
  }

  body {
    line-height: 1.6;
  }

  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.45rem !important;
    line-height: 1.25;
  }

  h3 {
    font-size: 1.25rem !important;
    line-height: 1.3;
  }

  p,
  label,
  small,
  span {
    font-size: 1rem;
  }

  input {
    min-height: 52px;
    font-size: 1.1rem;
  }

  button,
  .payment-option,
  .payment-action,
  .receipt-button,
  .copy-bank-button {
    font-size: 1.05rem !important;
  }

  .portal-description,
  .payment-option-text,
  .payment-heading p,
  .payment-security p,
  .secure-notice p,
  .portal-footer p,
  .portal-footer small {
    font-size: 1rem !important;
  }

  .detail span,
  .receipt-row span,
  .bank-data span {
    font-size: 0.95rem !important;
  }

  .detail strong,
  .receipt-row strong,
  .bank-data strong {
    font-size: 1.05rem !important;
  }

  #totalDebt,
  .receipt-total strong {
    font-size: 1.55rem !important;
  }

  .status,
  .eyebrow,
  .portal-label {
    font-size: 0.9rem !important;
  }
}
