:root {
    color-scheme: light;
    --bg: #edf4f1;
    --surface: #fbfdfc;
    --surface-soft: #e2eeea;
    --text: #102033;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #ccfbf1;
    --blue: #1d4ed8;
    --border: #ccdcd7;
    --shadow: 0 24px 80px rgba(15, 74, 66, 0.12);
    --radius: 24px;
}

:root[data-cyber-theme="dark"] {
    color-scheme: dark;
    --bg: #07111f;
    --surface: #0f1d2d;
    --surface-soft: #14263a;
    --text: #f8fafc;
    --muted: #b6c5d8;
    --primary: #2dd4bf;
    --primary-dark: #14b8a6;
    --primary-soft: #103f3b;
    --blue: #60a5fa;
    --border: #26384f;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    backdrop-filter: blur(16px);
    transition: background .2s ease, box-shadow .2s ease;
}

.site-header.is-scrolled {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

.nav {
    position: relative;
    width: min(1280px, calc(100% - 32px));
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    box-shadow: 0 12px 32px rgba(15, 118, 110, 0.24);
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 12px 26px rgba(15, 118, 110, 0.22));
}

.brand-text {
    display: grid;
    line-height: 1.05;
}

.nav-menu {
    flex: 1;
    min-width: 0;
}

.nav-menu-toggle {
    display: none;
}

.nav-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(16px, 2vw, 30px);
}

.brand-text small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(12px, 1.4vw, 21px);
    color: var(--muted);
    font-size: 0.87rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-links a {
    position: relative;
    padding: 10px 0;
    transition: color .18s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .18s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-login {
    padding: 9px 5px;
    color: var(--text);
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.nav-login:hover,
.nav-login:focus-visible {
    color: var(--primary);
}

.site-header .btn {
    width: auto;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.site-header .workspace-return::before {
    content: "\2190";
    margin-right: 7px;
}

.theme-toggle {
    display: inline-grid;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    font: inherit;
    cursor: pointer;
    transition:
        background .18s ease,
        transform .18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: translateY(-1px);
    background: var(--surface-soft);
}

.theme-toggle:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
    outline-offset: 2px;
}

.theme-toggle-visual {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--primary);
    background: transparent;
}

.theme-toggle-visual svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-icon-moon {
    display: none;
}

:root[data-cyber-theme="dark"] .theme-toggle {
    background: transparent;
}

:root[data-cyber-theme="dark"] .theme-toggle:hover,
:root[data-cyber-theme="dark"] .theme-toggle:focus-visible {
    background: var(--surface-soft);
}

:root[data-cyber-theme="dark"] .theme-icon-sun {
    display: none;
}

:root[data-cyber-theme="dark"] .theme-icon-moon {
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.24);
}

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

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.btn-large {
    min-height: 52px;
    padding-inline: 24px;
}

.site-footer {
    margin-top: 64px;
    padding: 58px 0 24px;
    color: var(--muted);
    background:
        radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 28%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--bg) 88%, var(--surface))),
        var(--bg);
    border-top: 1px solid var(--border);
}

.footer-shell {
    display: grid;
    grid-template-columns: minmax(230px, .85fr) minmax(0, 1.65fr);
    align-items: start;
    gap: clamp(48px, 8vw, 110px);
}

.footer-main {
    display: grid;
    align-content: start;
    gap: 18px;
    min-width: 0;
}

.brand-footer {
    flex: 0 0 auto;
    gap: 11px;
}

.brand-footer .brand-logo {
    width: 42px;
    height: 42px;
}

.brand-footer .brand-text strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
}

.brand-footer .brand-text small,
.footer-text {
    color: var(--muted);
}

.footer-text {
    margin: 0;
    max-width: 340px;
    font-size: .86rem;
    line-height: 1.7;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 54px);
}

.footer-link-group {
    display: grid;
    align-content: start;
    gap: 10px;
    font-size: .8rem;
}

.footer-link-group > strong {
    margin-bottom: 4px;
    color: var(--text);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.footer-link-group a {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding-block: 4px;
    width: fit-content;
    max-width: 100%;
    color: var(--muted);
    line-height: 1.4;
    transition: color .18s ease, transform .18s ease;
}

.footer-link-group a:hover,
.footer-link-group a:focus-visible {
    color: var(--primary);
    transform: translateX(3px);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    font-size: .7rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-weight: 700;
}

.footer-bottom-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding-block: 4px;
}

.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
    color: var(--primary-dark);
}

