
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:          #1B2A4A;
    --navy-light:    #27406E;
    --lima:          #b7ca9f;
    --lima-claro:    #bdcca9;
    --rojo:          #C8202D;
    --crema:         #F2F5EC;
    --crema-claro:   #F7FAF1;
    --texto:         #333;
    --texto-suave:   #666;
    --borde:         #e2e8d8;
    --error:         #c0392b;
    --exito:         #2e7d32;
    --sombra-suave:  0 2px 8px rgba(0, 0, 0, 0.06);
    --sombra-card:   0 4px 24px rgba(27, 42, 74, 0.10);
    --display:       'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sans:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    font-family: var(--sans);
    color: var(--texto);
    background: var(--crema);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--rojo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
    background: linear-gradient(135deg, #0f1830 0%, #1B2A4A 50%, #27406E 100%);
    color: #fff;
    padding: 64px 24px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 50%; height: 100%;
    background: radial-gradient(ellipse at top right, rgba(139, 197, 63, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

.hero__container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
    position: relative;
    z-index: 1;
}

.hero__logo {
    flex: 0 0 auto;
}

.hero__logo img {
    width: 200px;
    height: auto;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.hero__institution {
    font-size: 11px;
    letter-spacing: 2.5px;
    color: var(--lima);
    font-weight: 700;
    margin-bottom: 6px;
}

.hero__title {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 16px;
}

.hero__title--accent {
    color: var(--lima);
}

.hero__subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.78);
    max-width: 540px;
    line-height: 1.6;
}

/* =========================================================
   BANDA DEL CURSO SELECCIONADO (lima)
   ========================================================= */
.curso-band {
    background: var(--lima);
    padding: 20px 24px;
    box-shadow: 0 -2px 12px rgba(139, 197, 63, 0.3);
}

.curso-band__container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.curso-band__main {
    flex: 1 1 320px;
}

.curso-band__tipo {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--navy);
    background: rgba(27, 42, 74, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.curso-band__nombre {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 4px;
}

.curso-band__detalle {
    font-size: 13px;
    color: var(--navy);
    opacity: 0.85;
}

.curso-band__precios {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.precio-box {
    text-align: center;
    background: rgba(255,255,255,0.55);
    border-radius: 8px;
    padding: 8px 18px;
    min-width: 120px;
}

.precio-box__label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--navy);
    opacity: 0.75;
    margin-bottom: 2px;
}

.precio-box__amount {
    display: block;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
}

/* =========================================================
   MAIN
   ========================================================= */
.main {
    padding: 64px 24px;
}

.main__container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

/* COLUMNA INFORMACIÓN */
.info-col__title {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.info-item__icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    color: var(--lima);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-item__body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.info-item__body p {
    font-size: 14px;
    color: var(--texto-suave);
    line-height: 1.55;
}

.info-warn {
    background: #f0f7e6;
    border-left: 4px solid var(--lima);
    padding: 16px 20px;
    border-radius: 4px;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.info-warn i {
    color: #6ea832;
    font-size: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
}

.info-warn p {
    font-size: 13px;
    color: var(--texto);
    line-height: 1.55;
}

/* =========================================================
   FORMULARIO
   ========================================================= */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--sombra-card);
    position: relative;
}

.form-card__title {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.form-card__subtitle {
    font-size: 13px;
    color: var(--texto-suave);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.req { color: var(--rojo); margin-left: 2px; }

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--borde);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--texto);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--lima);
    box-shadow: 0 0 0 3px rgba(139, 197, 63, 0.18);
}

.form-group input::placeholder {
    color: #b3bdb0;
}

.form-group.is-invalid input,
.form-group.is-invalid select {
    border-color: var(--error);
    background: #fef5f5;
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    min-height: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-divider {
    border-top: 1px solid var(--borde);
    margin: 24px 0 18px;
    padding-top: 18px;
    text-align: center;
}

.form-divider span {
    display: block;
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
}

.form-divider small {
    display: block;
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 4px;
}

/* TOGGLES (socio / factura) */
.form-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d8c9;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--lima);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(139, 197, 63, 0.3);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    user-select: none;
}

.factura-fields {
    border-left: 3px solid var(--lima);
    padding-left: 16px;
    margin-bottom: 4px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-total {
    background: var(--crema-claro);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 20px 0 16px;
}

.form-total__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

.form-total__amount {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
}

.form-total__amount small {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--texto-suave);
    margin-left: 4px;
}

.btn-pagar {
    width: 100%;
    background: var(--lima);
    color: var(--navy);
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(139, 197, 63, 0.35);
}

.btn-pagar:hover:not(:disabled) {
    background: var(--lima-claro);
    box-shadow: 0 6px 18px rgba(139, 197, 63, 0.45);
}

.btn-pagar:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-pagar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-pagar i { font-size: 18px; }

.form-card__secure {
    text-align: center;
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 14px;
}

.form-card__secure i {
    color: var(--exito);
    margin-right: 4px;
}

/* LOADER */
.loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.92);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

/* El atributo HTML `hidden` debe ganar sobre `display: flex` */
.loader[hidden] {
    display: none !important;
}

.loader__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--borde);
    border-top-color: var(--lima);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader p {
    color: var(--navy);
    font-weight: 600;
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    padding: 24px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* =========================================================
   PÁGINAS DE RESULTADO (éxito / cancelado)
   ========================================================= */
.result-page {
    max-width: 640px;
    margin: 64px auto;
    padding: 0 24px;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: var(--sombra-card);
    text-align: center;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
}

.result-icon--exito { background: var(--exito); }
.result-icon--error { background: var(--error); }
.result-icon--info  { background: var(--navy); }

.result-card h1 {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 12px;
}

.result-card p {
    color: var(--texto-suave);
    margin-bottom: 14px;
    line-height: 1.6;
}

.result-folio {
    background: var(--lima);
    color: var(--navy);
    padding: 20px;
    border-radius: 8px;
    margin: 24px 0;
}

.result-folio span {
    display: block;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 6px;
}

.result-folio strong {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
}

.btn-secundario {
    display: inline-block;
    padding: 12px 28px;
    background: var(--navy);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 16px;
    transition: background 0.2s;
}

.btn-secundario:hover {
    background: var(--navy-light);
    text-decoration: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .main__container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero__container {
        flex-direction: column;
        text-align: center;
    }

    .hero__title { font-size: 28px; }
    .curso-band__container { justify-content: center; text-align: center; }
    .curso-band__precios { justify-content: center; }
    .form-card { padding: 24px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero { padding: 40px 20px 56px; }
    .hero__title { font-size: 24px; }
    .hero__subtitle { font-size: 13px; }
    .hero__logo img { width: 150px; }
    .main { padding: 40px 16px; }
    .form-card { padding: 20px; }
    .precio-box { min-width: 100px; padding: 8px 12px; }
    .precio-box__amount { font-size: 18px; }
}
