/* Estilos de public/pago_online.php */
:root {
    --brand: #0d6efd;
    --brand-dark: #20a66b;
    --blue: #006dc9;
    --ink: #20243f;
    --muted: #7b8194;
    --line: #dfe3ea;
    --page: #f4f6f8;
    --card: #ffffff;
    --shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-bottom: 110px;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e7eaf0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.brand-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 86px;
    gap: 14px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    font-size: 32px;
}

.brand-name {
    margin: 0;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1;
    color: #0F2C95;
    font-weight: 750;
    letter-spacing: -.05em;
}

.page-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 10px 0;
}

.title-main {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 750;
    letter-spacing: -.04em;
    margin-bottom: 10px;
    color: var(--ink);
}

.subtitle {
    color: #6d7280;
    font-size: clamp(18px, 3.4vw, 25px);
    margin-bottom: 32px;
}

.school-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e1e5ec;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    padding: 16px;
    margin-bottom: 22px;
}

.school-card-logo {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #edf0f5;
    padding: 5px;
    flex: 0 0 auto;
}

.school-card-icon {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex: 0 0 auto;
}

.school-card-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.school-card-name {
    margin: 0;
    color: var(--ink);
    font-size: clamp(16px, 3.9vw, 24px);
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    font-size: clamp(17px, 3vw, 24px);
    font-weight: 650;
}

.nav-row a {
    color: var(--ink);
    text-decoration: none;
}

.help-link {
    color: var(--blue) !important;
    font-weight: 800;
}

.checkout-card {
    background: var(--card);
    border: 1px solid #e1e5ec;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.checkout-body {
    padding: 28px 28px 22px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 32px 28px 24px;
}

.step-line {
    height: 3px;
    flex: 1;
    background: #737373;
    border-radius: 999px;
}

.step-line.done { background: var(--blue); }

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #9da3af;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-weight: 800;
    font-size: 20px;
}

.step-circle.active,
.step-circle.done {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.section-title {
    font-size: clamp(22px, 3.8vw, 30px);
    font-weight: 800;
    margin: 0 0 26px;
    color: #4b506d;
    letter-spacing: -.025em;
}

.section-title .info-dot {
    font-size: 16px;
    color: #333;
    margin-left: 6px;
}

.form-label {
    color: #4b506d;
    font-weight: 750;
    font-size: 15px;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border: 1px solid #dfe4ec;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 17px;
    color: var(--ink);
    min-height: 54px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .22rem rgba(79, 193, 140, .16);
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    padding: 18px 18px;
    margin-bottom: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.payment-card:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}

.payment-card input {
    width: 28px;
    height: 28px;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

.quota-card {
    display: block;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    background: #fff;
    transition: all .2s ease;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.quota-card:hover {
    border-color: rgba(13,110,253,.45);
    transform: translateY(-1px);
}

.quota-card.active {
    border-color: #0d6efd;
    background: rgba(13,110,253,.06);
    box-shadow: 0 0 0 1px rgba(13,110,253,.20);
}

.quota-check-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.paycard-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pay-check {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,.12);
    color: rgba(0,0,0,.25);
    background: rgba(0,0,0,.04);
    flex: 0 0 auto;
    margin-left: auto;
}

.quota-card.active .pay-check {
    border-color: rgba(13,110,253,.55);
    color: #fff;
    background: #0d6efd;
}

.quota-amount-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 112px;
}

.quota-amount {
    font-size: clamp(18px, 3.5vw, 24px);
    font-weight: 850;
    color: var(--ink);
    line-height: 1;
    white-space: nowrap;
}

.payment-logo {
    width: 110px;
    max-height: 44px;
    object-fit: contain;
}

.payment-title,
.quota-title {
    font-size: clamp(20px, 3.7vw, 28px);
    font-weight: 850;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 4px;
}

.payment-subtitle,
.quota-subtitle {
    color: #737989;
    font-size: clamp(15px, 3.2vw, 20px);
    line-height: 1.25;
}

.favorite-pill {
    margin-left: auto;
    min-width: 58px;
    height: 40px;
    border-radius: 999px;
    background: #fff3a6;
    color: #f0c400;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 14px 18px;
    font-size: clamp(17px, 3.4vw, 26px);
    margin-bottom: 22px;
}

.info-label { color: var(--ink); }
.info-value { color: var(--ink); text-align: right; font-weight: 500; }

.divider {
    height: 1px;
    background: #eceef3;
    margin: 24px -28px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 13px;
    font-size: clamp(17px, 3.4vw, 25px);
}

.summary-row .label { color: var(--ink); }
.summary-row .label-muted { color: #8b90a0; }
.summary-row .amount { color: var(--ink); font-weight: 500; text-align: right; }
.summary-row.total { margin-top: 24px; font-weight: 850; }
.summary-row.total .amount { font-weight: 850; }

.secure-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #edf3ff;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 24px 0;
    color: #525c70;
}

.secure-icon {
    color: var(--brand-dark);
    font-size: 30px;
    line-height: 1;
    flex: 0 0 auto;
}

.secure-title {
    color: var(--brand-dark);
    font-size: clamp(20px, 3.8vw, 28px);
    font-weight: 850;
    margin-bottom: 6px;
}

.secure-text {
    font-size: clamp(15px, 3vw, 20px);
    line-height: 1.35;
    margin: 0;
}

.developer-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(82, 92, 112, .16);
    color: #6d7280;
    font-size: clamp(12px, 2.5vw, 15px);
    line-height: 1.35;
}

