@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");

:root {
    --background: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #f1f4f8;
    --text: #1f2937;
    --heading: #111827;
    --muted: #667085;
    --border: #e4e7ec;
    --accent: #1877f2;
    --accent-soft: #eaf3ff;
    --radius: 16px;
    --container: 1080px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .04);
    --shadow-md: 0 16px 40px rgba(16, 24, 40, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: "Google Sans", Arial, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(24, 119, 242, .28);
    outline-offset: 2px;
}

button,
input {
    font: inherit;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-name,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.logout-button {
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: none;
    cursor: pointer;
}

.admin-link {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.admin-link:hover,
.logout-button:hover {
    color: var(--heading);
    background: var(--surface-soft);
}

.hero {
    padding: 64px 0 58px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 82% 20%, rgba(24, 119, 242, .08), transparent 28%),
        var(--surface);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 72px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hero h1,
.lesson-header h1,
.error-page h1 {
    margin: 0;
    color: var(--heading);
    font-size: clamp(38px, 5vw, 54px);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.hero-summary > p {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.stats {
    display: flex;
    margin: 0;
    gap: 12px;
}

.stats div {
    min-width: 112px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
}

.stats dt {
    color: var(--heading);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
}

.stats dd {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.modules-section {
    display: grid;
    padding: 48px 0 80px;
    gap: 24px;
}

.module-card,
.materials-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.lesson-materials {
    margin-top: 40px;
}

.materials-heading {
    margin-bottom: 18px;
}

.materials-heading h2 {
    margin: 0;
    color: var(--heading);
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -.015em;
}

.materials-frame {
    display: block;
    width: 100%;
    min-height: 140px;
    max-height: 600px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.materials-empty {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface);
    font-size: 13px;
}

.module-heading {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    padding: 28px 30px 24px;
    gap: 18px;
    align-items: start;
}

.module-number,
.lesson-count,
.lesson-index,
.duration,
.lesson-duration {
    color: var(--muted);
    font-size: 12px;
}

.module-number {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

.module-heading h2,
.materials-card h2 {
    margin: 0;
    color: var(--heading);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.35;
}

.module-heading p,
.materials-card p:last-child {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.lesson-count {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.lesson-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);
    list-style: none;
}

.lesson-list li + li {
    border-top: 1px solid var(--border);
}

.lesson-row {
    display: grid;
    min-height: 82px;
    padding: 17px 30px;
    grid-template-columns: 44px 1fr auto 32px;
    gap: 18px;
    align-items: center;
    text-decoration: none;
}

.lesson-row:hover {
    background: #fafbff;
}

.lesson-copy {
    display: grid;
    gap: 5px;
}

.lesson-copy strong {
    color: var(--heading);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.lesson-copy small {
    color: var(--muted);
    font-size: 13px;
}

.arrow {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 16px;
    transition: transform .18s ease, color .18s ease, background .18s ease;
}

.lesson-row:hover .arrow {
    transform: translateX(3px);
    color: #fff;
    background: var(--accent);
}

.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.login-page {
    display: grid;
    min-height: calc(100vh - 65px);
    place-items: center;
    padding: 32px 16px;
}

.login-panel {
    width: min(100%, 400px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.login-brand {
    margin-bottom: 48px;
}

.login-copy {
    margin-bottom: 28px;
}

.login-copy h1 {
    margin: 0 0 8px;
    font-size: 34px;
}

.login-copy p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

.login-form label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}

.login-form input {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
}

.login-form input:focus {
    border-color: #777;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 7px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.primary-button {
    margin-top: 16px;
}

.alert {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid #e5bdb7;
    border-radius: 7px;
    color: #8a3025;
    background: #fff3f1;
    font-size: 13px;
}

.login-aside {
    display: none;
}

.lesson-page {
    padding: 34px 0 80px;
}

.breadcrumbs {
    display: flex;
    margin-bottom: 52px;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumbs a {
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.back-to-lessons {
    color: var(--heading);
    font-weight: 500;
}

.lesson-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.lesson-intro {
    margin-bottom: 36px;
}

.lesson-header > div {
    max-width: 820px;
}

.lesson-header h1 {
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1.2;
}

.lesson-lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.lesson-duration {
    margin-bottom: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    white-space: nowrap;
}

.video-shell {
    overflow: hidden;
    width: 100%;
    border-radius: 18px;
    aspect-ratio: 16 / 9;
    background: #111;
    box-shadow: var(--shadow-md);
}

.video-shell video {
    display: block;
    width: 100%;
    height: 100%;
}

.video-error {
    display: grid;
    height: 100%;
    place-items: center;
    color: #bbb;
}

.materials-card {
    display: grid;
    margin-top: 20px;
    padding: 24px;
    grid-template-columns: 40px 1fr auto;
    gap: 16px;
    align-items: center;
}

.materials-icon {
    font-size: 20px;
}

.materials-card .eyebrow {
    margin-bottom: 5px;
}

.secondary-button {
    font-size: 13px;
}

.lesson-navigation {
    display: grid;
    margin-top: 44px;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lesson-navigation a {
    display: grid;
    min-height: 92px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    align-content: center;
    gap: 6px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease;
}

.lesson-navigation a:hover {
    transform: translateY(-2px);
    border-color: #c7d2fe;
}

.lesson-navigation a span {
    color: var(--muted);
    font-size: 12px;
}

.lesson-navigation a strong {
    color: var(--heading);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.next-lesson {
    text-align: right;
}

.empty-state,
.error-page {
    padding: 80px 0;
}

.text-link {
    display: inline-block;
    margin-top: 24px;
    text-decoration: none;
}

.admin-page {
    padding: 42px 0 72px;
}

.admin-heading {
    display: flex;
    margin-bottom: 32px;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.admin-heading h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 500;
    letter-spacing: -.04em;
}

.admin-heading .text-link {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    gap: 24px;
}

.admin-tabs a {
    padding: 12px 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.admin-tabs a.active {
    border-color: var(--text);
    color: var(--text);
    font-weight: 600;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

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

.list-card {
    padding-bottom: 8px;
}

.card-title {
    display: flex;
    margin-bottom: 22px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title h2 {
    margin: 0;
    font-size: 18px;
}

.card-title a,
.card-title span {
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.admin-form {
    display: grid;
    gap: 15px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-size: 14px;
}

.admin-form textarea {
    resize: vertical;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: #777;
}

.admin-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 400;
}

.admin-form .checkbox-label input {
    width: 16px;
    min-height: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-form .primary-button {
    margin-top: 5px;
}

.form-actions {
    display: flex;
    margin-top: 5px;
    align-items: center;
    gap: 10px;
}

.form-actions .primary-button {
    margin-top: 0;
}

.danger-button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #f1b7b7;
    border-radius: 7px;
    color: #b42318;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.danger-button:hover {
    border-color: #d92d20;
    background: #fff4f3;
}

.admin-list {
    display: grid;
}

.admin-list > a {
    display: flex;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    text-decoration: none;
}

.admin-list > a:first-child {
    border-top: 0;
}

.admin-list > a > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.admin-list strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-list small {
    color: var(--muted);
    font-size: 12px;
}

.admin-list em {
    flex: none;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-style: normal;
}

.status-on {
    color: #27633a;
    background: #e8f5eb;
}

.status-off {
    color: #777;
    background: #eeeeec;
}

.success-message {
    margin-bottom: 20px;
    padding: 11px 13px;
    border: 1px solid #b9dbc2;
    border-radius: 7px;
    color: #27633a;
    background: #edf8ef;
    font-size: 13px;
}

@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-summary {
        max-width: 620px;
    }
}

@media (max-width: 680px) {
    .user-name,
    .lesson-copy small,
    .duration {
        display: none;
    }

    .header-actions {
        gap: 4px;
    }

    .hero {
        padding: 44px 0 40px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .lesson-header h1 {
        font-size: 28px;
    }

    .hero-summary > p {
        font-size: 15px;
    }

    .stats {
        gap: 8px;
    }

    .stats div {
        min-width: 100px;
        padding: 11px 13px;
    }

    .module-heading {
        grid-template-columns: 36px 1fr;
        padding: 20px;
        gap: 12px;
    }

    .module-number {
        width: 32px;
        height: 32px;
    }

    .module-heading h2 {
        font-size: 18px;
    }

    .lesson-count {
        display: none;
    }

    .lesson-row {
        min-height: 74px;
        padding: 14px 18px;
        grid-template-columns: 30px 1fr 30px;
        gap: 12px;
    }

    .lesson-index {
        font-size: 11px;
    }

    .lesson-copy strong {
        font-size: 15px;
    }

    .lesson-header {
        display: block;
    }

    .lesson-duration {
        display: inline-block;
        margin-top: 14px;
    }

    .lesson-page {
        padding-top: 24px;
    }

    .breadcrumbs {
        margin-bottom: 34px;
    }

    .lesson-lead {
        margin-top: 14px;
        font-size: 15px;
    }

    .video-shell {
        margin-inline: -16px;
        width: calc(100% + 32px);
        border-radius: 0;
        box-shadow: none;
    }

    .lesson-materials {
        margin-top: 32px;
    }

    .lesson-navigation {
        grid-template-columns: 1fr;
    }

    .lesson-navigation > span {
        display: none;
    }

    .next-lesson {
        text-align: left;
    }

    .materials-card {
        grid-template-columns: 30px 1fr;
        padding: 20px;
    }

    .materials-card .secondary-button,
    .materials-card .muted {
        grid-column: 1 / -1;
    }

    .admin-heading {
        display: block;
    }

    .admin-heading .text-link {
        margin-top: 14px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-tabs {
        overflow-x: auto;
    }
}
