/* ==========================================================================
   CHECKOUT PAGE (Solemn Clean UI - Mobile First)
   ========================================================================== */

body {
    font-family: "Montserrat", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
}

.checkout-section {
    padding: 1.5rem 1rem 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    width: 100%;
}

.checkout-section .brand-lockup {
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
}

@media (min-width: 768px) {
    .checkout-section {
        padding: 2rem 5% 5rem 5%;
    }
}

/* --- Navegación Minimalista Superior --- */
.checkout-header-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

@media (min-width: 640px) {
    .checkout-header-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.return-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
}

.return-link:hover {
    color: var(--brand-primary);
}

.return-link svg {
    width: 18px;
    height: 18px;
}

/* --- Layout Grid --- */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 0.8fr 1.2fr;
        gap: 5rem;
    }
    .checkout-summary {
        position: sticky;
        top: 2rem;
    }
}

/* --- Columna Izquierda: Tarjeta Resumen --- */
.checkout-summary-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

@media (min-width: 768px) {
    .checkout-summary-card {
        padding: 2.5rem 2rem;
        border-radius: 16px;
    }
}

.summary-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.brand-logotype {
    font-size: 1.5rem;
}

/* Badges del Resumen */
.badge-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.primary-badge {
    background: rgba(62, 57, 186, 0.1);
    color: var(--brand-primary);
}

.badge-promo-inline {
    background: var(--brand-secondary);
    color: var(--text-main);
    margin-top: 4px;
}

.summary-plan-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.5rem 0;
}

.pricing-price-box.summary-price-box {
    display: flex;
    flex-direction: row;
    align-items: baseline; 
    justify-content: flex-start;
    gap: 6px;
    margin: 8px 0;
    width: 100%;
}

.summary-price-box .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.summary-price-box .price {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1;
}

.summary-price-box .period {
    font-size: 0.95rem;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

.summary-usd {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    width: 100%;
    text-align: left;
}

.summary-trial {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--brand-primary);
    font-weight: 600;
    background: rgba(62, 57, 186, 0.08);
    padding: 8px 14px;
    border-radius: 6px;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.price-strike {
    text-decoration: line-through;
    color: #9ca3af;
}

.promo-saving {
    color: #10b981;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 8px;
    display: block;
    width: 100%;
    text-align: left;
}

.summary-features {
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
}

.summary-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(62, 57, 186, 0.1);
    color: var(--brand-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.feature-disabled {
    color: #9ca3af !important;
    text-decoration: line-through;
}

.feature-disabled .check-icon {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
}

.trust-indicator {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted, #6b7280);
}

.trust-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(5, 150, 105, 0.1);
    color: #059669;
    border-radius: 8px;
    flex-shrink: 0;
}

.trust-text strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.trust-text span {
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
}

/* --- Columna Derecha: Formulario --- */
.checkout-titles {
    margin-bottom: 2rem;
}

.checkout-titles .section-heading {
    text-align: left;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.checkout-titles .brand-highlight {
    color: var(--brand-primary);
}

.section-subtitle {
    color: var(--text-muted, #6b7280);
    font-size: 1rem;
    margin-top: 0;
}

.checkout-surface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

@media (min-width: 640px) {
    .checkout-surface {
        padding: 3rem;
        border-radius: 16px;
    }
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2rem 0;
}

.form-block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.block-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: rgba(255, 198, 26, 0.2);
    color: #d97706;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.form-block-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .input-row {
        grid-template-columns: 1fr 1fr;
    }
}

.ui-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.ui-input {
    width: 100%;
    padding: 0.9rem 1rem;
    background-color: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ui-input::placeholder {
    color: var(--text-muted, #9ca3af);
}

.ui-input:focus {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(62, 57, 186, 0.1);
}

.mb-3 {
    margin-bottom: 1rem;
}

/* --- Metodos de Pago & Campos Seguros --- */
.payment-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.payment-option-label {
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.payment-option-label:hover {
    border-color: var(--brand-primary);
}

.payment-option-label.active {
    border-color: var(--brand-primary);
    background-color: rgba(62, 57, 186, 0.03);
    font-weight: 600;
}

.payment-option-label input[type="radio"] {
    accent-color: var(--brand-primary);
    margin: 0;
}

.payment-methods-grid {
    margin-top: 16px;
}

/* Campos seguros integrados perfectamente con la estética global */
.mp-secure-field {
    width: 100%;
    height: 52px; /* Altura controlada para iframes de MP */
    padding: 0 1rem; /* Padding horizontal equivalente a .ui-input */
    background-color: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 8px; /* Igual a .ui-input */
    box-sizing: border-box;
    transition: all 0.2s ease;
    display: flex;
    align-items: center; /* Centra el contenido del iframe internamente */
}

.mp-secure-field:focus-within {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(62, 57, 186, 0.1);
}

/* --- Detalles de Transferencia Bancaria --- */
.bank-details-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.bank-details-box h5 {
    font-size: 1rem;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.transfer-amount {
    font-size: 0.95rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.transfer-amount strong {
    color: var(--brand-primary);
}

.bank-details-box ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}

.bank-details-box li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* --- Checkbox Términos --- */
.terms-checkbox-container {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}

.terms-checkbox-container input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

.terms-checkbox-container label {
    cursor: pointer;
    line-height: 1.4;
}

.terms-checkbox-container a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}

.terms-checkbox-container a:hover {
    text-decoration: underline;
}

/* --- Botón Submit --- */
.form-action {
    margin-top: 2.5rem;
}

.btn-submit {
    background: var(--brand-primary);
    color: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-submit:hover {
    background: rgba(62, 57, 186, 0.9);
}

.btn-submit:active {
    transform: scale(0.99);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   ALERTAS INSTITUCIONALES
   ========================================================================== */

.alert-error-container {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    color: #b91c1c;
}

.alert-error-container ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
}

.alert-billing-note {
    display: flex;
    gap: 12px;
    background-color: var(--bg-surface);
    border-left: 4px solid var(--brand-primary);
    padding: 14px 18px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 24px;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.alert-billing-note svg {
    color: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-billing-note p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert-info-trial {
    background: rgba(62, 57, 186, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.alert-info-trial-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.alert-info-trial-header h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
}

.alert-info-trial-text {
    margin: 0;
    color: var(--text-muted, #475569);
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 43px;
}

.alert-success-box {
    background: rgba(62, 57, 186, 0.05);
    color: var(--brand-primary);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.alert-success-box svg {
    margin-bottom: 12px;
}

.alert-success-box h4 {
    margin: 0 0 8px 0;
    font-weight: 700;
}

.alert-success-box p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

.alert-warning {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(255, 198, 26, 0.1);
    border-left: 4px solid var(--brand-secondary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert-warning svg {
    flex-shrink: 0;
    color: var(--brand-secondary);
}