/* =============================================================
 * Kendall Law Course Platform — frontend styles
 * Scoped to .kle-* classes so it won't fight the host theme.
 * ============================================================= */

.kle-course-page,
.kle-course-page * {
    box-sizing: border-box;
}

.kle-course-page {
    --kle-bg:         #ffffff;
    --kle-surface:    #f8fafc;
    --kle-ink:        #0f172a;
    --kle-ink-soft:   #475569;
    --kle-muted:      #94a3b8;
    --kle-line:       #e2e8f0;
    --kle-accent:     #1d4ed8;
    --kle-accent-hi:  #1e40af;
    --kle-accent-soft:#eff6ff;
    --kle-success:    #059669;
    --kle-success-bg: #ecfdf5;
    --kle-warn-bg:    #fef3c7;
    --kle-warn-ink:   #78350f;
    --kle-warn-line:  #fcd34d;
    --kle-fail:       #b91c1c;
    --kle-fail-bg:    #fee2e2;
    --kle-radius:     12px;
    --kle-radius-sm:  8px;

    background: var(--kle-bg);
    color: var(--kle-ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

.kle-course-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* ---------- Landing block layout ---------- */
.kle-course-landing {
    display: block;
}

.kle-course-grid {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

@media (max-width: 860px) {
    .kle-course-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .kle-course-media {
        max-width: 320px;
        margin: 0 auto;
    }
}

/* ---------- 9:16 video ---------- */
.kle-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #0f172a;
    border-radius: var(--kle-radius);
    overflow: hidden;
    box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.18),
                0 4px 8px rgba(15, 23, 42, 0.05);
}

.kle-video-wrap video,
.kle-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.kle-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---------- Right column — content ---------- */
.kle-course-info {
    padding-top: 4px;
}

.kle-course-title {
    margin: 0 0 12px;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.15;
    color: var(--kle-ink);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.kle-course-excerpt {
    margin: 0 0 24px;
    font-size: 17px;
    color: var(--kle-ink-soft);
    line-height: 1.55;
}

/* ---------- Price ---------- */
.kle-price-block {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 20px;
    padding: 18px 22px;
    background: var(--kle-accent-soft);
    border: 1px solid #dbeafe;
    border-radius: var(--kle-radius-sm);
}

.kle-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.kle-price-amount {
    font-size: 38px;
    font-weight: 800;
    color: var(--kle-ink);
    letter-spacing: -0.02em;
}

.kle-price-amount::before {
    content: "$";
    font-size: 22px;
    font-weight: 700;
    color: var(--kle-ink-soft);
    margin-right: 2px;
    vertical-align: top;
    position: relative;
    top: 6px;
}

.kle-price-currency {
    font-size: 14px;
    color: var(--kle-ink-soft);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.kle-price-note {
    margin-left: auto;
    font-size: 13px;
    color: var(--kle-ink-soft);
}

@media (max-width: 480px) {
    .kle-price-note { margin-left: 0; width: 100%; }
}

/* ---------- Bullets ---------- */
.kle-bullets {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}

.kle-bullets li {
    position: relative;
    padding: 8px 0 8px 32px;
    font-size: 15px;
    color: var(--kle-ink);
    border-bottom: 1px solid var(--kle-line);
}

.kle-bullets li:last-child {
    border-bottom: 0;
}

.kle-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--kle-success-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 12px no-repeat;
}

/* ---------- Buy CTA / form ---------- */
.kle-buy {
    margin-top: 4px;
}

.kle-buy-stage[hidden] {
    display: none !important;
}

.kle-cta {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: var(--kle-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 16px -6px rgba(29, 78, 216, 0.5);
    transition: background 0.18s ease, transform 0.06s ease, box-shadow 0.18s ease;
    text-decoration: none;
    line-height: 1;
}

.kle-cta:hover, .kle-cta:focus-visible {
    background: var(--kle-accent-hi);
    box-shadow: 0 10px 22px -8px rgba(29, 78, 216, 0.6);
    color: #fff;
}

.kle-cta:active {
    transform: translateY(1px);
}

/* Form */
.kle-buy-form {
    background: var(--kle-surface);
    border: 1px solid var(--kle-line);
    border-radius: var(--kle-radius);
    padding: 24px;
}

.kle-form-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--kle-ink);
}

.kle-form-sub {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--kle-ink-soft);
}

