/* ============================================================
   IM GROUP Academy — Brand: #4A1E78 (purple) + #F5C518 (yellow)
   ============================================================ */
:root {
    --brand: #4A1E78;
    --brand-700: #3D1A6F;
    --brand-600: #5b2a8c;
    --brand-100: #f3edfb;
    --brand-50:  #faf7fe;
    --accent:    #F5C518;
    --accent-600:#e0b310;
    --accent-50: #fffaeb;

    --ink:       #1a1033;
    --ink-2:     #3a3055;
    --muted:     #6b6485;
    --muted-2:   #8e88a3;
    --line:      #ece8f3;
    --line-2:    #f1eef6;
    --bg:        #fbfaff;
    --card:      #ffffff;

    --ok:        #047857;
    --ok-bg:     #ecfdf5;
    --err:       #b91c1c;
    --err-bg:    #fef2f2;
    --info:      #4A1E78;
    --info-bg:   #f3edfb;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(26, 16, 51, .04), 0 1px 3px rgba(26, 16, 51, .06);
    --shadow-md: 0 4px 12px rgba(26, 16, 51, .06), 0 2px 4px rgba(26, 16, 51, .04);
    --shadow-lg: 0 20px 40px -12px rgba(74, 30, 120, .18), 0 8px 16px -8px rgba(74, 30, 120, .12);
    --shadow-glow: 0 8px 30px rgba(74, 30, 120, .25);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.015em; line-height: 1.25; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; width: 100%; }
.narrow    { max-width: 460px; }
.medium    { max-width: 720px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--ink);
}
.brand img { height: 34px; width: auto; display: block; }
.brand-tag {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--brand);
    text-transform: uppercase;
    padding: 4px 10px;
    background: var(--brand-100);
    border-radius: 999px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links > a, .nav-links button {
    font: inherit;
    color: var(--ink-2);
    padding: 9px 16px;
    border-radius: 9px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
}
.nav-links > a:hover, .nav-links button:hover {
    background: var(--brand-50);
    color: var(--brand);
}
.nav-links > a.active {
    color: var(--brand);
    background: var(--brand-100);
    font-weight: 600;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

/* ============================================================
   MAIN / LAYOUT
   ============================================================ */
main { flex: 1; padding: 48px 0 80px; }

.page-head { margin-bottom: 36px; }
.page-title {
    font-size: 2rem;
    margin: 0 0 8px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.page-sub {
    color: var(--muted);
    margin: 0;
    font-size: 1.05rem;
}

.eyebrow {
    display: inline-block;
    color: var(--brand);
    background: var(--brand-100);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .72rem;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 36px;
}
.card-tight { padding: 28px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    padding: 13px 26px;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover {
    background: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1.02rem; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 8px; }

.btn-ghost {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--line);
}
.btn-ghost:hover {
    background: var(--brand-50);
    border-color: var(--brand-100);
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}
.btn-accent:hover {
    background: var(--accent-600);
    border-color: var(--accent-600);
    color: var(--ink);
    box-shadow: 0 8px 30px rgba(245, 197, 24, .35);
}

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 20px; }
.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: .93rem;
    color: var(--ink-2);
}
.field input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
    transition: all .15s;
}
.field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(74, 30, 120, .12);
}
.field input:disabled {
    background: var(--bg);
    color: var(--muted);
}
.field .hint {
    color: var(--muted);
    font-size: .85rem;
    margin-top: 6px;
}

.otp-input {
    letter-spacing: 20px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    padding-left: 20px !important;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--brand);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: .96rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}
