/* Public site: catalog, course page, preview, certificate verification. */
:root {
    --ink: #101636;
    --ink-soft: #1c2452;
    --body: #4a5272;
    --muted: #767d99;
    --line: #e6e8f2;
    --surface: #ffffff;
    --page: #f6f7fc;
    --brand: #435ebe;
    --brand-deep: #2f46a0;
    --accent: #ff9f5a;
    --accent-2: #5de0c5;
    --radius: 18px;
    --shadow-sm: 0 2px 8px rgba(16, 22, 54, .06);
    --shadow-lg: 0 20px 45px rgba(16, 22, 54, .14);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

body.lms-public {
    background: var(--page);
    color: var(--body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.lms-public h1, .lms-public h2, .lms-public h3, .lms-public h4, .lms-public h5, .lms-public h6 { color: var(--ink); }
.lms-public a:focus-visible, .lms-public button:focus-visible, .lms-public summary:focus-visible, .lms-public input:focus-visible, .lms-public select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
.lms-public main { flex: 1; }
/* Enough room for the Bootstrap grid's negative margins, which otherwise overflow on phones. */
.lms-public .container { padding-inline: clamp(1rem, 3vw, 1.5rem); }

/* Navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem clamp(1rem, 4vw, 3rem);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: padding .25s var(--ease), border-color .25s, box-shadow .25s;
}
.site-nav.is-scrolled { padding-block: .55rem; border-color: var(--line); box-shadow: var(--shadow-sm); }
.site-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.site-brand i { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand), #7b6cf0); }
.site-nav-links { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.site-nav-link { padding: .45rem .8rem; border-radius: 10px; color: var(--ink-soft); font-weight: 600; transition: background .2s; }
.site-nav-link:hover { background: rgba(67, 94, 190, .1); color: var(--brand-deep); }

/* Buttons */
.btn-lms {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.25rem;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #6a5ce6);
    box-shadow: 0 8px 20px rgba(67, 94, 190, .3);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-lms::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%) skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transition: transform .6s var(--ease);
}
.btn-lms:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(67, 94, 190, .38); color: #fff; }
.btn-lms:hover::after { transform: translateX(120%) skewX(-20deg); }
.btn-lms:disabled { background: #9aa0b8; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-lms-ghost { background: transparent; color: var(--brand-deep); box-shadow: inset 0 0 0 1.5px rgba(67, 94, 190, .45); }
.btn-lms-ghost:hover { color: var(--brand-deep); background: rgba(67, 94, 190, .08); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-lms-sm { padding: .4rem .85rem; font-size: .875rem; border-radius: 10px; }

/* Flash messages */
.flash { padding-inline: clamp(1rem, 4vw, 3rem); }
.flash .alert { margin: 1rem auto 0; max-width: 1200px; border-radius: 14px; animation: rise .45s var(--ease) both; }

/* Hero */
.hero, .course-hero {
    position: relative;
    overflow: hidden;
    color: #d9ddf2;
    background: var(--ink);
    isolation: isolate;
}
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero.is-compact { padding: 2.5rem 0 3rem; }
.hero h1, .course-hero h1 { color: #fff; }
.hero-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 16s ease-in-out infinite alternate; }
.hero-orb-1 { top: -18%; left: -8%; width: 42vw; height: 42vw; background: #4c5fd7; }
.hero-orb-2 { right: -10%; bottom: -35%; width: 38vw; height: 38vw; background: #8a4fd8; animation-delay: -5s; }
.hero-orb-3 { top: 25%; left: 48%; width: 18vw; height: 18vw; background: #1fa98f; opacity: .35; animation-delay: -9s; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border-radius: 99px; font-size: .85rem; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); }
.hero-eyebrow i { color: var(--accent); }
.hero-title { font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; margin: 1rem 0; }
.hero-word { display: block; min-height: 1.1em; color: var(--accent); }
.hero-word::after { content: ""; display: inline-block; width: .07em; height: .9em; margin-left: .06em; vertical-align: -.08em; background: var(--accent); animation: blink 1s steps(1) infinite; }
.hero-lead { max-width: 34rem; font-size: 1.125rem; color: #c4c9e4; }

.hero-search { display: flex; gap: .5rem; max-width: 34rem; margin-top: 1.5rem; padding: .45rem; border-radius: 16px; background: #fff; box-shadow: 0 20px 45px rgba(0, 0, 0, .3); }
.hero-search i { align-self: center; margin-left: .7rem; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; padding: .5rem; color: var(--ink); background: transparent; }
.hero-search input:focus { outline: 0; }
.hero-search:focus-within { box-shadow: 0 0 0 3px var(--accent), 0 20px 45px rgba(0, 0, 0, .3); }

.hero-stats { display: flex; flex-wrap: wrap; gap: 2.25rem; margin-top: 2rem; }
.hero-stat strong { display: block; font-size: 1.75rem; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-stat span { font-size: .85rem; color: #aab0d0; }

/* Decorative product preview in the hero */
.hero-visual { position: relative; height: 340px; }
.float-card { position: absolute; padding: 1rem 1.15rem; border-radius: 16px; color: var(--ink); background: rgba(255, 255, 255, .96); box-shadow: 0 25px 50px rgba(0, 0, 0, .35); animation: float 6s ease-in-out infinite; }
.float-card small { display: block; color: var(--muted); font-weight: 600; }
.float-card strong { color: var(--ink); }
.float-card-1 { top: 6%; left: 8%; width: 300px; }
.float-card-2 { top: 42%; right: 2%; width: 225px; animation-delay: -2s; }
.float-card-3 { bottom: 2%; left: 18%; width: 245px; animation-delay: -4s; }
.float-icon { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-right: .6rem; border-radius: 12px; font-size: 1.15rem; color: #fff; }
.float-bar { height: .55rem; margin-top: .6rem; border-radius: 99px; background: var(--line); overflow: hidden; }
.float-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent-2)); animation: grow 3.2s var(--ease) infinite alternate; }

/* Filters */
.catalog-section { padding: 3rem 0 4rem; scroll-margin-top: 4rem; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: .25rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
.chip { padding: .42rem .95rem; border-radius: 99px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s; }
.chip:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand-deep); }
.chip.is-active { color: #fff; background: var(--brand); border-color: var(--brand); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1.75rem; }
.filter-bar .filter-field { flex: 1 1 150px; max-width: 220px; }
.filter-bar label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }
.filter-bar .form-select { border-radius: 12px; border-color: var(--line); }

/* Course cards */
.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.course-card-media { position: relative; overflow: hidden; }
.course-thumb { display: block; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: linear-gradient(135deg, #e4e8fb, #f2e8fb); transition: transform .5s var(--ease); }
.course-card:hover .course-thumb { transform: scale(1.06); }
.course-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #8e9bd6; }
.course-pill { position: absolute; top: .7rem; left: .7rem; padding: .2rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, .92); }
.course-pill-featured { left: auto; right: .7rem; color: #5a2d00; background: #ffd9b8; }
.course-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.15rem 1.15rem; }
.course-card h6 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin: 0 0 .35rem; transition: color .2s; }
.course-card:hover h6 { color: var(--brand-deep); }
.course-meta { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.course-rating { font-size: .85rem; margin-bottom: .6rem; color: var(--ink-soft); }
.course-rating i { color: #f5a623; }
.course-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.course-price { font-weight: 800; color: var(--ink); }
.course-go { color: var(--brand); transition: transform .25s var(--ease); }
.course-card:hover .course-go { transform: translateX(5px); }

.empty-state { padding: 3.5rem 1rem; text-align: center; border-radius: var(--radius); background: var(--surface); border: 1px dashed #cdd2e6; }
.empty-state i { font-size: 2.5rem; color: #a7aecb; }

/* How it works */
.steps-section { padding: 3.5rem 0; background: var(--surface); border-block: 1px solid var(--line); }
.step-card { height: 100%; padding: 1.5rem; border-radius: var(--radius); background: var(--page); transition: transform .3s var(--ease); }
.step-card:hover { transform: translateY(-4px); }
.step-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .9rem; border-radius: 14px; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, var(--brand), #7b6cf0); }
.teach-band { position: relative; overflow: hidden; margin: 3.5rem 0 4rem; padding: clamp(1.75rem, 4vw, 3rem); border-radius: 24px; color: #d9ddf2; background: var(--ink); isolation: isolate; }
.teach-band h3 { color: #fff; }

/* Course page */
.course-hero { padding: clamp(2.25rem, 5vw, 3.75rem) 0 clamp(3rem, 7vw, 5.5rem); }
.course-hero h1 { font-size: clamp(1.85rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -.015em; margin: .6rem 0; }
.course-hero .lead { color: #c4c9e4; font-size: 1.125rem; }
.crumb { font-size: .875rem; color: #aab0d0; }
.crumb a { color: #fff; font-weight: 600; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 99px; font-size: .85rem; color: #eef0fb; background: rgba(255, 255, 255, .1); }
.hero-chip i { color: var(--accent); }

.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; padding-bottom: 4rem; }
.course-main { padding-top: 2rem; }
.enroll-card { position: sticky; top: 5.25rem; margin-top: -4.5rem; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 5; }
.enroll-card-body { padding: 1.35rem; }
.enroll-price { font-size: 2rem; font-weight: 800; color: var(--ink); margin-bottom: .75rem; }
.enroll-list { list-style: none; padding: 0; margin: 1.1rem 0 0; font-size: .925rem; }
.enroll-list li { display: flex; gap: .6rem; padding: .35rem 0; }
.enroll-list i { color: var(--brand); }

.content-card { padding: 1.5rem; margin-bottom: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.content-card h5 { font-weight: 800; margin-bottom: .75rem; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.check-list li { display: flex; gap: .6rem; }
.check-list i { color: #17a589; }

.curriculum-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; margin: 2rem 0 .85rem; }
.curriculum-section { margin-bottom: .65rem; overflow: hidden; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.curriculum-section summary { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.15rem; cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; transition: background .2s; }
.curriculum-section summary::-webkit-details-marker { display: none; }
.curriculum-section summary:hover { background: #f4f5fb; }
.curriculum-section summary .caret { color: var(--muted); transition: transform .25s var(--ease); }
.curriculum-section[open] summary .caret { transform: rotate(90deg); }
.curriculum-section summary small { margin-left: auto; font-weight: 500; color: var(--muted); }
.curriculum-lesson { display: flex; align-items: center; gap: .7rem; padding: .7rem 1.15rem; border-top: 1px solid var(--line); animation: rise .35s var(--ease) both; }
.curriculum-lesson .type-icon { color: var(--brand); }
.curriculum-lesson .title { flex: 1; min-width: 0; }
.curriculum-lesson .lock { color: #a7aecb; }
.curriculum-lesson time { font-size: .85rem; color: var(--muted); }

/* Reviews */
.reviews-summary { display: inline-flex; align-items: center; gap: .4rem; font-size: .95rem; font-weight: 600; color: var(--muted); }
.reviews-summary i { color: #f5a623; }
.review-card { display: flex; gap: .9rem; padding: 1.15rem; margin-bottom: .7rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.avatar-initial { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), #8a6fe8); }
.review-stars i { color: #f5a623; font-size: .85rem; }
.review-stars i.bi-star { color: #c9cde0; }

/* Plain inner pages */
.page-band { padding: 2.25rem 0 3.5rem; }
.result-card { padding: 1.75rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) both; }
.result-icon { display: grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: 1rem; border-radius: 50%; font-size: 2rem; color: #fff; animation: pop .5s var(--ease) both; }
.result-icon.is-good { background: #17a589; }
.result-icon.is-bad { background: #d9465b; }

/* Footer */
.site-footer { padding-block: 1.5rem; font-size: .875rem; color: #aab0d0; background: var(--ink); }
.site-footer a { color: #fff; }
.site-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; }

/* Scroll reveal. Only hidden once JavaScript has started, so nothing is lost without it. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: var(--delay, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@keyframes drift { to { transform: translate(6%, 8%) scale(1.14); } }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes grow { from { width: 28%; } to { width: 88%; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: scale(.5); } }

@media (max-width: 991.98px) {
    .course-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .enroll-card { position: static; order: -1; margin-top: -2.5rem; }
    .hero-visual { display: none; }
}

@media (max-width: 575.98px) {
    .site-nav-link-optional { display: none; }
    .site-brand span { max-width: 9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .filter-bar .filter-field { max-width: none; flex-basis: calc(50% - .375rem); }
    .hero-stats { gap: 1.25rem; }
    .btn-lms-sm { padding: .35rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
    .hero-word::after { display: none; }
    .float-bar span { width: 68%; }
}
