:root {
    --color-bg: #ffffff;
    --color-surface: #f0f0d8;
    --color-primary: #607848;
    --color-primary-2: #789048;
    --color-accent: #c0d860;
    --color-ink: #604848;
    --color-line: #d9ddc1;
    --color-success: #4f7a37;
    --color-danger: #b44a4a;
    --shadow-soft: 0 20px 50px rgba(96, 120, 72, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--color-ink);
    background:
        radial-gradient(circle at top left, rgba(192, 216, 96, 0.2), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fbfbf2 100%);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4vw;
    border-bottom: 1px solid var(--color-line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 900;
    font-size: 1.4rem;
}

.brand-mark {
    color: var(--color-primary);
}

.brand-text {
    color: var(--color-ink);
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page {
    width: min(1180px, 92vw);
    margin: 2rem auto 4rem;
}

.hero,
.grid-2,
.grid-3,
.section-head,
.trail-card,
.list-row,
.actions {
    display: flex;
    gap: 1.25rem;
}

.hero {
    align-items: stretch;
    margin-bottom: 2rem;
}

.hero > * {
    flex: 1;
}

.hero-card,
.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--color-line);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.hero h1,
.spotlight h1,
.section-head h1 {
    font-size: clamp(2rem, 4vw, 3.3rem);
    margin: 0.4rem 0 1rem;
    line-height: 1.05;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--color-primary);
    font-weight: 700;
}

.lead {
    font-size: 1.08rem;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
    color: white;
    padding: 0.9rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
}

.button-secondary {
    background: white;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.button-small {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.auth-shell {
    display: flex;
    justify-content: center;
}

.auth-shell.wide .form-card {
    width: min(860px, 100%);
}

.form-card {
    width: min(480px, 100%);
}

.form-card label,
.stack,
.list,
.lesson-card {
    display: grid;
    gap: 1rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.9rem 1rem;
    margin-top: 0.45rem;
    border-radius: 14px;
    border: 1px solid var(--color-line);
    font: inherit;
    background: #fff;
}

.section-head {
    justify-content: space-between;
    align-items: end;
    margin-bottom: 1.5rem;
}

.grid-3 > *,
.grid-2 > * {
    flex: 1;
}

.stat-card strong {
    display: block;
    font-size: 2.1rem;
    margin: 0.5rem 0;
}

.muted {
    color: #7e7064;
}

.pill {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.pill-completed {
    background: #e4f4d6;
}

.pill-available {
    background: #fff3ce;
}

.pill-locked {
    background: #efefef;
}

.trail-card,
.list-row {
    justify-content: space-between;
    align-items: center;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: #fafaf4;
}

.option input {
    width: auto;
    margin: 0;
}

.alert {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    font-weight: 700;
}

.alert-success {
    background: #e5f3dc;
    color: var(--color-success);
}

.alert-error {
    background: #f7dddd;
    color: var(--color-danger);
}

.content-block {
    line-height: 1.7;
}

.highlight-box {
    background: #edf3d3;
    border-radius: 18px;
    padding: 1rem;
}

.highlight-box.neutral {
    background: #f7f6eb;
}

.spotlight {
    background: linear-gradient(145deg, rgba(192, 216, 96, 0.3), rgba(240, 240, 216, 0.8));
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
}

@media (max-width: 860px) {
    .hero,
    .grid-2,
    .grid-3,
    .section-head,
    .trail-card,
    .list-row,
    .actions,
    .topbar,
    .nav {
        flex-direction: column;
        align-items: stretch;
    }

    .page {
        width: min(94vw, 100%);
    }
}
