/* Portal de CorePago: paleta, tipografía y escala de la página de inicio (cp:D-023, cp:D-025, cp:D-026; cpp:D-018). */
:root {
  --logo-navy: #053275;
  --navy: #002F87;
  --azul: #0033A0;
  --oscuro: #001E5A;
  --cian: #00A8E8;
  --cian-oscuro: #0097CE;
  --oro: #FFD100;
  --oro-hover: #F5B700;
  --fondo: #F4F7FC;
  --tinta: #0f172a;
  --texto: #1e293b;
  --tenue: #334155;
  --borde: #e2e8f0;
  --borde-fuerte: #cbd5e1;
  --error: #b42318;
  --error-fondo: #fdecea;
  --alerta: #fef3c7;
  --alerta-borde: #f59e0b;
  --ok: #047857;
  --ok-fondo: #d1fae5;
  --pie: #020617;
  --radio: 0.75rem;
  --radio-grande: 1.5rem;
  --sombra: 0 10px 15px -3px rgba(0, 47, 135, 0.08), 0 4px 6px -4px rgba(0, 47, 135, 0.06);
  --texto-xs: 0.8125rem;
  --texto-sm: 0.9375rem;
  --texto-base: 1.0625rem;
  --texto-lg: 1.1875rem;
  --texto-xl: 1.375rem;
  --texto-2xl: 1.625rem;
  --texto-3xl: 2rem;
  --texto-4xl: 2.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--texto-base);
  line-height: 1.625;
  color: var(--tinta);
  background: var(--fondo);
  text-rendering: optimizeLegibility;
}

::selection { background: var(--cian); color: #fff; }

a { color: var(--navy); font-weight: 600; text-underline-offset: 3px; }
a:hover { color: var(--azul); }
:focus-visible { outline: 3px solid var(--cian); outline-offset: 2px; }

h1, h2, h3 { color: var(--navy); font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
h1 { margin: 0 0 16px; font-size: var(--texto-3xl); }
h2 { margin: 32px 0 12px; font-size: var(--texto-xl); }
h3 { margin: 24px 0 8px; font-size: var(--texto-lg); }
p { margin: 0 0 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.92em; }
pre { overflow-x: auto; background: var(--tinta); color: #f8fafc; padding: 16px; border-radius: var(--radio); font-size: var(--texto-sm); }
img { max-width: 100%; }

/* Encabezado: el de la página de inicio. */
.barra {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--logo-navy);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.barra-interior {
  max-width: 80rem;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: 5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.marca { display: block; line-height: 0; }
.marca img { height: 3.5rem; width: auto; }
.navegacion { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: var(--texto-sm); }
.navegacion a, .navegacion .enlace { color: #fff; font-weight: 600; text-decoration: none; }
.navegacion a:hover, .navegacion .enlace:hover { color: var(--oro); }
.navegacion a.boton { color: var(--oscuro); margin: 0; }
.navegacion a.boton:hover { color: var(--oscuro); }

main { flex: 1; width: 100%; max-width: 72rem; margin: 32px auto; padding: 0 16px; }

/* Tarjetas. */
.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 32px;
  box-shadow: var(--sombra);
  overflow-x: auto;
}
.tarjeta + .tarjeta { margin-top: 24px; }
.tarjeta-angosta { max-width: 32rem; margin-left: auto; margin-right: auto; }

/* Formularios. */
form label { display: block; margin: 16px 0; font-weight: 600; color: var(--texto); }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="date"],
form input[type="url"], form input[type="number"], form input[type="tel"], form select, form textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio);
  background: #fff;
  color: var(--tinta);
  font: inherit;
  font-weight: 400;
}
form input:focus, form select:focus, form textarea:focus { outline: 3px solid rgba(0, 168, 232, 0.35); border-color: var(--cian); }
form small { display: block; margin-top: 4px; color: var(--tenue); font-size: var(--texto-sm); font-weight: 400; }
fieldset { border: 1px solid var(--borde); border-radius: var(--radio); margin: 16px 0; padding: 12px 16px; }
legend { font-weight: 700; color: var(--navy); padding: 0 4px; }
fieldset label { font-weight: 400; }
input[type="file"] { display: block; margin-top: 6px; font: inherit; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--navy); }

