/* ============================================================
   local_checkout — Professional Checkout UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.lco-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1080px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: #111827;
}

/* ─── Header ──────────────────────────────────────────────── */
.lco-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lco-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: .25rem;
}

.lco-header p {
    color: #6b7280;
    font-size: .95rem;
}

/* ─── Grid ────────────────────────────────────────────────── */
.lco-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .lco-grid {
        grid-template-columns: 1fr;
    }

    .lco-sidebar {
        order: -1;
    }
}

/* ─── Cards ───────────────────────────────────────────────── */
.lco-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .07);
    border: 1px solid #f3f4f6;
}

.lco-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #f3f4f6;
}

/* ─── Toggle "Ya tengo cuenta" ────────────────────────────── */
.lco-toggle-link {
    display: block;
    margin-bottom: 1.5rem;
    font-size: .875rem;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}

/* ─── Form fields ─────────────────────────────────────────── */
.lco-field {
    margin-bottom: 1.125rem;
}

.lco-field label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .375rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.lco-field input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .9375rem;
    font-family: inherit;
    color: #111827;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.lco-field input:focus,
.lco-field .lco-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    background: #fff;
}

.lco-field input.lco-error,
.lco-field .lco-select.lco-error {
    border-color: #ef4444;
}

.lco-select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .9375rem;
    font-family: inherit;
    color: #111827;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

.lco-section-label {
    font-size: .8125rem;
    color: #6b7280;
    margin-bottom: 1rem;
    margin-top: 0;
}

.lco-card-label {
    margin-bottom: .75rem;
    font-size: .8125rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.lco-field-error {
    color: #ef4444;
    font-size: .8rem;
    margin-top: .3rem;
    display: none;
}

.lco-field-error.visible {
    display: block;
}

.lco-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .lco-row {
        grid-template-columns: 1fr;
    }
}

.lco-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* ─── Sidebar: order summary ──────────────────────────────── */
.lco-course-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: .5rem;
}

.lco-amount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: .9375rem;
}

.lco-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .875rem 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.lco-price {
    color: #111827;
    font-weight: 700;
}

/* ─── Stripe Card Element ─────────────────────────────────── */
.lco-stripe-wrap {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: .875rem 1rem;
    background: #fafafa;
    margin-bottom: 1.25rem;
    transition: border-color .15s;
}

.lco-stripe-wrap.focused {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    background: #fff;
}

/* ─── Pay button ──────────────────────────────────────────── */
.lco-pay-btn {
    width: 100%;
    padding: .9375rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: opacity .2s, transform .1s;
    letter-spacing: .01em;
    margin-top: .5rem;
}

.lco-pay-btn:hover {
    opacity: .92;
}

.lco-pay-btn:active {
    transform: scale(.99);
}

.lco-pay-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.lco-pay-btn .lco-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lco-spin .7s linear infinite;
    display: none;
}

.lco-pay-btn.loading .lco-spinner {
    display: block;
}

.lco-pay-btn.loading .lco-btn-text {
    opacity: .7;
}

@keyframes lco-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Error / alert bar ───────────────────────────────────── */
.lco-alert {
    padding: .875rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    margin-bottom: 1rem;
    display: none;
}

.lco-alert.visible {
    display: block;
}

.lco-alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.lco-alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ─── Security badge ──────────────────────────────────────── */
.lco-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1rem;
    font-size: .8rem;
    color: #6b7280;
}

.lco-secure svg {
    width: 14px;
    height: 14px;
    fill: #10b981;
}

/* ─── Thanks page ─────────────────────────────────────────── */
.lco-thanks {
    max-width: 520px;
    margin: 3rem auto;
    text-align: center;
}

.lco-thanks-icon {
    width: 72px;
    height: 72px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.lco-thanks-icon svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: #059669;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lco-thanks h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: .5rem;
}

.lco-thanks .lco-enrolled-in {
    color: #6b7280;
    font-size: .95rem;
    margin-bottom: .25rem;
}

.lco-thanks .lco-course-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}

.lco-thanks .lco-email-info {
    background: #eff6ff;
    border-radius: 8px;
    padding: .875rem 1.25rem;
    color: #1e40af;
    font-size: .875rem;
    margin-bottom: 2rem;
}

.lco-go-course {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 2rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity .2s;
}

.lco-go-course:hover {
    opacity: .9;
    color: #fff;
}

/* ─── Legal consent checkboxes ────────────────────────────── */
.lco-consents {
    background: #f8faff;
    border: 1.5px solid #dbeafe;
    border-radius: 10px;
    padding: 1rem 1.125rem;
    margin-bottom: .5rem;
}

.lco-consents-title {
    font-size: .8125rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 .75rem;
}

.lco-consent-item {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin-bottom: .625rem;
    cursor: pointer;
    font-size: .875rem;
    color: #374151;
    line-height: 1.45;
}

.lco-consent-item:last-of-type {
    margin-bottom: 0;
}

.lco-consent-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: .15rem;
    accent-color: #2563eb;
    cursor: pointer;
}

.lco-consent-item a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
}

.lco-consent-item a:hover {
    color: #1d4ed8;
}

.lco-consents #err-consents {
    margin-top: .625rem;
    font-weight: 600;
}