@media (max-width: 680px) {
    .footer-link-group a,
    .footer-bottom-links a {
        min-height: 44px;
        padding-block: 8px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

:root[data-cyber-theme="dark"] .site-footer {
    background:
        linear-gradient(180deg, rgba(9, 21, 35, .92), rgba(6, 15, 26, .98)),
        #06101b;
    border-top-color: #26384f;
}

:root[data-cyber-theme="dark"] .brand-footer .brand-text strong,
:root[data-cyber-theme="dark"] .footer-link-group > strong {
    color: #f8fafc;
}

.auth-section {
    min-height: calc(100vh - 76px);
    display: grid;
    place-items: center;
    padding: 56px 0;
    background:
        radial-gradient(circle at 75% 20%, rgba(45, 212, 191, 0.16), transparent 30%),
        var(--bg);
}

.auth-card {
    width: min(560px, calc(100% - 32px));
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

:root[data-cyber-theme="dark"] .brand-logo {
    filter: drop-shadow(0 12px 28px rgba(45, 212, 191, 0.24));
}

:root[data-cyber-theme="dark"] input,
:root[data-cyber-theme="dark"] select,
:root[data-cyber-theme="dark"] textarea {
    color: var(--text);
    background: #0b1726;
    border-color: var(--border);
}

:root[data-cyber-theme="dark"] input::placeholder,
:root[data-cyber-theme="dark"] textarea::placeholder {
    color: #8798ad;
}

.auth-kicker {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin: 0;
    line-height: 1;
    letter-spacing: -0.04em;
    font-size: clamp(2rem, 6vw, 3rem);
}

.auth-intro {
    margin: 14px 0 26px;
    color: var(--muted);
}

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

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

.form-field label {
    color: var(--text);
    font-weight: 800;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
}

.form-field input:focus,
.form-field select:focus {
    outline: 3px solid rgba(15, 118, 110, 0.16);
    border-color: var(--primary);
}

.form-field small {
    color: var(--muted);
}

.field-error,
.form-errors {
    color: #b91c1c;
}

.form-errors {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fee2e2;
}

@media (min-width: 1081px) and (max-width: 1240px) {
    .nav {
        gap: 16px;
    }

    .brand-text small {
        display: none;
    }

    .nav-panel {
        gap: 14px;
    }

    .nav-links {
        gap: 10px;
        font-size: .79rem;
    }

    .nav-login,
    .site-header .btn {
        font-size: .76rem;
    }

    .site-header .btn {
        padding-inline: 12px;
    }
}

@media (min-width: 981px) {
    .site-header .nav-register { display: none; }
}

@media (max-width: 980px) {
    .nav {
        min-height: 70px;
    }

    .nav-menu {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .nav-menu-toggle {
        display: none;
        min-height: 42px;
        align-items: center;
        gap: 10px;
        padding: 0 14px;
        border: 1px solid var(--border);
        border-radius: 13px;
        color: var(--text);
        background: var(--surface);
        font-size: .78rem;
        font-weight: 850;
        cursor: pointer;
        list-style: none;
    }

    :root.has-js .nav-menu-toggle {
        display: inline-flex;
    }

    .nav-menu-toggle i,
    .nav-menu-toggle i::before,
    .nav-menu-toggle i::after {
        display: block;
        width: 17px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: transform .18s ease, opacity .18s ease;
    }

    .nav-menu-toggle i {
        position: relative;
    }

    .nav-menu-toggle i::before,
    .nav-menu-toggle i::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .nav-menu-toggle i::before {
        top: -6px;
    }

    .nav-menu-toggle i::after {
        top: 6px;
    }

    .nav-menu.is-open .nav-menu-toggle i {
        background: transparent;
    }

    .nav-menu.is-open .nav-menu-toggle i::before {
        top: 0;
        transform: rotate(45deg);
    }

    .nav-menu.is-open .nav-menu-toggle i::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .nav-panel {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        display: grid;
        gap: 20px;
        padding: 22px;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: color-mix(in srgb, var(--surface) 96%, transparent);
        box-shadow: var(--shadow);
        backdrop-filter: blur(20px);
    }

    :root.has-js .nav-menu:not(.is-open) > .nav-panel {
        display: none;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px 18px;
        white-space: normal;
    }

    .nav-links a {
        padding: 10px 8px;
        border-radius: 10px;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover,
    .nav-links a:focus-visible {
        background: var(--surface-soft);
    }

    .nav-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 18px;
        border-top: 1px solid var(--border);
    }

    .footer-shell {
        grid-template-columns: 1fr;
        gap: 42px;
    }
}

@media (max-width: 700px) {
    .footer-nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-link-group:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .nav-panel {
        padding: 16px;
    }

    .nav-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .theme-toggle {
        flex: 0 0 42px;
    }

    .nav-login,
    .site-header .btn {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        padding-inline: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        flex: 1 1 116px;
    }

    .btn {
        width: 100%;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 430px) {
    .brand-text small {
        display: none;
    }

    .footer-nav-grid {
        grid-template-columns: 1fr;
    }

    .footer-link-group:last-child {
        grid-column: auto;
    }
}
