.lms-page {
    font-family: "Sora", "Inter", sans-serif;
}

/* ── Hero ───────────────────────────────────────────────────── */
.lms-hero {
    background: linear-gradient(
        135deg,
        #1e1b4b 0%,
        #4c1d95 50%,
        #6d28d9 100%
    ) !important;
    position: relative;
    overflow: hidden;
    padding: 72px 24px 100px;
    text-align: center;
    isolation: isolate;
}

.lms-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 55% 70% at 15% 50%,
            rgba(124, 58, 237, 0.45) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 45% 55% at 85% 25%,
            rgba(56, 189, 248, 0.2) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse 40% 50% at 50% 110%,
            rgba(167, 139, 250, 0.18) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 0;
}

.lms-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.06) 1px,
        transparent 1px
    );
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.lms-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.lms-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(167, 139, 250, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.lms-title {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 800;
    color: #ffffff !important;
    line-height: 1.15;
    margin: 0 0 16px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}

.lms-title .lms-accent {
    color: #a78bfa !important;
}

.lms-subtitle {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 1rem;
    margin: 0;
}

      .lms-filter-wrap {
            max-width: 1200px;
             margin: 0 auto 1.25rem;
    padding: 2rem 1.5rem 0;
        }

        .lms-filter-label {
            font-size: .72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .08em;
            color: #9ca3af;
            margin-bottom: .65rem;
        }

        .lms-filter-bar {
            display: flex;
            flex-wrap: wrap;
            gap: .5rem;
            align-items: center;
        }

        .lms-filter-pill {
            display: inline-flex;
            align-items: center;
            gap: .35rem;
            padding: .42rem .9rem;
            border-radius: 999px;
            border: 1.5px solid #e5e7eb;
            background: #fff;
            font-size: .82rem;
            font-weight: 600;
            color: #374151;
            cursor: pointer;
            transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
            white-space: nowrap;
            user-select: none;
        }

        .lms-filter-pill:hover {
            border-color: #a78bfa;
            color: #6d28d9;
            box-shadow: 0 0 0 3px rgba(124, 58, 237, .08);
        }

        .lms-filter-pill.active {
            background: #7c3aed;
            border-color: #7c3aed;
            color: #fff;
            box-shadow: 0 2px 8px rgba(124, 58, 237, .28);
        }

        .lms-filter-pill .pill-icon {
            font-size: .95rem;
            line-height: 1;
        }

        .lms-filter-pill .pill-count {
            font-size: .7rem;
            font-weight: 700;
            opacity: .7;
            background: rgba(0, 0, 0, .08);
            border-radius: 999px;
            padding: .05rem .4rem;
        }

        .lms-filter-pill.active .pill-count {
            background: rgba(255, 255, 255, .22);
            opacity: 1;
        }

        /* Cards hidden when filtered out */
        .lms-card[data-class-id].hidden {
            display: none;
        }

        /* Empty state when filter yields nothing */
        .lms-filter-empty {
            display: none;
            grid-column: 1 / -1;
            text-align: center;
            padding: 3.5rem 1rem;
        }

        .lms-filter-empty.visible {
            display: block;
        }

        .lms-filter-empty-icon {
            font-size: 2.8rem;
            margin-bottom: .75rem;
        }

        .lms-filter-empty h3 {
            font-size: 1.15rem;
            font-weight: 700;
            color: #374151;
            margin-bottom: .35rem;
        }

        .lms-filter-empty p {
            color: #9ca3af;
            font-size: .9rem;
        }

.lms-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.lms-stat-n {
    font-size: 2.1rem;
    font-weight: 800;
    color: #ffffff !important;
    line-height: 1;
}

.lms-stat-l {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 5px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.lms-grid {
 display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 22px;
    max-width: 1120px;
    margin: 0 auto 0;          /* was: -48px auto 0 */
    padding: 0 24px 72px;
    position: relative;
    z-index: 2;
}

.lms-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow:
        0 4px 24px rgba(109, 40, 217, 0.09),
        0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #ede9fe;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition:
        transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.lms-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--lcard-accent, #7c3aed);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}

.lms-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(109, 40, 217, 0.18);
}

.lms-card:hover::before {
    transform: scaleX(1);
}

.lms-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    margin-bottom: 16px;
    background: var(--lcard-icon-bg, #ede9fe);
    flex-shrink: 0;
}

.lms-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 6px;
    line-height: 1.3;
}

.lms-card p {
    font-size: 0.855rem;
    color: #6b7280;
    line-height: 1.6;
    flex: 1;
    margin: 0;
}

.lms-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.lms-q-count {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 600;
}