.kle-field {
    margin-bottom: 14px;
}

.kle-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--kle-ink);
}

.kle-field .req {
    color: var(--kle-fail);
}

.kle-field input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: var(--kle-ink);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kle-field input:focus {
    outline: none;
    border-color: var(--kle-accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.kle-field-help {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--kle-muted);
}

.kle-submit {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: var(--kle-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.18s ease, opacity 0.18s ease;
    line-height: 1;
}

.kle-submit:hover { background: var(--kle-accent-hi); }
.kle-submit[disabled] { opacity: 0.7; cursor: progress; }

.kle-submit-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: kle-spin 0.7s linear infinite;
}

.kle-submit[disabled] .kle-submit-spinner { display: inline-block; }

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

.kle-link-back {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    color: var(--kle-ink-soft);
    font-size: 13px;
    margin-top: 10px;
    width: 100%;
    cursor: pointer;
    padding: 6px;
    font-family: inherit;
}

.kle-link-back:hover { color: var(--kle-ink); }

.kle-form-error {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--kle-fail-bg);
    color: var(--kle-fail);
    border-radius: 6px;
    font-size: 13px;
}

.kle-form-error.is-shown { display: block; }

.kle-secure {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--kle-line);
    font-size: 12px;
    color: var(--kle-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* ---------- Terms / disclaimer ---------- */
.kle-terms {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--kle-muted);
    line-height: 1.5;
}

/* ---------- Description below ---------- */
.kle-course-description {
    margin: 64px auto 0;
    max-width: 760px;
    font-size: 16px;
    color: var(--kle-ink);
    line-height: 1.7;
}

.kle-course-description p { margin: 0 0 1em; }

/* =============================================================
 * Thank-you / Payment failed
 * ============================================================= */
.kle-thank-you,
.kle-payment-failed {
    max-width: 640px;
    margin: 48px auto;
    padding: 0 20px;
}

.kle-thank-card {
    background: #fff;
    border: 1px solid var(--kle-line, #e2e8f0);
    border-radius: 14px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.15);
}

@media (max-width: 520px) {
    .kle-thank-card { padding: 28px 22px; }
}

.kle-thank-check,
.kle-fail-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kle-thank-check {
    background: #ecfdf5;
    color: #059669;
}

.kle-fail-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.kle-thank-title {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.kle-thank-lead {
    margin: 0 0 22px;
    color: #475569;
    font-size: 16px;
    line-height: 1.55;
}

.kle-thank-note {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 28px;
    font-size: 14px;
    text-align: left;
    line-height: 1.5;
}

.kle-thank-note-soft {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.kle-thank-section-title {
    margin: 8px 0 14px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    text-align: left;
}

.kle-asset-list {
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.kle-asset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.kle-asset-item:last-child { border-bottom: 0; }

.kle-asset-meta { min-width: 0; }
.kle-asset-label {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    word-break: break-word;
}
.kle-asset-type {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.kle-asset-download {
    background: #1d4ed8;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.kle-asset-download:hover { background: #1e40af; }

.kle-thank-help {
    margin: 16px 0 0;
    font-size: 14px;
    color: #475569;
}

.kle-thank-help a { color: #1d4ed8; }

.kle-thank-ref {
    margin: 18px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.kle-thank-ref code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.kle-fail-actions {
    margin: 24px 0 16px;
}

.kle-fail-reason {
    display: block;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 14px;
    font-style: italic;
}

.kle-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.kle-empty h2 { margin: 0 0 10px; }
.kle-empty code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
}
