:root {
    --ink: #141816;
    --muted: #66736e;
    --line: #dce5e1;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-solid: #ffffff;
    --soft: #edf5f1;
    --brand: #0f8a70;
    --brand-dark: #075846;
    --brand-soft: #dff5ec;
    --accent: #c43f4f;
    --warn: #b7791f;
    --code: #0c1110;
    --shadow: 0 18px 48px rgba(18, 30, 26, 0.1);
    --shadow-sm: 0 10px 28px rgba(18, 30, 26, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(15, 138, 112, 0.14), transparent 30%),
        radial-gradient(circle at 88% 14%, rgba(196, 63, 79, 0.1), transparent 28%),
        linear-gradient(135deg, #f6faf8 0%, #edf3f1 54%, #f9faf6 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(20, 24, 22, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 24, 22, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 72%);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 12px 24px rgba(15, 138, 112, 0.22);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 138, 112, 0.26);
    filter: saturate(1.08);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.86);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(15, 138, 112, 0.7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 138, 112, 0.12);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 18px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(220, 229, 225, 0.78);
    background: rgba(255, 255, 255, 0.76);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 25px;
    line-height: 1;
}

.topbar p {
    margin: 0;
}

.topbar form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.notice {
    max-width: 1180px;
    margin: 18px auto 0;
    padding: 13px 16px;
    border: 1px solid #acd8c7;
    border-radius: 8px;
    background: rgba(232, 248, 240, 0.92);
    box-shadow: var(--shadow-sm);
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(260px, 0.62fr) minmax(260px, 0.62fr);
    gap: 18px;
    max-width: 1180px;
    margin: 46px auto;
    padding: 0 18px;
}

.intro,
.auth-card,
.lesson,
.admin-panel,
.progress,
.mini-card,
.next-card,
.dashboard-grid div,
nav a,
.checkpoint,
.quiz-box,
.project-box,
.feature-grid div {
    border: 1px solid rgba(220, 229, 225, 0.86);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.intro {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 5vw, 68px);
}

.intro::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: 26px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(15, 138, 112, 0.22);
    border-radius: 50%;
    background: repeating-linear-gradient(135deg, rgba(15, 138, 112, 0.08) 0 8px, transparent 8px 16px);
}

.intro > * {
    position: relative;
    z-index: 1;
}

.intro h2 {
    margin: 10px 0 16px;
    max-width: 790px;
    font-size: clamp(38px, 5vw, 68px);
    line-height: 0.98;
    letter-spacing: 0;
}

.intro p:last-of-type {
    max-width: 670px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.auth-card {
    align-self: start;
    padding: 24px;
}

.auth-card h2 {
    margin: 0 0 6px;
}

.auth-card p {
    margin: 0 0 16px;
    color: var(--muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 30px;
}

.feature-grid div {
    display: grid;
    gap: 4px;
    padding: 16px;
    box-shadow: none;
}

.feature-grid b {
    color: var(--brand-dark);
    font-size: 28px;
}

.feature-grid span,
.mini-card span,
.next-card span,
.dashboard-grid span {
    color: var(--muted);
    font-size: 13px;
}

.stack {
    display: grid;
    gap: 11px;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) minmax(250px, 310px);
    gap: 18px;
    max-width: 1480px;
    margin: 24px auto 40px;
    padding: 0 18px;
}

.sidebar {
    display: grid;
    gap: 14px;
    align-self: start;
    position: sticky;
    top: 84px;
}

.progress {
    padding: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(230, 246, 238, 0.86));
}

.progress strong {
    display: block;
    color: var(--brand-dark);
    font-size: 42px;
    line-height: 1;
}

.progress span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.progress div {
    height: 10px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 88, 70, 0.1);
}

.progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #59b891);
}

.mini-card,
.next-card {
    display: grid;
    gap: 4px;
    padding: 15px 16px;
    color: inherit;
    text-decoration: none;
}

.mini-card b,
.next-card b {
    font-size: 18px;
}

.next-card {
    border-color: rgba(15, 138, 112, 0.28);
    background: linear-gradient(145deg, #effaf5, #ffffff);
}

.next-card:hover,
nav a:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 138, 112, 0.48);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dashboard-grid div {
    display: grid;
    gap: 4px;
    padding: 13px;
}

.dashboard-grid b {
    color: var(--brand-dark);
    font-size: 25px;
}

nav {
    display: grid;
    gap: 8px;
}

nav a {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 2px 10px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

nav a.active {
    border-color: rgba(15, 138, 112, 0.7);
    background: #ffffff;
    box-shadow: inset 4px 0 0 var(--brand), var(--shadow-sm);
}

nav span {
    grid-row: span 2;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    font-size: 12px;
    font-weight: 900;
}

nav small,
.user-row span,
.user-row small {
    color: var(--muted);
}

.lesson {
    min-width: 0;
    padding: clamp(26px, 4vw, 52px);
    box-shadow: var(--shadow);
}

.lesson-head {
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
    padding-bottom: 22px;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.lesson-meta span,
.attempt-line span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--muted);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
}

.lesson h2 {
    margin: 5px 0 10px;
    font-size: clamp(32px, 4vw, 56px);
    line-height: 1.02;
    letter-spacing: 0;
}

.lesson h3 {
    margin: 30px 0 8px;
    font-size: 18px;
}

.lesson p {
    color: var(--muted);
    line-height: 1.68;
}

.checkpoint {
    display: grid;
    gap: 6px;
    margin-bottom: 20px;
    padding: 17px;
    background: linear-gradient(145deg, #effaf5, #ffffff);
}

.checkpoint b,
.quiz-box label,
.notes label {
    color: var(--brand-dark);
    font-weight: 900;
}

pre {
    overflow: auto;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
    color: #dbfff3;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
        var(--code);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

code {
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 14px;
}

.lesson-actions,
.notes {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.quiz-box,
.project-box {
    padding: 18px;
}

.attempt-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-box {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    background: linear-gradient(145deg, #f7fbf8, #ffffff);
}

.project-box h3,
.project-box p {
    margin: 0;
}

.project-box p {
    color: var(--muted);
    line-height: 1.55;
}

.notes {
    display: grid;
    gap: 10px;
}

.admin-panel {
    align-self: start;
    padding: 17px;
    position: sticky;
    top: 84px;
}

.admin-panel h3 {
    margin: 8px 0 10px;
}

.user-row,
.activity-row {
    display: grid;
    gap: 3px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.activity-row b {
    color: var(--brand-dark);
}

.activity-row span,
.activity-row small,
.muted-small {
    color: var(--muted);
    font-size: 13px;
}

.level-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.level-row span {
    color: var(--muted);
}

.user-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .auth-grid,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .admin-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .auth-grid {
        margin-top: 24px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .intro h2,
    .lesson h2 {
        font-size: 34px;
    }

    .feature-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .lesson,
    .intro,
    .auth-card {
        padding: 22px;
    }
}