.checkout-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #fff;
    border-top: 1px solid #dfe3ea;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}

.footer-inner {
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 16px;
}

.footer-label {
    color: var(--ink);
    font-size: clamp(14px, 3.3vw, 22px);
    line-height: 1.1;
    margin-bottom: 3px;
}

.footer-amount {
    color: var(--ink);
    font-size: clamp(23px, 5vw, 33px);
    font-weight: 850;
    line-height: 1;
}

.btn-main {
    background: var(--brand);
    border: none;
    color: #fff;
    min-height: 64px;
    border-radius: 8px;
    font-size: clamp(17px, 3.5vw, 25px);
    font-weight: 750;
    width: 100%;
}

.btn-main:hover,
.btn-main:focus {
    background: var(--brand-dark);
    color: #fff;
}

.alert {
    border-radius: 14px;
    font-size: 16px;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 26px;
    color: #64748b;
    text-align: center;
}

.terms-row {
    font-size: clamp(16px, 3.2vw, 22px);
    color: #42485f;
    line-height: 1.35;
}

.terms-row a {
    color: var(--blue);
    font-weight: 850;
    text-decoration: none;
}

/* Ajustes compactos + estados de carga */
.page-container { max-width: 700px; padding-top: 22px; }
.school-card { padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; }
.school-card-logo, .school-card-icon { width: 48px; height: 48px; border-radius: 12px; }
.checkout-body { padding: 20px 22px 18px; }
.stepper { padding: 20px 22px 16px; gap: 9px; }
.step-circle { width: 34px; height: 34px; font-size: 15px; }
.step-line { height: 2px; }
.section-title { font-size: clamp(18px, 3.2vw, 22px); margin-bottom: 16px; }
.form-label { font-size: 13px; margin-bottom: 5px; }
.form-control, .form-select { min-height: 43px; padding: 9px 12px; font-size: 14px; border-radius: 10px; }
.form-text { font-size: 12px; margin-top: 4px; }
.payment-card, .quota-card { padding: 11px 12px; margin-bottom: 9px; border-radius: 12px; box-shadow: 0 3px 10px rgba(15, 23, 42, .045); }
.payment-card { gap: 12px; }
.payment-card input { width: 21px; height: 21px; }
.payment-logo { width: 78px; max-height: 32px; }
.payment-title, .quota-title { font-size: clamp(16px, 3vw, 19px); margin-bottom: 2px; }
.payment-subtitle, .quota-subtitle { font-size: clamp(12px, 2.7vw, 14px); }
.favorite-pill { min-width: 38px; height: 28px; font-size: 16px; }
.pay-check { width: 23px; height: 23px; font-size: 13px; }
.quota-amount-wrap { gap: 3px; min-width: 96px; }
.quota-amount { font-size: clamp(16px, 3vw, 20px); }
.info-grid { font-size: clamp(14px, 2.9vw, 16px); gap: 7px 12px; margin-bottom: 14px; }
.divider { margin: 16px -22px; }
.summary-row { font-size: clamp(14px, 2.9vw, 16px); margin-bottom: 8px; }
.secure-box { padding: 12px 14px; margin: 16px 0 10px; gap: 10px; }
.secure-icon { font-size: 22px; }
.secure-title { font-size: 16px; margin-bottom: 2px; }
.secure-text { font-size: 12px; }
.developer-note { font-size: 11px; margin-top: 7px; padding-top: 7px; }
.footer-inner { max-width: 700px; gap: 12px; }
.checkout-footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.footer-label { font-size: 12px; }
.footer-amount { font-size: clamp(20px, 4.3vw, 26px); }
.btn-main { min-height: 46px; font-size: clamp(15px, 3vw, 17px); border-radius: 9px; position: relative; }
.btn-main.is-processing { color: transparent !important; pointer-events: none; }
.btn-main.is-processing:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.55);
    border-top-color: #fff;
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.history-box {
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    padding: 12px;
    background: #fbfcff;
    margin-bottom: 4px;
}
.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.history-title {
    font-weight: 850;
    color: var(--ink);
    font-size: 15px;
    display: flex;
    gap: 7px;
    align-items: center;
}
.history-subtitle { color: var(--muted); font-size: 12px; }
.history-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13,110,253,.10);
    color: #0d6efd;
    font-weight: 800;
    font-size: 13px;
}
.history-table { font-size: 13px; }
.history-table th { color: #687084; font-weight: 800; border-bottom-color: #e5e9f1; }
.history-table td { border-color: #edf0f5; }
.history-link { color: var(--blue); font-weight: 800; text-decoration: none; white-space: nowrap; }
.history-empty { color: #7b8194; font-size: 13px; padding: 8px 0 2px; }
.history-action-box {
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fbfcff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.history-action-title {
    font-weight: 850;
    color: var(--ink);
    font-size: 15px;
    display: flex;
    gap: 7px;
    align-items: center;
}
.history-action-subtitle {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}
.btn-history {
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    white-space: nowrap;
}
.quota-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.quota-chip {
    border-radius: 999px;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
}
.quota-chip.interest {
    background: #fff7ed;
    color: #c2410c;
}
.footer-detail {
    color: #687084;
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.15;
}
.modal-history-body {
    min-height: 120px;
}
.modal-history-loading {
    padding: 18px 2px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(244, 246, 248, .86);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.loading-overlay.show { display: flex; }
.loading-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid #e2e7f0;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15,23,42,.14);
    padding: 18px;
}
.loading-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    margin-bottom: 14px;
    color: var(--ink);
}
.loading-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(13,110,253,.20);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
.skeleton-line {
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #edf1f7 25%, #f7f9fc 37%, #edf1f7 63%);
    background-size: 400% 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}
.skeleton-line.lg { height: 44px; border-radius: 12px; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-65 { width: 65%; }
.skeleton-line.w-45 { width: 45%; }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }


/* Mejora exclusiva para escritorio: mantiene el look tipo app en celular,
   pero reduce proporciones para que en web se vea más fino y menos tosco. */
@media (min-width: 992px) {
    body { padding-bottom: 94px; }
    .brand-wrap { min-height: 70px; }
    .brand-logo, .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
    .brand-mark { font-size: 25px; }
    .brand-name { font-size: 36px; }
    .page-container { max-width: 680px; padding-top: 26px; }
    .title-main { font-size: 32px; margin-bottom: 6px; }
    .subtitle { font-size: 18px; margin-bottom: 22px; }
    .nav-row { font-size: 16px; margin-bottom: 18px; }
    .checkout-card { border-radius: 14px; box-shadow: 0 10px 24px rgba(15, 23, 42, .07); }
    .checkout-body { padding: 24px 26px 20px; }
    .stepper { padding: 24px 26px 18px; gap: 10px; }
    .step-circle { width: 38px; height: 38px; font-size: 16px; }
    .step-line { height: 2px; }
    .section-title { font-size: 22px; margin-bottom: 20px; }
    .form-label { font-size: 14px; margin-bottom: 6px; }
    .form-control, .form-select { min-height: 48px; padding: 11px 14px; font-size: 15px; border-radius: 12px; }
    .payment-card, .quota-card { padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; box-shadow: 0 5px 14px rgba(15, 23, 42, .06); }
    .payment-card input, .quota-card input { width: 22px; height: 22px; }
    .payment-logo { width: 92px; max-height: 36px; }
    .payment-title, .quota-title { font-size: 18px; }
    .payment-subtitle, .quota-subtitle { font-size: 14px; }
    .favorite-pill { min-width: 46px; height: 32px; font-size: 19px; }
    .info-grid { font-size: 16px; gap: 10px 16px; margin-bottom: 18px; }
    .divider { margin: 20px -26px; }
    .summary-row { font-size: 16px; margin-bottom: 10px; }
    .summary-row.total { margin-top: 18px; }
    .secure-box { padding: 14px 16px; margin: 20px 0 12px; gap: 12px; border-radius: 12px; }
    .secure-icon { font-size: 24px; }
    .secure-title { font-size: 18px; margin-bottom: 3px; }
    .secure-text { font-size: 13px; }
    .developer-note { margin-top: 8px; padding-top: 8px; font-size: 12px; }
    .checkout-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
    .footer-inner { max-width: 680px; gap: 14px; }
    .footer-label { font-size: 13px; }
    .footer-amount { font-size: 25px; }
    .btn-main { min-height: 50px; font-size: 18px; border-radius: 10px; }
}

@media (max-width: 576px) {
    .page-container { padding-top: 28px; }
    .checkout-body { padding: 24px 28px 18px; }
    .stepper { padding: 28px 28px 22px; }
    .brand-wrap { min-height: 78px; }
    .payment-logo { width: 106px; }
    .footer-inner { grid-template-columns: .95fr 1.05fr; }
}

/* Override final para mantener dise&ntilde;o compacto tambi&eacute;n en escritorio */
@media (min-width: 992px) {
    body { padding-bottom: 82px; }
    .page-container { max-width: 700px; padding-top: 22px; }
    .checkout-card { border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
    .checkout-body { padding: 20px 22px 18px; }
    .stepper { padding: 20px 22px 16px; gap: 9px; }
    .step-circle { width: 34px; height: 34px; font-size: 15px; }
    .section-title { font-size: 20px; margin-bottom: 16px; }
    .form-label { font-size: 13px; margin-bottom: 5px; }
    .form-control, .form-select { min-height: 43px; padding: 9px 12px; font-size: 14px; border-radius: 10px; }
    .payment-card, .quota-card { padding: 11px 12px; margin-bottom: 9px; border-radius: 12px; box-shadow: 0 3px 10px rgba(15, 23, 42, .045); }
    .payment-logo { width: 78px; max-height: 32px; }
    .payment-title, .quota-title { font-size: 17px; }
    .payment-subtitle, .quota-subtitle { font-size: 13px; }
    .info-grid { font-size: 14px; gap: 7px 12px; margin-bottom: 14px; }
    .divider { margin: 16px -22px; }
    .summary-row { font-size: 14px; margin-bottom: 8px; }
    .secure-box { padding: 12px 14px; margin: 16px 0 10px; }
    .footer-inner { max-width: 700px; }
    .footer-label { font-size: 12px; }
    .footer-amount { font-size: 24px; }
    .btn-main { min-height: 46px; font-size: 16px; border-radius: 9px; }
}


.paid-empty-box{
    display:flex;
    gap:12px;
    align-items:flex-start;
    padding:12px 14px;
    border:1px solid rgba(25,135,84,.20);
    border-radius:16px;
    background:rgba(25,135,84,.06);
    color:#0f5132;
}
.paid-empty-icon{
    width:34px;
    height:34px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff;
    color:#198754;
    font-size:1.1rem;
    flex:0 0 auto;
}
.paid-empty-title{
    font-size:.92rem;
    font-weight:800;
    margin-bottom:2px;
}
.paid-empty-text{
    font-size:.78rem;
    line-height:1.35;
}