.flash.success { background: var(--ok-bg);   color: var(--ok);   border-color: #a7f3d0; }
.flash.error   { background: var(--err-bg);  color: var(--err);  border-color: #fecaca; }
.flash.info    { background: var(--info-bg); color: var(--info); border-color: #ddd0f1; }

/* ============================================================
   HERO (home) — centered layout
   ============================================================ */
.hero {
    position: relative;
    padding: 80px 0 60px;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 900px 460px at 50% -10%, rgba(74, 30, 120, .10), transparent 60%),
        radial-gradient(ellipse 600px 300px at 80% 80%, rgba(245, 197, 24, .10), transparent 60%),
        radial-gradient(ellipse 500px 280px at 15% 70%, rgba(245, 197, 24, .07), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.hero-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}
.hero h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    margin: 22px 0 24px;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.12;
}
.hero h1 .accent { color: var(--brand); position: relative; display: inline-block; }
.hero h1 .accent::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 10px;
    background: var(--accent);
    opacity: .4;
    border-radius: 4px;
    z-index: -1;
}
.hero .lead {
    color: var(--ink-2);
    font-size: 1.18rem;
    margin: 0 auto 38px;
    line-height: 1.65;
    max-width: 680px;
}
.hero .lead b { color: var(--brand); font-weight: 700; }
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 56px;
}

/* Stats row — inline divider style, centered */
.stats {
    display: inline-flex;
    align-items: center;
    gap: 36px;
    padding: 26px 44px;
    background: rgba(255, 255, 255, .65);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.stat {
    text-align: center;
    min-width: 0;
}
.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -.02em;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    justify-content: center;
}
.stat-num span {
    font-size: 1.3rem;
    color: var(--accent-600);
}
.stat-label {
    font-size: .9rem;
    color: var(--muted);
    margin-top: 8px;
    white-space: nowrap;
}
.stat-divider {
    width: 1px;
    height: 38px;
    background: var(--line);
    flex-shrink: 0;
}

/* ============================================================
   SECTIONS (why-choose-us / features)
   ============================================================ */
.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}
.section-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 14px 0 12px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.section-head p {
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
}

.why { padding: 60px 0; }
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}
.feature {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 28px 24px;
    transition: all .22s;
}
.feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-100);
}
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-100) 0%, var(--brand-50) 100%);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 16px;
}
.feature h3 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    font-weight: 700;
}
.feature p {
    color: var(--muted);
    font-size: .96rem;
    margin: 0;
    line-height: 1.6;
}

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
    margin: 40px 0 20px;
    border-radius: var(--r-xl);
    background:
        radial-gradient(circle at 90% 10%, rgba(245, 197, 24, .25), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(245, 197, 24, .12), transparent 50%),
        linear-gradient(135deg, var(--brand-700) 0%, var(--brand) 100%);
    color: #fff;
    overflow: hidden;
    position: relative;
}
.cta-banner-inner {
    padding: 56px 32px;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.cta-banner h2 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 14px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.cta-banner p {
    color: rgba(255, 255, 255, .85);
    font-size: 1.05rem;
    margin: 0 0 28px;
    line-height: 1.6;
}

/* ============================================================
   COURSE GRID
   ============================================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}
.course-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .22s;
    text-decoration: none;
    color: inherit;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-100);
    text-decoration: none;
}
.course-thumb {
    aspect-ratio: 16/9;
    background:
        linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 60%, #6e3aa5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 2.6rem;
    position: relative;
    overflow: hidden;
}
.course-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(245, 197, 24, .25), transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .12), transparent 50%);
}
.course-thumb span { position: relative; z-index: 1; opacity: .95; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.course-body h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}
.course-body .sub {
    color: var(--muted);
    font-size: .94rem;
    flex: 1;
    margin: 0 0 18px;
    line-height: 1.55;
}
.course-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
    font-size: .9rem;
}
.course-meta .lesson-count {
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge {
    font-size: .76rem;
    padding: 5px 11px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .02em;
}
.badge.owned  { background: var(--ok-bg);   color: var(--ok); }
.badge.locked { background: var(--accent-50); color: #92660b; }
.price        { font-weight: 700; color: var(--brand); font-size: 1rem; }

/* ============================================================
   LESSON LAYOUT
   ============================================================ */
.breadcrumb {
    font-size: .9rem;
    color: var(--muted);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--line); }

