:root {
    --bg: #f2f5f9;
    --surface: #ffffff;
    --surface-soft: #eef3f9;
    --border: #d5deea;
    --text: #0f1f33;
    --text-soft: #4c5d73;
    --brand: #1f6fbf;
    --brand-strong: #18589a;
    --brand-soft: #dcecff;
    --danger: #b42318;
    --shadow: 0 16px 36px rgba(18, 42, 74, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 12%, #f7fbff 0, #f2f5f9 38%),
        radial-gradient(circle at 88% 88%, #e9f0fb 0, #f2f5f9 40%),
        var(--bg);
    line-height: 1.45;
}

.layout {
    display: flex;
    min-height: 100vh;
    gap: 24px;
    padding: 24px;
}

.mobile-topbar {
    display: none;
}

.menu-overlay {
    display: none;
}

.sidebar {
    width: 340px;
    padding: 24px;
    background: linear-gradient(160deg, #f9fcff 0%, #eef3f9 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.sidebar h1 {
    margin: 0;
    font-size: 1.52rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.menu-close {
    display: none;
}

.sidebar-subtitle {
    margin: 8px 0 20px;
    color: var(--text-soft);
    font-size: 0.96rem;
}

.group {
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}

.group summary {
    cursor: pointer;
    margin: 0;
    padding: 13px 14px;
    list-style: none;
    font-size: 1rem;
    font-weight: 700;
    color: #102a43;
    background: #f9fbfe;
}

.group summary::-webkit-details-marker {
    display: none;
}

.group summary::before {
    content: "▸ ";
    color: #244a77;
}

.group[open] summary::before {
    content: "▾ ";
}

.video-list {
    list-style: none;
    margin: 0;
    padding: 10px;
}

.video-list li + li {
    margin-top: 8px;
}

.video-link {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    text-decoration: none;
    color: #214568;
    background: var(--surface-soft);
    border: 1px solid transparent;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.video-link:hover {
    background: #e7f0fc;
    border-color: #bfd8f7;
    color: #173859;
}

.video-link.active {
    background: var(--brand-soft);
    border-color: #9ec7f5;
    color: #123456;
    font-weight: 700;
}

.logout {
    display: inline-block;
    margin-top: 14px;
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
}

.logout:hover {
    text-decoration: underline;
}

.content {
    flex: 1;
    min-width: 0;
}

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

.content-kicker {
    margin: 0 0 8px;
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.content h2 {
    margin: 0 0 18px;
    font-size: 1.62rem;
    line-height: 1.2;
}

.video-player {
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 1px solid #c7d5e7;
    border-radius: 12px;
    background: #000;
}

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-card h1 {
    margin: 0;
    font-size: 1.7rem;
}

.auth-subtitle {
    margin: 8px 0 18px;
    color: var(--text-soft);
}

.auth-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f3c2be;
    background: #fff2f1;
    color: #8f2018;
    font-weight: 600;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    font-weight: 700;
    color: #19324f;
}

.auth-form input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font: inherit;
    border: 1px solid #c4d3e6;
    border-radius: 10px;
    background: #fbfdff;
}

.auth-form input:focus {
    outline: none;
    border-color: #74aee8;
    box-shadow: 0 0 0 3px rgba(65, 141, 221, 0.16);
}

.auth-form button {
    margin-top: 4px;
    height: 46px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-strong) 100%);
}

.auth-form button:hover {
    filter: brightness(1.05);
}

.auth-note {
    margin: 16px 0 6px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.auth-imprint {
    margin: 0;
}

.auth-imprint a {
    color: var(--brand-strong);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-imprint a:hover {
    text-decoration: underline;
}

@media (max-width: 980px) {
    body.menu-open {
        overflow: hidden;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
        background: rgba(250, 252, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .menu-toggle {
        height: 40px;
        padding: 0 12px;
        border: 1px solid #bed1e7;
        border-radius: 10px;
        background: #ffffff;
        color: #173859;
        font: inherit;
        font-weight: 700;
    }

    .mobile-title {
        font-size: 1rem;
        font-weight: 700;
        color: #123456;
    }

    .menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 39;
        background: rgba(9, 22, 38, 0.52);
    }

    .layout {
        display: block;
        min-height: auto;
        padding: 12px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 40;
        width: min(84vw, 340px);
        border-radius: 0 16px 16px 0;
        padding: 16px;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid #bed1e7;
        border-radius: 10px;
        background: #fff;
        color: #173859;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }

    .menu-overlay[hidden] {
        display: none;
    }

    .content-card {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .sidebar h1 {
        font-size: 1.3rem;
    }

    .sidebar-subtitle {
        margin-bottom: 14px;
        font-size: 0.9rem;
    }

    .group summary {
        padding: 12px;
        font-size: 0.96rem;
    }

    .video-link {
        padding: 12px;
        font-size: 0.96rem;
    }

    .content h2 {
        margin-bottom: 12px;
        font-size: 1.2rem;
    }

    .video-player {
        border-radius: 10px;
    }

    .auth-shell {
        padding: 14px;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-card h1 {
        font-size: 1.4rem;
    }
}