/* Botones: navy, oro y claro como en la página de inicio; siempre separados entre sí. */
.boton {
  display: inline-block;
  margin: 4px 12px 4px 0;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radio);
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: var(--texto-sm);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.boton:hover { background: var(--azul); color: #fff; }
.boton-oro { background: var(--oro); color: var(--oscuro); }
.boton-oro:hover { background: var(--oro-hover); color: var(--oscuro); }
.boton-grande { padding: 16px 28px; font-size: var(--texto-base); font-weight: 800; }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.acciones .boton { margin: 0; }
form .boton { margin-top: 8px; }
form + p { margin-top: 24px; }
td .boton, td .en-linea .boton { margin: 4px 0; padding: 8px 14px; }

.en-linea { display: inline; margin: 0; }
.enlace { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Avisos y estados. */
.errores { color: var(--error); background: var(--error-fondo); border-radius: var(--radio); padding: 12px 16px 12px 36px; font-weight: 600; }
.error { color: var(--error); font-weight: 600; }
.alerta { background: var(--alerta); border-left: 4px solid var(--alerta-borde); border-radius: var(--radio); padding: 12px 16px; color: var(--tinta); }
.alerta p:last-child { margin-bottom: 0; }
.llaves dt { font-weight: 700; color: var(--texto); }
.llaves dd { margin: 4px 0 16px; word-break: break-all; }
.deshabilitado { color: var(--tenue); font-style: italic; }
.modalidad { background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid var(--navy); border-radius: var(--radio); padding: 12px 16px; color: var(--texto); }
.modalidad-contratos { border-left-color: var(--cian-oscuro); }
.modalidad strong { color: var(--navy); }

table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: var(--texto-sm); }
th { text-align: left; padding: 10px 8px; color: var(--tenue); font-size: var(--texto-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--borde); }
td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.montos td:last-child, .montos th:last-child { text-align: right; }
.con-error td { color: var(--error); }
.estado { display: inline-block; padding: 2px 10px; border-radius: 9999px; background: var(--borde); color: var(--tinta); font-size: var(--texto-xs); font-weight: 700; }
.estado-activo, .estado-pagado { background: var(--ok-fondo); color: var(--ok); }
.estado-pendiente, .estado-prueba { background: var(--alerta); color: #92400e; }
.estado-vencido, .estado-fallido, .estado-suspendido { background: var(--error-fondo); color: var(--error); }
.saldo { font-size: var(--texto-lg); }
.periodo label { display: inline-block; margin-right: 16px; }
.pasos li { margin: 6px 0; }

.pestanas { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--borde); font-size: var(--texto-sm); }
.qr { width: 240px; height: 240px; image-rendering: pixelated; }

/* De vuelta a la página de inicio, que es la que explica las modalidades (`cpp:D-025`). */
.volver { margin: 0 0 16px; font-size: var(--texto-sm); font-weight: 600; }

/* Pie: el de la página de inicio. */
.pie { background: var(--pie); color: #cbd5e1; border-top: 1px solid #1e293b; font-size: var(--texto-sm); }
.pie-interior {
  max-width: 80rem;
  margin: 0 auto;
  padding: 40px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.pie-marca { line-height: 0; }
.pie-marca img { height: 3rem; width: auto; }
.pie-enlaces { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.pie a { color: #e2e8f0; font-weight: 600; text-decoration: none; }
.pie a:hover { color: #fff; text-decoration: underline; }
.pie-derechos { margin: 0; color: #94a3b8; font-size: var(--texto-xs); }

@media (max-width: 640px) {
  h1 { font-size: var(--texto-2xl); }
  .marca img { height: 2.5rem; }
  .barra-interior { min-height: 4rem; }
  main { margin: 20px auto; }
  .tarjeta { padding: 20px; border-radius: 1rem; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  td { border: 0; padding: 4px 0; }
  tr { border-bottom: 1px solid var(--borde); padding: 8px 0; }
  .montos td:last-child { text-align: left; }
}

/* Página pública y enlace de pago del comercio (cpp:D-019). `--marca` sale de /c/<comercio>/estilo.css. */
.micrositio { --marca: var(--navy); }
.micrositio h1, .micrositio h2 { color: var(--marca); }
.micrositio-cabeza { border-top: 6px solid var(--marca); }
.micrositio-logo { display: block; max-height: 96px; width: auto; margin: 0 0 16px; }
.micrositio-giro { color: var(--tenue); font-weight: 600; }
.micrositio-pie { text-align: center; color: var(--tenue); margin-top: 16px; }
.micrositio .boton { background: var(--marca); }
.texto-largo { white-space: pre-line; }
.checklist { list-style: none; padding: 0; }
.checklist li { margin: 6px 0; font-weight: 600; }
.checklist .listo { color: var(--ok); }
.checklist .falta { color: var(--error); }
.cobro-enlace + .cobro-enlace { border-top: 1px solid var(--borde); padding-top: 12px; }
.estado-parcial, .estado-vigente { background: var(--alerta); color: #92400e; }

/* /documentacion (cpp:D-026): Swagger UI con su propia hoja; aquí solo se le quita lo que el portal pone a todo. */
.doc-api-descarga { margin: 0 0 8px; }
.doc-api .swagger-ui pre { background: #333; color: #fff; padding: 0.5em; border-radius: 4px; font-size: 12px; }
.doc-api .swagger-ui table { margin: 0; font-size: inherit; }
.doc-api .swagger-ui h1, .doc-api .swagger-ui h2, .doc-api .swagger-ui h3 { letter-spacing: normal; }
.doc-api .swagger-ui .wrapper { padding: 0; }

/* Logos de los medios en la página de pago (`cpp:D-028`): vendorizados en /assets/medios/, desde 'self'. */
.medio-opcion { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.medio-logo { display: inline-block; height: 36px; width: auto; vertical-align: middle; }
.medio-logo-chico { height: 24px; }
.medio-tiendas { display: block; max-width: 100%; height: auto; margin: 8px 0; }
.medios-lista { list-style: none; padding: 0; }
.medios-lista li { padding: 12px 0; border-bottom: 1px solid var(--borde); }
.medios-lista li:last-child { border-bottom: 0; }
.demostracion { border-left: 4px solid var(--marca); }
.datos-comercio dt { font-weight: 700; color: var(--texto); }
.datos-comercio dd { margin: 4px 0 12px; }
