@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #111922;
    --bg-deep: #0c131b;
    --surface: #18222b;
    --surface-2: #202b35;
    --surface-3: #25313b;
    --card: rgba(32, 43, 53, .82);
    --card-soft: rgba(38, 50, 60, .74);
    --line: rgba(220, 235, 222, .13);
    --line-strong: rgba(220, 235, 222, .23);
    --text: #f3f6f2;
    --text-soft: #dce4df;
    --muted: #aab8b3;
    --muted-2: #869892;
    --sage: #b8d7ba;
    --sage-2: #8fb8a0;
    --sage-3: #d9ead5;
    --sage-dark: #496e5f;
    --blue: #93a9d8;
    --danger: #ef8a8a;
    --warning: #efcf83;
    --shadow: 0 24px 60px rgba(0, 0, 0, .36);
    --shadow-soft: 0 16px 42px rgba(0, 0, 0, .26);
    --radius-xl: 24px;
    --radius: 18px;
    --radius-sm: 13px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 9% 19%, rgba(122, 161, 139, .22), transparent 27%),
        radial-gradient(circle at 81% 0%, rgba(78, 101, 122, .26), transparent 30%),
        linear-gradient(180deg, #101821 0%, #111922 42%, #0b1119 100%);
    text-rendering: geometricPrecision;
}
a { color: inherit; text-decoration: none; }
.container { width: min(1430px, calc(100% - 44px)); margin: 0 auto; }

/* Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(17, 25, 34, .86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.topbar-inner {
    min-height: 82px;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(280px, 1fr);
    align-items: center;
    gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 13px; width: max-content; }
.brand-mark {
    width: 52px; height: 52px;
    display: inline-grid; place-items: center;
    border-radius: 17px;
    color: #102018;
    font-weight: 900;
    letter-spacing: -.05em;
    background: linear-gradient(135deg, #d5edd4 0%, #a6cfb1 58%, #8fb8a0 100%);
    box-shadow: 0 20px 46px rgba(184, 215, 186, .16), inset 0 1px 0 rgba(255,255,255,.45);
}
.brand-text strong { display: block; font-weight: 850; letter-spacing: -.03em; font-size: 18px; }
.brand-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.nav a {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--muted);
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 750;
    position: relative;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav a.active { color: var(--text); }
.nav a.active::after {
    content: "";
    position: absolute;
    left: 13px; right: 13px; bottom: -18px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--sage), transparent);
    box-shadow: 0 0 16px rgba(184,215,186,.38);
}
.account-pill { justify-self: end; display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 42px; height: 42px; display: inline-grid; place-items: center;
    border-radius: 50%;
    color: var(--text);
    background: linear-gradient(135deg, #33414b, #53655f);
    border: 1px solid var(--line-strong);
    font-weight: 850;
}
.account-copy strong { display:block; font-size: 14px; }
.account-copy small { display:block; color: var(--muted); font-size: 12px; margin-top:2px; }
.logout-link {
    padding: 11px 15px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,.035);
    font-weight: 800;
    font-size: 13px;
}
.logout-link:hover { background: rgba(255,255,255,.065); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 27px; }

.page { padding: 34px 0 58px; min-height: calc(100vh - 150px); }
.footer {
    background: rgba(23, 33, 42, .86);
    border-top: 1px solid var(--line);
    color: var(--muted);
}
.footer-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}
.footer-inner::before {
    content: "Aa";
    width: 42px; height: 42px;
    display: inline-grid; place-items: center;
    border-radius: 50%;
    background: rgba(184, 215, 186, .12);
    border: 1px solid var(--line-strong);
    color: var(--sage);
    font-weight: 850;
    margin-right: -6px;
}

/* Dashboard hero */
.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .75fr);
    gap: 22px;
    margin-bottom: 22px;
}
.hero-card, .panel, .card, .login-card, .stat-card, .mini-card, .course-tile, .module, .table-wrap, .sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,.056), rgba(255,255,255,.026));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-xl);
}
.hero-card { min-height: 290px; padding: 34px 38px; position: relative; overflow: hidden; }
.hero-main-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: center;
    background:
        radial-gradient(circle at 83% 50%, rgba(184,215,186,.18), transparent 24%),
        linear-gradient(135deg, rgba(184,215,186,.16), rgba(255,255,255,.038) 52%, rgba(123, 151, 141, .10));
}
.hero-main-card::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .22;
    background-image: radial-gradient(circle at 1px 1px, rgba(226,236,226,.28) 1px, transparent 0);
    background-size: 18px 18px;
    mask-image: linear-gradient(100deg, transparent 0 55%, #000 80%, transparent 100%);
}
.hero-copy { position: relative; z-index: 2; max-width: 680px; }
.kicker {
    color: var(--sage);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 900;
    letter-spacing: .105em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.leaf-dot { margin-right: 7px; color: var(--sage-3); }
h1, h2, h3 { margin: 0; letter-spacing: -.045em; }
h1 { font-size: clamp(38px, 4.7vw, 62px); line-height: 1.05; max-width: 760px; }
h2 { font-size: 28px; line-height: 1.18; }
h3 { font-size: 18px; line-height: 1.22; }
p { color: var(--text-soft); line-height: 1.65; margin: 0; }
.hero-copy p { margin-top: 14px; max-width: 720px; color: #d8e3dd; }
.actions { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; }
.hero-actions { margin-top: 22px; }
.btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 42px;
    padding: 11px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sage-3), var(--sage-2));
    color: #111d18;
    font-weight: 850;
    letter-spacing: -.02em;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(184,215,186,.13), inset 0 1px 0 rgba(255,255,255,.55);
    transition: transform .14s ease, filter .14s ease, background .14s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.035); }
