/* =========================================================
   PortalWeb - Plantilla base
   Paleta inspirada en un portal institucional dominicano
   ========================================================= */
:root {
    --c-navy-900: #0a1921;
    --c-navy-800: #1e4255;
    --c-navy-700: #1a4359;
    --c-navy-500: #578699;
    --c-accent: #b3e0f9;
    --c-accent-dark: #1fa3a6;
    --c-bg: #134c6d;
    --c-text: #172f45;
    --c-white: #ffffff;
    --radius-xl: 48px;
    --radius-lg: 24px;
    --radius-md: 12px;
    --shadow-sm: 0 4px 16px rgba(26, 67, 89, .08);
    --shadow-md: 0 12px 32px rgba(26, 67, 89, .14);
    --font-base: "Saira", system-ui, sans-serif;
    --font-display: "Saira Extra Condensed", "Saira", sans-serif;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-base);
    font-weight: 300;
    background: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--c-navy-700); }
a { color: var(--c-navy-700); }
a:hover { color: var(--c-accent-dark); }

.skip-link {
    position: absolute; left: -999px; top: 8px; z-index: 2000;
    background: var(--c-accent); color: var(--c-navy-900); padding: 8px 16px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: var(--radius-md); padding: .65rem 1.5rem; }
.btn-accent { background: var(--c-accent); color: var(--c-navy-800); border: 0; }
.btn-accent:hover, .btn-accent:focus { background: var(--c-accent-dark); color: var(--c-navy-900); }
.btn-navy { background: var(--c-navy-700); color: #fff; border: 0; }
.btn-navy:hover, .btn-navy:focus { background: var(--c-navy-800); color: #fff; }
.btn-outline-navy { border: 2px solid var(--c-navy-700); color: var(--c-navy-700); }
.btn-outline-navy:hover { background: var(--c-navy-700); color: #fff; }

.btn-icon {
    width: 44px; height: 44px; display: inline-grid; place-items: center;
    border: 0; border-radius: 10px; color: #fff; font-size: 1.4rem;
    background: rgba(255, 255, 255, .08); transition: background .2s;
}
.btn-icon:hover { background: rgba(255, 255, 255, .18); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1030;
    background: var(--c-navy-700);
    border-bottom-left-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}
.header-top { background: var(--c-navy-800); border-bottom-left-radius: var(--radius-xl); padding: 1rem 0; }
.header-bar { background: var(--c-bg);padding: .9rem 0;
}

.brand-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-logo img { height: 72px; width: 72px; display: block; filter: drop-shadow(0 4px 10px rgba(10, 25, 33, .35)); }

.brand-org { color: #fff; padding-left: 1.25rem; line-height: 1.3; }
.brand-org strong { display: block; font-weight: 500; font-size: .85rem; letter-spacing: .06em; }
.brand-org span { display: block; font-size: .8rem; letter-spacing: .06em; color: var(--c-navy-500); }

.portal-name { color: #fff; font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; }
.portal-name i { color: var(--c-accent); font-size: 1.3rem; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    background: var(--c-accent);
    margin-top: -48px; padding: calc(48px + 4rem) 0 4rem;
    border-bottom-right-radius: var(--radius-xl);
}
.hero-title {
    font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
    font-size: clamp(3.5rem, 11vw, 8.5rem); line-height: 1; color: var(--c-navy-900); margin-bottom: 1.5rem;
}
.hero-lead { font-size: 1.2rem; font-weight: 400; color: var(--c-navy-800); max-width: 520px; }
.hero-art {
    position: relative; aspect-ratio: 1; max-width: 420px; margin-inline: auto;
    border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0, #dff6f6 60%, #bfeeee 100%);
    display: grid; place-items: center; box-shadow: var(--shadow-md);
}
.hero-art .phone {
    width: 46%; aspect-ratio: 9/18; background: var(--c-navy-800); border-radius: 28px; padding: 10px;
    box-shadow: 0 20px 40px rgba(10, 25, 33, .35); display: flex; flex-direction: column; gap: 8px;
}
.hero-art .phone span { display: block; border-radius: 8px; background: rgba(255, 255, 255, .9); }
.hero-art .phone span:nth-child(1) { height: 14%; background: var(--c-accent); }
.hero-art .phone span:nth-child(2) { height: 22%; }
.hero-art .phone span:nth-child(3) { height: 22%; }
.hero-art .phone span:nth-child(4) { flex: 1; background: rgba(255, 255, 255, .15); }

/* ---------- Secciones ---------- */
.section { padding: 5rem 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 3rem); text-align: center; margin-bottom: .75rem; }
.section-sub { text-align: center; font-size: 1.15rem; margin-bottom: 3rem; }

.card-pu {
    background: #fff; border: 0; border-radius: var(--radius-lg); padding: 2rem; height: 100%;
    box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s;
}
.card-pu:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-pu .icon {
    width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
    background: rgba(41, 191, 194, .15); color: var(--c-navy-700); font-size: 1.6rem; margin-bottom: 1.25rem;
}
.card-pu h3 { font-size: 1.25rem; margin-bottom: .5rem; }

.band-dark {
    background: var(--c-navy-700); color: #fff;
    border-top-left-radius: var(--radius-xl); border-bottom-right-radius: var(--radius-xl);
}
.band-dark h2, .band-dark h3 { color: #fff; }
.band-dark .card-pu { background: rgba(255, 255, 255, .06); color: #fff; box-shadow: none; }
.band-dark .card-pu h3 { color: #fff; }

.blog-card { overflow: hidden; padding: 0; }
.blog-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--c-navy-700), var(--c-accent)); }
.blog-card .body { padding: 1.5rem; }
.blog-meta { font-size: .85rem; color: var(--c-navy-500); font-weight: 500; }
.tag {
    display: inline-block; font-size: .75rem; font-weight: 500; padding: .2rem .65rem; margin: 0 .25rem .35rem 0;
    border-radius: 999px; background: rgba(26, 67, 89, .08); color: var(--c-navy-700);
}

.newsletter {
    background: var(--c-navy-800); color: #fff; border-radius: var(--radius-lg); padding: 3rem;
}
.newsletter h2 { color: #fff; }
.newsletter .form-control {
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff;
    border-radius: var(--radius-md); padding: .75rem 1rem;
}
.newsletter .form-control::placeholder { color: rgba(255, 255, 255, .6); }
.newsletter .form-control:focus { box-shadow: 0 0 0 .2rem rgba(41, 191, 194, .35); border-color: var(--c-accent); }

/* ---------- Página interna ---------- */
.page-header { background: var(--c-accent); margin-top: -48px; padding: calc(48px + 3rem) 0 3rem; border-bottom-right-radius: var(--radius-xl); }
.page-header h1 { color: var(--c-navy-900); font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.breadcrumb a { color: var(--c-navy-800); }

/* ---------- Validación (login) ---------- */
.login-card {
    background: #fff; border-radius: var(--radius-lg); padding: 2.5rem 2rem;
    box-shadow: 0 24px 48px rgba(10, 25, 33, .2); max-width: 460px; text-align: left;
}
.login-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center;
    background: rgba(41, 191, 194, .15); color: var(--c-navy-700); font-size: 2rem;
}
.text-muted-pu { color: var(--c-navy-500); }
.login-card .form-label { font-weight: 600; color: var(--c-navy-700); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--c-navy-500); pointer-events: none; }
.input-icon .form-control { padding-left: 2.75rem; border-radius: var(--radius-md); border-color: rgba(26, 67, 89, .2); font-weight: 400; }
.input-icon .form-control:focus { border-color: var(--c-accent); box-shadow: 0 0 0 .2rem rgba(41, 191, 194, .3); }
.input-icon .form-control.input-validation-error { border-color: #dc3545; }

.user-chip {
    align-items: center; gap: .4rem; color: #fff; font-weight: 500;
    background: rgba(255, 255, 255, .08); padding: .45rem .9rem; border-radius: 999px;
}
.user-chip i { color: var(--c-accent); }

/* ---------- Opciones de pago ---------- */
.option-card { display: flex; flex-direction: column; text-decoration: none; color: var(--c-text); border: 2px solid transparent; }
.option-card:hover { color: var(--c-text); border-color: var(--c-accent); }
.option-card p { flex: 1; }
.option-go { font-weight: 600; color: var(--c-navy-700); }
.option-go i { transition: transform .2s; }
.option-card:hover .option-go i { transform: translateX(4px); }

/* ---------- Mensajes ---------- */
.mensaje-flotante { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 1080; width: min(560px, calc(100% - 32px)); }
.mensaje-flotante .alert { border-radius: var(--radius-md); font-weight: 500; }

/* ---------- Pago de inscripción ---------- */
/* Panel único: secciones separadas por líneas, sin tarjetas anidadas */
.panel-pago, .resumen-pago, .politicas { height: auto; }
.panel-pago:hover, .resumen-pago:hover, .politicas:hover { transform: none; }
.panel-pago { padding: 0; overflow: hidden; }
.panel-seccion { padding: 1.1rem 1.5rem; }
.panel-seccion + .panel-seccion { border-top: 1px solid rgba(26, 67, 89, .1); }
.panel-tabla { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.panel-titulo {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--c-navy-500); margin: 0 1.5rem .6rem;
}

.datos-grid { display: grid; grid-template-columns: 1.4fr .8fr 1.6fr; gap: .75rem 1.5rem; }
.dato-label { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-navy-500); margin-bottom: .15rem; }
.dato-valor { display: block; font-weight: 600; color: var(--c-navy-800); }

.cuotas { display: inline-flex; gap: .4rem; }
.cuota {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-weight: 700;
    border: 2px solid rgba(26, 67, 89, .15); text-decoration: none; color: var(--c-navy-700); transition: all .2s;
}
.cuota:hover { border-color: var(--c-accent); color: var(--c-navy-700); }
.cuota.active { background: var(--c-navy-700); border-color: var(--c-navy-700); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; }
.chip-ok { background: rgba(25, 135, 84, .1); color: #146c43; }
.chip-error { background: rgba(220, 53, 69, .1); color: #b02a37; }
.chip-pendiente { background: rgba(255, 193, 7, .18); color: #8a6100; }

.table-pu { font-size: .875rem; }
.table-pu thead th { background: var(--c-navy-700); color: #fff; font-weight: 600; white-space: nowrap; border: 0; padding: .55rem .75rem; }
.table-pu td { padding: .5rem .75rem; vertical-align: middle; }
.table-pu th:first-child, .table-pu td:first-child { padding-left: 1.5rem; }
.table-pu th:last-child, .table-pu td:last-child { padding-right: 1.5rem; }
.table-pu tfoot td { font-weight: 700; background: rgba(26, 67, 89, .06); border-bottom: 0; }
.table-pu tr:has(.chk-sumar:checked) td { background: rgba(41, 191, 194, .1); }
.chk-sumar { width: 1.15em; height: 1.15em; cursor: pointer; }
.badge-reglamentario { background: rgba(220, 53, 69, .12); color: #b02a37; }
.badge-pendiente { background: rgba(25, 135, 84, .12); color: #146c43; }

.resumen-pago { position: sticky; top: 215px; } /* debajo del encabezado fijo */
.total-pagar {
    background: var(--c-navy-800); color: #fff; border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
    display: flex; flex-direction: column;
}
.total-pagar span { font-size: .9rem; opacity: .8; }
.total-pagar strong { font-size: 1.9rem; color: var(--c-accent); line-height: 1.2; }

.politicas { font-size: .85rem; }
.politicas h2 { color: var(--c-navy-700); }
.politicas .tarjetas { max-width: 260px; }

@media (max-width: 991.98px) { .resumen-pago { position: static; } }
@media (max-width: 767.98px) { .datos-grid { grid-template-columns: 1fr 1fr; } .dato-carrera { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .panel-seccion { padding: 1rem; } .panel-titulo { margin-inline: 1rem; } }

/* ---------- Recibo ---------- */
/* Flexible: los datos cortos se compactan y la referencia (valor largo) toma el doble de espacio. */
.recibo-grid { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.recibo-grid > div { flex: 1 1 120px; min-width: 0; }
.recibo-grid > .recibo-ancho { flex: 2 1 240px; }
.recibo-grid .dato-valor { overflow-wrap: anywhere; }
.recibo-monto .dato-valor { font-size: 1.3rem; color: var(--c-navy-800); }

@media print {
    .site-header, .site-footer, .back-to-top, .mensaje-flotante, .no-print { display: none !important; }
    body { background: #fff; }
    .section { padding: 0 !important; }
    .card-pu { box-shadow: none; border: 1px solid #ccc; }
    .table-pu thead th { background: #eee !important; color: #000 !important; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--c-navy-900); color: #fff; border-top-left-radius: var(--radius-xl); margin-top: 4rem; overflow: hidden; }
.footer-bottom { padding: 1.5rem 0; text-align: center; font-size: .85rem; color: rgba(255, 255, 255, .8); }
.footer-bottom a { color: var(--c-accent); text-decoration: none; }

/* ---------- Volver arriba ---------- */
.back-to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 1020;
    width: 46px; height: 46px; border: 0; border-radius: 12px;
    background: var(--c-navy-500); color: #fff; font-size: 1.2rem;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--c-navy-700); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    :root { --radius-xl: 32px; }
    .section { padding: 3.5rem 0; }
    .hero { text-align: center; }
    .hero-lead { margin-inline: auto; }
}
@media (max-width: 575.98px) {
    :root { --radius-xl: 24px; }
    .header-bar .btn-accent { padding-inline: 1.5rem !important; }
    .brand-logo img { height: 56px; width: 56px; }
    .newsletter { padding: 2rem 1.25rem; }
    .hero-art { max-width: 300px; }
}

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
