:root {
    --ceub-blue: #173d70;
    --ceub-blue-dark: #102d54;
    --ceub-blue-soft: #eaf0f7;
    --ceub-red: #b3262d;
    --text-main: #27364a;
    --text-muted: #66758a;
    --page-bg: #f4f6f9;
}
html { min-height: 100%; }
body {
    min-height: 100vh; display: flex; flex-direction: column;
    background: var(--page-bg); color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.site-header { position: relative; z-index: 10; }
.navbar { min-height: 82px; }
.brand-logo { width: 58px; height: 58px; object-fit: contain; }
.brand-logo-horizontal { width: 205px; height: auto; max-height: 64px; object-fit: contain; }
.brand-divider { height: 42px; width: 1px; background: #d9e0e9; margin: 0 15px; }
.brand-title { color: var(--ceub-blue); font-weight: 700; letter-spacing: .02em; }
.navbar .nav-link { color: #34445a; font-weight: 500; padding: .8rem .85rem !important; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--ceub-blue); }
.navbar .nav-link.active { font-weight: 700; }
.navbar-toggler { border-color: #d8e0e9; }
.btn-ceub { background: var(--ceub-blue); border-color: var(--ceub-blue); color: #fff; }
.btn-ceub:hover, .btn-ceub:focus { background: var(--ceub-blue-dark); border-color: var(--ceub-blue-dark); color: #fff; }
.btn-outline-ceub { color: var(--ceub-blue); border-color: var(--ceub-blue); }
.btn-outline-ceub:hover, .btn-outline-ceub:focus { background: var(--ceub-blue); color: #fff; }
.site-main { flex: 1 0 auto; position: relative; overflow: hidden; }
.site-main:before {
    content: ""; position: fixed; z-index: -1; pointer-events: none;
    width: 390px; height: 390px; right: -95px; bottom: 70px;
    background: url("../img/titulo.png") center / contain no-repeat; opacity: .045;
}
.site-footer { flex-shrink: 0; background: var(--ceub-blue-dark); color: rgba(255,255,255,.88); padding: 18px 0; font-size: .9rem; }
.intro-section { text-align: center; margin: 8px auto 32px; max-width: 760px; }
.section-kicker { color: var(--ceub-red); font-size: .76rem; font-weight: 800; letter-spacing: .13em; }
.section-title { color: var(--ceub-blue); font-size: clamp(1.8rem, 3vw, 2.45rem); font-weight: 750; margin: 8px 0 10px; }
.section-description { color: var(--text-muted); margin: 0; line-height: 1.65; }
.service-card { background: #fff; border: 1px solid #e6ebf1; border-radius: 16px; overflow: hidden; box-shadow: 0 5px 22px rgba(22,48,80,.06); transition: transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(22,48,80,.12); }
.service-image-wrap { height: 178px; display: flex; align-items: center; justify-content: center; padding: 16px 20px 4px; background: linear-gradient(180deg, #f7f9fc, #fff); }
.service-image { max-width: 100%; max-height: 158px; object-fit: contain; }
.service-card-body { padding: 16px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.service-requirements { min-height: 42px; display: flex; align-items: flex-start; justify-content: flex-start; margin-bottom: 13px; }
.service-requirements .btn { font-size: .86rem; white-space: nowrap; }
.service-form-action { margin-top: auto; padding-top: 8px; }
.service-form-action .btn { width: 100%; font-size: .86rem; }
/* La vista pública usa .service-actions en formularios.php.
   Se define explícitamente para que no dependa de estilos antiguos. 
.service-actions { display: flex;  flex-direction: column;  align-items: stretch;  gap: 9px;  margin-top: auto;    width: 100%;     padding-top: 12px; }
*/
.service-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin-top: 0;
    width: 100%;
    padding-top: 0;
}
.service-actions .btn { display: flex; align-items: center; justify-content: center;  width: 100%; min-height: 43px;  white-space: normal;  font-size: .9rem;  border-radius: 8px;  padding: 9px 14px; }
.service-number { color: #9aa9bc; font-size: .76rem; font-weight: 800; letter-spacing: .12em; }
.service-card h2 { color: var(--ceub-blue); font-size: 1.35rem; font-weight: 700; margin: 5px 0 10px; }
/*.service-card p { color: var(--text-muted); line-height: 1.55; font-size: .94rem; flex: 0 0 100px; min-height: 100px; }
*/
.service-card p {
    color: var(--text-muted);
    line-height: 1.45;
    font-size: .94rem;
    flex: 0 0 76px;
    min-height: 90px;
    margin-bottom: 8px;
}
.contact-card, .map-card { background: #fff; border: 1px solid #e6ebf1; border-radius: 16px; box-shadow: 0 5px 22px rgba(22,48,80,.06); overflow: hidden; }
.map-card { min-height: 440px; }
.contact-card { padding: 26px; }
.contact-item { display: flex; gap: 16px; padding: 5px 0 22px; margin-bottom: 18px; border-bottom: 1px solid #edf0f4; }
.contact-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: var(--ceub-blue-soft); color: var(--ceub-blue); border-radius: 12px; font-size: 1.2rem; }
.contact-item h2 { color: var(--ceub-blue); font-size: 1rem; font-weight: 700; margin: 2px 0 6px; }
.contact-item p { color: var(--text-muted); margin: 0; line-height: 1.55; }
.contact-item a { color: var(--ceub-blue); text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }
#form:empty, #mensaje:empty, #pdf:empty { display: none; }
#form:not(:empty), #mensaje:not(:empty), #pdf:not(:empty) { margin-top: 1rem; }
@media (max-width: 575.98px) {
    .navbar { min-height: 70px; }
    .brand-logo { width: 48px; height: 48px; }
    .brand-logo-horizontal { width: 168px; max-height: 52px; }
    .site-main .container { padding-top: 1.5rem !important; }
    .intro-section { margin-bottom: 24px; }
    .service-image-wrap { height: 155px; }
    .service-image { max-height: 138px; }
    /*.service-card p { flex: 0 1 auto; min-height: 0; }
    .service-actions { margin-top: 8px; }*/
.service-card p {
        flex: 0 1 auto;
        min-height: 0;
        margin-bottom: 8px;
    }
    .map-card { min-height: 330px; }
    .contact-card { padding: 20px; }
    .site-footer { text-align: center; }
  .service-actions {
        margin-top: 0;
        padding-top: 0;
        width: 100%;
    }

    .service-actions .btn {
        width: 100%;
        min-height: 44px;
    }
}


/* Formulario de registro: Bootstrap 5 */
.registration-heading { text-align: center; max-width: 850px; margin: 0 auto 1.75rem; }
.registration-heading .section-description { font-size: .98rem; }
.registration-card { background: #fff; border: 1px solid #e3e9f0; border-radius: 15px; box-shadow: 0 5px 22px rgba(22,48,80,.055); overflow: visible; }
.registration-card-header { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px; border-bottom: 1px solid #edf0f4; background: linear-gradient(120deg, #fbfcfe, #f5f8fc); border-radius: 15px 15px 0 0; }
.registration-step { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: var(--ceub-blue-soft); color: var(--ceub-blue); font-weight: 800; }
.registration-card-header h2 { margin: 1px 0 4px; color: var(--ceub-blue); font-size: 1.12rem; font-weight: 750; }
.registration-card-header p { margin: 0; color: var(--text-muted); font-size: .9rem; line-height: 1.45; }
.registration-card-body { padding: 22px; }
.registration-card .form-label { color: #34445a; font-weight: 650; font-size: .91rem; margin-bottom: .42rem; }
.registration-card .form-control, .registration-card .form-select { min-height: 43px; border-color: #d8e0e9; border-radius: 8px; }
.registration-card .form-control:focus, .registration-card .form-select:focus { border-color: #7c9fc8; box-shadow: 0 0 0 .2rem rgba(23,61,112,.10); }
.registration-card .form-control[readonly] { background: #f7f9fb; color: #49586b; }
.registration-card .form-text { color: #78869a; }
.bank-account-callout { display: flex; justify-content: space-between; gap: 15px; align-items: center; flex-wrap: wrap; padding: 14px 17px; border: 1px solid #dce6f1; border-radius: 11px; background: #f6f9fd; color: var(--ceub-blue); }
.bank-account-callout div { display: flex; flex-direction: column; gap: 2px; }
.bank-account-callout strong { font-size: 1.1rem; }
.deposit-entry { border: 1px solid #e2e8ef; border-radius: 12px; padding: 16px; margin-top: 12px; background: #fff; }
.deposit-entry-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.deposit-index { color: var(--ceub-blue); font-weight: 750; }
.deposit-status { font-size: .82rem; }
.payment-summary { padding: 19px; border-radius: 12px; border: 1px solid #dce6f1; background: #f7f9fc; }
.payment-summary h3 { margin: 0 0 5px; color: var(--ceub-blue); font-size: 1.08rem; font-weight: 750; }
.payment-summary p { color: var(--text-muted); font-size: .88rem; }
.summary-label { display: block; color: var(--text-muted); font-size: .8rem; margin-bottom: 4px; }
.payment-summary .row strong { color: var(--ceub-blue); font-size: 1.12rem; }
.payment-state { border-top: 1px solid #e2e8ef; padding-top: 12px; font-size: .9rem; font-weight: 650; }
.registration-actions { padding-bottom: 8px; }
.registration-actions .btn { min-height: 44px; padding: .65rem 1.1rem; }
.registration-pdf-panel { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid #e3e9f0; background: #fff; border-radius: 14px; }
.registration-pdf-panel h3 { color: var(--ceub-blue); font-size: 1.2rem; font-weight: 750; }
.registration-pdf-panel p { color: var(--text-muted); }

/* Select2: permite leer nombres completos de carreras y programas largos. */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single { min-height: 43px; height: auto; border: 1px solid #d8e0e9; border-radius: 8px; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; padding: 9px 35px 9px 12px; color: #27364a; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 41px; right: 7px; }
.select2-dropdown { border-color: #cbd6e2; border-radius: 8px; overflow: hidden; }
.select2-results__option { white-space: normal !important; overflow-wrap: anywhere; word-break: normal; line-height: 1.4; padding: 10px 12px; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: #7c9fc8; box-shadow: 0 0 0 .2rem rgba(23,61,112,.10); }

@media (max-width: 575.98px) {
    .registration-card-header { padding: 16px; }
    .registration-card-body { padding: 16px; }
    .bank-account-callout { align-items: flex-start; }
    .deposit-entry { padding: 13px; }
    .payment-summary { padding: 15px; }
    .registration-actions .btn { width: 100%; }
}

.registration-card #carrera-p.is-invalid + .select2 .select2-selection { border-color: #dc3545; }

/* Alineación del botón de validación bancaria */
.deposit-number-group .form-control {
    border-radius: 8px 0 0 8px;
    min-width: 0;
}

.deposit-number-group .btn {
    border-radius: 0 8px 8px 0;
    white-space: nowrap;
    min-height: 43px;
}

/* Seguimiento de trámites: estilos compatibles con Bootstrap 5. */
.tracking-page { max-width: 1180px; margin: 0 auto; }
.tracking-page .tracking-title { color: var(--ceub-blue); font-weight: 750; margin-bottom: 1.5rem; }
.tracking-page .tracking-search { background: #fff; border: 1px solid #e2e8ef; border-radius: 13px; padding: 18px; }
.tracking-page .tracking-result-card { border: 1px solid #dce6f1; border-radius: 14px; box-shadow: 0 5px 22px rgba(22,48,80,.055); background: #fff; }
.tracking-page .tracking-person { border: 1px solid #e3eaf2; border-radius: 11px; padding: 16px; background: #f7f9fc; }
.tracking-page .tracking-person h2 { color: var(--ceub-blue); font-size: 1.25rem; font-weight: 750; }
.tracking-page .tracking-table th { white-space: nowrap; vertical-align: middle; }
.tracking-page .tracking-table td { vertical-align: middle; }
.tracking-page .tracking-pdf-link { display: inline-flex; min-width: 72px; min-height: 64px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; color: var(--ceub-blue); text-decoration: none; }
.tracking-page .tracking-pdf-link i { font-size: 2rem; }
.tracking-page .tracking-pdf-link:hover { color: var(--ceub-red); }
.tracking-page .timeline { list-style: none; padding: 8px 0 8px 28px; margin: 16px 0 0; border-left: 3px solid #e3eaf2; }
.tracking-page .timeline > li { position: relative; margin: 0 0 14px; }
.tracking-page .timeline-badge { position: absolute; left: -43px; top: 9px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.tracking-page .timeline-badge.danger { background: #dc3545; }
.tracking-page .timeline-badge.info { background: #0d6efd; }
.tracking-page .timeline-badge.warning { background: #d99a18; }
.tracking-page .timeline-badge.success { background: #198754; }
.tracking-page .timeline-panel { border: 1px solid #e2e8ef; border-radius: 10px; padding: 13px 15px; background: #fff; }
.tracking-page .timeline-title { font-size: 1rem; color: var(--ceub-blue); font-weight: 700; margin: 0 0 4px; }
.tracking-page .timeline-body { margin-top: 8px; }
#modal-pdfres .modal-body { padding: 0; background: #26313d; }
#iframeSeguimientoPdf { display: block; width: 100%; height: min(76vh, 850px); border: 0; background: #fff; }
@media (max-width: 575.98px) {
    .tracking-page .tracking-search { padding: 14px; }
    .tracking-page .tracking-table { min-width: 680px; }
    #iframeSeguimientoPdf { height: 72vh; }
}