.btn-outline { background: transparent; color: var(--text) !important; border: 1px solid var(--line-strong); box-shadow: none; }
.btn-soft { background: rgba(255,255,255,.048); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-danger { background: var(--danger); color: #2a0808; }

/* Botanical CSS illustration */
.botanical-art {
    position: relative; z-index: 2;
    width: 260px; height: 250px;
    justify-self: center;
    opacity: .62;
    filter: drop-shadow(0 30px 42px rgba(0,0,0,.22));
}
.botanical-art::before {
    content: "";
    position: absolute; inset: 2px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217,234,213,.16), transparent 62%);
}
.stem {
    position: absolute; left: 118px; bottom: 36px;
    width: 6px; height: 172px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(217,234,213,.95), rgba(116,143,126,.18));
    transform: rotate(8deg);
}
.leaf {
    position: absolute;
    width: 76px; height: 36px;
    background: linear-gradient(135deg, rgba(218,234,212,.95), rgba(128,158,137,.44));
    border-radius: 100% 0 100% 0;
    transform-origin: right center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.l1 { left: 48px; top: 76px; transform: rotate(18deg); }
.l2 { right: 40px; top: 80px; transform: scaleX(-1) rotate(14deg); }
.l3 { left: 28px; top: 126px; transform: rotate(34deg) scale(.92); }
.l4 { right: 28px; top: 132px; transform: scaleX(-1) rotate(35deg) scale(.92); }
.l5 { left: 70px; top: 42px; transform: rotate(-16deg) scale(.78); }

.rules-card { background: linear-gradient(145deg, rgba(35,48,58,.9), rgba(30,40,49,.72)); }
.rules-title { display: flex; gap: 14px; align-items: center; margin-bottom: 15px; }
.icon-bubble, .stat-icon, .quick-icon, .section-icon, .course-icon, .lock-icon {
    display: inline-grid; place-items: center;
    border: 1px solid var(--line-strong);
    background: rgba(184,215,186,.12);
    color: var(--sage-3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.icon-bubble { width: 44px; height: 44px; border-radius: 15px; }
.rules-card p { color: #cbd7d1; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card { padding: 20px; border-radius: 18px; box-shadow: none; background: rgba(255,255,255,.045); }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 12px; }
.stat-card strong { display:block; font-size: 34px; line-height: 1; margin-bottom: 6px; }
.stat-card small, .stat-card span { color: var(--muted); font-size: 13px; line-height: 1.35; }

.quick-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 26px;
}
.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 18px;
    border-radius: 19px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.032);
}
.quick-icon { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; }
.quick-card strong { display:block; font-size: 14px; margin-bottom: 2px; }
.quick-card small { display:block; color: var(--muted); line-height: 1.35; }
.quick-link:hover { border-color: var(--line-strong); background: rgba(255,255,255,.048); }

.section-block { margin-top: 26px; }
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}
.section-heading h2 { display: flex; align-items: center; gap: 12px; }
.section-heading p { color: var(--muted); margin-top: 4px; }
.section-icon { width: 34px; height: 34px; border-radius: 50%; font-size: 15px; color: var(--sage); }
.section-icon.compass { background: rgba(184,215,186,.14); }

.course-grid { display: grid; gap: 18px; }
.enrolled-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.locked-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.course-tile {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 238px;
    gap: 12px;
    background: linear-gradient(155deg, rgba(37,49,59,.88), rgba(23,32,42,.76));
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.course-tile:hover { transform: translateY(-2px); border-color: var(--line-strong); background: linear-gradient(155deg, rgba(42,55,66,.92), rgba(25,35,44,.8)); }
.course-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-icon { width: 58px; height: 58px; border-radius: 16px; font-weight: 900; font-size: 20px; background: linear-gradient(135deg, rgba(184,215,186,.28), rgba(74,103,91,.18)); }
.lock-icon { width: 46px; height: 46px; border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.054); }
.pill-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--text-soft);
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 750;
}
.pill-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 12px var(--sage); }
.course-tile h3 { margin-top: 2px; }
.course-tile p { color: #cbd6d2; font-size: 14px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 760;
    color: var(--muted);
    background: rgba(255,255,255,.052);
    border: 1px solid var(--line);
}
.badge.success { color: #112019; background: var(--sage); border-color: transparent; }
.badge.locked { color: var(--muted); background: rgba(255,255,255,.035); }
.course-extra {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,.03);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}
.progress-row { display:flex; justify-content: space-between; gap:10px; color: var(--muted); font-size: 12px; margin-top:auto; }
.progress { width: 100%; height: 8px; border-radius: 999px; background: rgba(255,255,255,.10); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--sage-2)); border-radius: inherit; }
.tile-actions { margin-top: 6px; }
.locked-card { border-style: dashed; opacity: .92; min-height: 214px; }
.locked-card .tile-actions { margin-top: auto; }