.lesson-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}
.video-frame {
    position: relative;
    aspect-ratio: 16/9;
    background: #0a0613;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame .placeholder {
    color: rgba(255,255,255,.5);
    display: flex; align-items: center; justify-content: center;
    height: 100%;
    font-size: .95rem;
}
.prose {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 28px 32px;
    margin-top: 24px;
    color: var(--ink-2);
    line-height: 1.72;
}
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose img { max-width: 100%; border-radius: 8px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose a { color: var(--brand); }

.sidebar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 12px;
    position: sticky;
    top: 90px;
}
.sidebar h4 {
    margin: 14px 14px 10px;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted-2);
    font-weight: 700;
}
.lesson-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: .94rem;
    text-decoration: none;
    transition: background .15s;
}
.lesson-item .num {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--line-2);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    flex-shrink: 0;
}
.lesson-item:hover { background: var(--brand-50); text-decoration: none; color: var(--brand); }
.lesson-item:hover .num { background: var(--brand-100); color: var(--brand); }
.lesson-item.active {
    background: var(--brand-100);
    color: var(--brand);
    font-weight: 600;
}
.lesson-item.active .num {
    background: var(--brand);
    color: #fff;
}

.materials {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}
.materials li { margin-bottom: 10px; }
.materials a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}
.materials a:hover {
    border-color: var(--brand-100);
    background: var(--brand-50);
    color: var(--brand);
    text-decoration: none;
    transform: translateX(2px);
}
.materials .icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--brand-100);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   COURSE DETAIL / LOCKED
   ============================================================ */
.course-hero {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 36px;
    align-items: start;
    margin-bottom: 36px;
}
.course-hero-thumb {
    aspect-ratio: 16/9;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.course-hero-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(245, 197, 24, .25), transparent 50%);
}
.course-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }

.lesson-list {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.lesson-list .lesson-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink-2);
    text-decoration: none;
    transition: background .15s;
}
.lesson-list .lesson-row:last-child { border-bottom: none; }
.lesson-list .lesson-row:hover {
    background: var(--brand-50);
    text-decoration: none;
}
.lesson-list .num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.lesson-list .title { flex: 1; font-weight: 500; }
.lesson-list .duration { color: var(--muted); font-size: .9rem; }

.locked-box {
    text-align: center;
    padding: 40px 28px;
}
.lock-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-50);
    color: var(--accent-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 18px;
}
.price-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
    margin: 16px 0 8px;
    letter-spacing: -.02em;
}
.price-label {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 32px 0;
    color: var(--muted);
    font-size: .9rem;
    background: #fff;
    margin-top: auto;
}
.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 26px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    .lesson-wrap { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .course-hero { grid-template-columns: 1fr; }
    .course-hero-thumb { max-width: 100%; }
    .hero { padding: 56px 0 40px; }
    .stats { gap: 24px; padding: 22px 28px; }
}
@media (max-width: 640px) {
    .container { padding: 0 18px; }
    .nav { height: 64px; }
    .brand img { height: 28px; }
    .brand-tag { display: none; }
    .nav-links > a, .nav-links button { padding: 8px 10px; font-size: .95rem; }
    .nav-user { padding-left: 8px; }
    .avatar { width: 32px; height: 32px; }
    main { padding: 32px 0 56px; }
    .page-title { font-size: 1.55rem; }
    .card { padding: 24px; }
    .otp-input { font-size: 1.6rem; letter-spacing: 14px; }
    .stat-num { font-size: 1.55rem; }
    .stat-num span { font-size: 1.05rem; }
    .cta-banner-inner { padding: 40px 22px; }
    .hero { padding: 40px 0 30px; }
    .stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        padding: 18px 12px;
        width: 100%;
    }
    .stat-label { font-size: .78rem; white-space: normal; }
    .stat-divider { height: 30px; }
}
