body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #163041;
    background: #f5f8fb;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

:root {
    --brand: #00bbec;
    --brand-dark: #0095bb;
    --accent: #ffef55;
    --text: #163041;
    --muted: #61788a;
    --line: #d8e4ec;
    --surface: #ffffff;
    --surface-alt: #eef7fb;
    --surface-dark: #092531;
    --shadow: 0 18px 48px rgba(12, 49, 69, 0.08);
    --radius: 24px;
    --max: 1180px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(245, 248, 251, 0.82);
    border-bottom: 1px solid rgba(216, 228, 236, 0.8);
}

.site-header__inner,
.footer__top,
.admin-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-header__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.site-header__inner {
    min-height: 78px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
}

.nav a:hover,
.nav a.is-active {
    color: var(--text);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(216, 228, 236, 0.95);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(12, 49, 69, 0.08);
}

.language-switcher__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.language-switcher__button:hover {
    color: var(--text);
    background: rgba(0, 187, 236, 0.08);
}

.language-switcher__button.is-active {
    background: linear-gradient(135deg, var(--brand) 0%, #38d6ff 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 149, 187, 0.22);
}

.language-switcher__short {
    display: none;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.language-switcher__label {
    display: inline;
    font-size: 14px;
}

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

.hero-card,
.panel,
.card,
.placeholder,
.faq-item,
.lesson-card,
.stat-card,
.table-card,
.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 36px;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 28px;
    align-items: stretch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 14px;
}

.hero h1,
.page-hero h1,
.login-card h1 {
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 1.08;
    margin: 18px 0;
    letter-spacing: -0.03em;
}

.lead,
.page-hero p,
.card p,
.placeholder p,
.faq-item p,
.lesson-card p,
.stat-card p,
.table-card p,
.login-card p {
    color: var(--muted);
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.btn:hover {
    background: var(--brand-dark);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.btn--ghost:hover {
    background: var(--surface-alt);
}

.hero-side {
    background: linear-gradient(180deg, #0c3345 0%, #163f54 100%);
    color: #fff;
    border-radius: 22px;
    padding: 28px;
    display: grid;
    gap: 16px;
}

.hero-side ul,
.card ul,
.placeholder ul,
.admin-menu,
.check-list,
.quick-links {
    margin: 0;
    padding-left: 18px;
}

.quick-links {
    display: grid;
    gap: 10px;
}

.section {
    padding: 28px 0 18px;
}

.section h2,
.admin-main h2,
.admin-main h3 {
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    line-height: 1.15;
    margin: 0 0 12px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

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

.grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.placeholder,
.faq-item,
.lesson-card,
.stat-card,
.table-card {
    padding: 24px;
}

.card h3,
.lesson-card h3,
.stat-card h3,
.table-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card ul,
.placeholder ul,
.faq-list {
    display: grid;
    gap: 10px;
}

.badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 700;
}

.qr-grid,
.footer-grid,
.stats-grid,
.admin-grid {
    display: grid;
    gap: 18px;
}

.qr-grid,
.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-card {
    text-align: center;
}

.qr-card img {
    width: min(220px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 16px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    border: 1px dashed var(--line);
    padding: 14px;
}

.placeholder-image {
    display: grid;
    place-items: center;
    min-height: 160px;
    border-radius: 20px;
    border: 1px dashed var(--line);
    background: linear-gradient(180deg, #f7fbfd 0%, #eef7fb 100%);
    color: var(--muted);
    font-weight: 700;
}

.legal-shell {
    display: grid;
    gap: 18px;
}

.legal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.lang-switcher {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lang-switcher button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.lang-switcher button.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.legal-frame {
    width: 100%;
    min-height: 1300px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.legal-content-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfeff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.legal-note-card {
    background: linear-gradient(180deg, #f7fcff 0%, #eef8fd 100%);
}

.legal-content-loading,
.legal-content-error {
    color: var(--muted);
}

.legal-content-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.legal-content-error {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #fffaf2;
}

.legal-content-error h3 {
    margin-top: 0;
    color: var(--text);
}

.legal-document-body {
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
}

.legal-document-body > :first-child {
    margin-top: 0 !important;
}

.legal-document-body h1,
.legal-document-body h2,
.legal-document-body h3,
.legal-document-body h4 {
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.legal-document-body h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.legal-document-body h2 {
    font-size: 1.5rem;
    margin: 32px 0 14px;
}

.legal-document-body h3 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
    color: var(--brand-dark);
}

.legal-document-body p,
.legal-document-body li {
    color: var(--text);
}

.legal-document-body p {
    margin: 12px 0;
}

.legal-document-body ul,
.legal-document-body ol {
    padding-left: 22px;
}

.legal-document-body strong {
    color: var(--text);
}

.legal-document-body a {
    color: var(--brand-dark);
}

.legal-document-body .footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.site-footer {
    margin-top: 48px;
    padding: 36px 0 48px;
    background: var(--surface-dark);
    color: #fff;
}

.footer-grid {
    grid-template-columns: 1.2fr 0.8fr 0.8fr;
    margin-top: 24px;
}

.footer-grid a,
.site-footer p,
.site-footer li {
    color: rgba(255, 255, 255, 0.78);
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.footer-bottom {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.58);
    font-size: 14px;
}

.page-hero {
    padding: 56px 0 18px;
}

.anchor-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.anchor-nav a {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 600;
}

.lesson-meta,
.muted {
    color: var(--muted);
    font-size: 14px;
}

.admin-page {
    background: #f3f8fb;
}

.admin-shell {
    align-items: start;
    padding: 28px 0 48px;
}

.admin-sidebar {
    width: 280px;
    position: sticky;
    top: 94px;
}

.admin-sidebar .panel,
.admin-main .panel {
    padding: 22px;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 18px;
}

.admin-menu {
    display: grid;
    gap: 10px;
}

.admin-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

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

.table th,
.table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table th {
    font-size: 14px;
    color: var(--muted);
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status--on {
    background: #e8f9ef;
    color: #147443;
}

.status--off {
    background: #fff2e8;
    color: #af5f16;
}

.login-wrap {
    min-height: calc(100vh - 78px);
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.login-card {
    max-width: 520px;
    padding: 34px;
}

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

.input,
.textarea,
.select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
    background: #fff;
}

.note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff8d8;
    color: #735d00;
}

@media (max-width: 980px) {
    .hero-card,
    .grid--3,
    .grid--2,
    .footer-grid,
    .qr-grid,
    .stats-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 720px) {
    .site-header__inner,
    .footer__top {
        flex-direction: column;
        align-items: start;
        padding: 14px 0;
    }

    .site-header__controls {
        width: 100%;
        align-items: stretch;
    }

    .nav {
        width: 100%;
    }

    .language-switcher {
        width: 100%;
        justify-content: space-between;
    }

    .language-switcher__button {
        flex: 1;
        justify-content: center;
        padding: 0 10px;
    }

    .language-switcher__short {
        display: inline;
    }

    .language-switcher__label {
        display: none;
        font-size: 13px;
    }

    .hero-card,
    .login-card,
    .card,
    .placeholder,
    .faq-item,
    .lesson-card,
    .stat-card,
    .table-card,
    .panel {
        padding: 20px;
    }

    .container {
        width: min(var(--max), calc(100% - 24px));
    }
}