/* Generic panels and older page elements */
.panel, .card, .login-card { padding: 24px; }
.panel h1, .card h1 { margin-bottom: 12px; }
.panel p, .card p { margin-top: 8px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.empty {
    padding: 30px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
    background: rgba(255,255,255,.025);
    text-align: center;
    color: var(--muted);
}
.empty strong { color: var(--text); }
.empty-actions { justify-content: center; margin-top: 18px; }

/* Forms */
.login-wrap { display: grid; place-items: center; min-height: 68vh; }
.login-card { width: min(480px, 100%); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 760; }
input, textarea, select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,.055);
    color: var(--text);
    outline: none;
    font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(184,215,186,.62); box-shadow: 0 0 0 4px rgba(184,215,186,.08); }
select option { background: #17212b; color: var(--text); }
.alert { padding: 13px 15px; border-radius: 14px; margin-bottom: 18px; border: 1px solid var(--line); }
.alert-success { background: rgba(184,215,186,.12); color: var(--sage-3); }
.alert-error { background: rgba(239,138,138,.12); color: #ffc8c8; }
.alert-info { background: rgba(147,169,216,.13); color: #dce5ff; }

/* Admin and tables */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.sidebar { padding: 18px; height: max-content; position: sticky; top: 104px; }
.sidebar a { display: flex; align-items: center; color: var(--muted); padding: 12px 13px; border-radius: 13px; margin-bottom: 5px; font-weight: 800; }
.sidebar a:hover, .sidebar a.active { color: var(--text); background: rgba(255,255,255,.056); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
td { color: var(--text-soft); }
tr:last-child td { border-bottom: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 7px; }

/* Course page */
.module { margin-bottom: 16px; overflow: hidden; }
.module-head { padding: 20px 22px; background: rgba(255,255,255,.035); }
.module-head p { margin-top: 6px; }
.resource-list { display: grid; }
.resource-item { display: grid; grid-template-columns: 50px 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.resource-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(184,215,186,.10); font-size: 22px; }
.markdown-ish {
    white-space: pre-wrap;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    color: var(--text-soft);
    line-height: 1.65;
}
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.checkbox-card { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.checkbox-card input { width: auto; margin-top: 4px; }
.learning-path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.learning-path div { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.learning-path strong { display: block; margin-bottom: 6px; }
.learning-path span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.info-strip { align-items: stretch; }
.mini-card { padding: 18px; }
.mini-card span { display:block; color: var(--sage); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; font-weight: 900; }
.mini-card strong { display:block; font-size: 18px; margin-bottom: 6px; }
.mini-card small { display:block; color: var(--muted); line-height: 1.55; }
.mini-card a { color: var(--sage-3); font-weight: 850; }

@media (max-width: 1180px) {
    .topbar-inner { grid-template-columns: 1fr auto; }
    .account-pill { display: none; }
    .dashboard-hero { grid-template-columns: 1fr; }
    .hero-main-card { grid-template-columns: 1fr 220px; }
    .locked-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .container { width: min(100% - 28px, 760px); }
    .topbar-inner { display:flex; justify-content:space-between; min-height:76px; }
    .nav-toggle { display:block; }
    .nav {
        display:none;
        position:absolute;
        top:76px; left:14px; right:14px;
        flex-direction:column; align-items:stretch;
        padding:14px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: var(--shadow);
    }
    .nav-open .nav { display:flex; }
    .nav a.active::after { display:none; }
    .dashboard-hero, .hero-main-card, .quick-strip, .grid-2, .grid-3, .grid-4, .enrolled-grid, .locked-grid, .admin-layout, .form-row, .learning-path { grid-template-columns: 1fr; }
    .botanical-art { display:none; }
    .hero-card { padding: 26px; min-height: auto; }
    .stats-grid { grid-template-columns: 1fr; }
    .section-heading { align-items:flex-start; flex-direction:column; }
    .resource-item { grid-template-columns: 46px 1fr; }
    .resource-item .actions { grid-column: 1 / -1; }
    .checkbox-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; align-items: flex-start; padding: 18px 0; }
}
