:root {
    --bg: #f5f3ee;
    --surface: #ffffff;
    --surface-soft: #faf9f6;
    --navy: #16263c;
    --navy-soft: #263a54;
    --burgundy: #7b3340;
    --text: #202632;
    --muted: #6b7280;
    --border: #dedbd4;
    --success: #2f6b4f;
    --warning: #8a6426;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(22, 38, 60, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    background: var(--navy);
    color: white;
    min-height: 68px;
    display: flex;
    align-items: center;
}

.topbar-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: .94rem;
}

.topbar-nav a {
    color: rgba(255,255,255,.84);
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.eyebrow {
    color: var(--burgundy);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .76rem;
    font-weight: 700;
}

h1,
h2,
h3 {
    color: var(--navy);
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
}

h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

h2 {
    font-size: 1.55rem;
}

.page-intro {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.04rem;
}

.grid {
    display: grid;
    gap: 20px;
}

.course-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: 28px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-top: 0;
}

.card p {
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 17px;
    border: 0;
    border-radius: 9px;
    background: var(--navy);
    color: white;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--navy-soft);
}

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--border);
}

.progress {
    height: 7px;
    overflow: hidden;
    background: #ebe8e1;
    border-radius: 99px;
    margin: 18px 0 8px;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--burgundy);
}

.lesson-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.lesson-item {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: 16px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
}

.lesson-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-soft);
    font-size: 1.2rem;
}

.lesson-title {
    margin: 0 0 3px;
    font-weight: 700;
    color: var(--navy);
}

.lesson-meta {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 99px;
    padding: 4px 9px;
    font-size: .75rem;
    font-weight: 700;
}

.badge-required {
    background: #f6ecee;
    color: var(--burgundy);
}

.badge-recommended {
    background: #f4eee1;
    color: var(--warning);
}

.badge-optional {
    background: #e9f2ed;
    color: var(--success);
}

.back-link {
    display: inline-block;
    margin-bottom: 26px;
    color: var(--muted);
    text-decoration: none;
}

@media (max-width: 700px) {
    .topbar-inner,
    .container {
        width: min(100% - 24px, 1180px);
    }

    .topbar-nav {
        gap: 12px;
        font-size: .84rem;
    }

    .container {
        padding-top: 30px;
    }

    .lesson-item {
        grid-template-columns: 42px 1fr;
    }

    .lesson-item .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

.login-section {
    max-width: 620px;
    margin: 0 auto;
}

.login-card {
    margin-top: 28px;
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    font-weight: 650;
    color: var(--navy);
}

.form-field input {
    width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: inherit;
    font: inherit;
}

.form-field input:focus {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.form-error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--burgundy);
}

.topbar-user {
    color: rgba(255,255,255,.72);
}

.topbar-logout {
    margin: 0;
}

.topbar-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.84);
    font: inherit;
    cursor: pointer;
}

.topbar-link-button:hover {
    color: white;
}