.lms-diff {
    display: inline-flex;
    align-items: center;
    font-size: 0.71rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.lms-diff-easy {
    background: #d1fae5;
    color: #065f46;
}

.lms-diff-med {
    background: #fef3c7;
    color: #92400e;
}

.lms-diff-hard {
    background: #fee2e2;
    color: #991b1b;
}

.lms-btn-start {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 8px;
    border: none;
    background: #7c3aed;
    color: #ffffff;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.15s;
    line-height: 1;
    white-space: nowrap;
}

.lms-btn-start:hover {
    background: #6d28d9;
    transform: scale(1.04);
}

.lms-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 64px 20px;
    color: #9ca3af;
}

.lms-empty-icon {
    font-size: 3rem;
    margin-bottom: 14px;
}

.lms-empty h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.lms-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ── Shared modal shell ──────────────────────────────────────── */
.lms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lms-overlay.open {
    display: flex;
}

.lms-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 28px 72px rgba(30, 27, 75, 0.3);
    animation: lmsPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lmsPopIn {
    from {
        transform: scale(0.87) translateY(16px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.lms-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0 0 4px;
}

.lms-modal-sub {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* ── Step indicator ──────────────────────────────────────────── */
.lms-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.75rem;
}

.lms-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
}

.lms-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    background: #e5e7eb;
    color: #9ca3af;
    transition: all 0.2s;
}

.lms-step.active .lms-step-num {
    background: #7c3aed;
    color: #fff;
}

.lms-step.done .lms-step-num {
    background: #22c55e;
    color: #fff;
}

.lms-step-label {
    color: #9ca3af;
    transition: color 0.2s;
}

.lms-step.active .lms-step-label {
    color: #1e1b4b;
}

.lms-step.done .lms-step-label {
    color: #22c55e;
}

.lms-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    transition: background 0.2s;
}

.lms-step-line.done {
    background: #22c55e;
}

/* ── Form fields (Step 1) ────────────────────────────────────── */
.lms-field {
    margin-bottom: 1.1rem;
}

.lms-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.lms-field label span {
    color: #ef4444;
    margin-left: 2px;
}

.lms-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-size: 0.92rem;
    font-family: inherit;
    color: #1e1b4b;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    background: #fafafa;
}

.lms-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    background: #fff;
}

.lms-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.lms-field-err {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.lms-field-err.show {
    display: block;
}

/* Privacy note */
.lms-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: #166534;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ── Chapter pills (Step 2) ──────────────────────────────────── */
.lms-ch-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lms-ch-label small {
    font-weight: 500;
    color: #9ca3af;
    font-size: 0.72rem;
}

.lms-ch-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #9ca3af;
    padding: 8px 0;
}

.lms-ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
}

.lms-ch-pill {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #fafafa;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    text-align: left;
    font-family: inherit;
    outline: none;
}

.lms-ch-pill:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.lms-ch-pill.sel {
    border-color: #7c3aed;
    background: #ede9fe;
}

.lms-ch-pill-all {
    border-style: dashed;
}

.lms-ch-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.3;
}

.lms-ch-count {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 3px;
}

.lms-ch-none {
    font-size: 0.82rem;
    color: #9ca3af;
    font-style: italic;
    padding: 4px 0;
    margin: 0;
}

/* ── Sliders (Step 2) ────────────────────────────────────────── */
.lms-form-row {
    margin-bottom: 1.25rem;
}

.lms-form-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
}

.lms-form-val {
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 3px 11px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

.lms-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    accent-color: #7c3aed;
    cursor: pointer;
    outline: none;
    display: block;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.lms-modal-hr {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 1.4rem 0;
}

.lms-modal-actions {
    display: flex;
    gap: 10px;
}

.lms-btn-cancel {
    flex: 1;
    padding: 0.875rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.lms-btn-cancel:hover {
    border-color: #d1d5db;
    color: #374151;
}

.lms-btn-back {
    flex: 1;
    padding: 0.875rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.lms-btn-back:hover {
    border-color: #d1d5db;
    color: #374151;
}

.lms-btn-next,
.lms-btn-go {
    flex: 2;
    padding: 0.875rem;
    border-radius: 12px;
    border: none;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.lms-btn-next:hover,
.lms-btn-go:hover {
    background: #6d28d9;
}

.lms-btn-go:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.lms-spinner {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lmsSpin 0.55s linear infinite;
}

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

@keyframes lmsFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.lms-fadein {
    animation: lmsFadeUp 0.4s ease both;
}

@media (max-width: 600px) {
    .lms-hero {
        padding: 56px 16px 80px;
    }

    .lms-grid {
        padding: 0 14px 52px;
        gap: 16px;
    }

    .lms-stats {
        gap: 24px;
    }

    .lms-modal {
        padding: 1.75rem 1.25rem;
    }

    .lms-ch-grid {
        grid-template-columns: 1fr 1fr;
    }
}
