:root {
    --bg: #0b1020;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-solid: #12172a;
    --border: rgba(255, 255, 255, 0.12);
    --text: #eef1f9;
    --muted: #9aa3bd;
    --brand: #6c8cff;
    --brand-2: #b06cff;
    --accent: #38e0c8;
    --danger: #ff6b81;
    --radius: 18px;
    --shadow: 0 30px 80px rgba(4, 8, 24, 0.55);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    overflow-x: hidden;
    position: relative;
    overflow-wrap: break-word;
}

/* ── Фон с анимированными «кляксами» ───────────────────────────── */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: float 18s ease-in-out infinite;
}

.blob--1 {
    width: 480px;
    height: 480px;
    background: var(--brand);
    top: -120px;
    left: -80px;
}

.blob--2 {
    width: 420px;
    height: 420px;
    background: var(--brand-2);
    bottom: -140px;
    right: -60px;
    animation-delay: -6s;
}

.blob--3 {
    width: 360px;
    height: 360px;
    background: var(--accent);
    top: 40%;
    left: 45%;
    animation-delay: -11s;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -30px) scale(1.12);
    }
}

/* ── Каркас ────────────────────────────────────────────────────── */
.shell {
    width: min(1040px, 100%);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow: var(--shadow);
}

/* ── Левая колонка ─────────────────────────────────────────────── */
.hero {
    min-width: 0;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: linear-gradient(
        160deg,
        rgba(108, 140, 255, 0.16),
        rgba(176, 108, 255, 0.05)
    );
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 8px 22px rgba(108, 140, 255, 0.45);
}

.brand__mark svg {
    width: 24px;
    height: 24px;
}

.brand__name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero__title {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero__lead {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    max-width: 42ch;
}

.features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: auto;
}

.features__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.features__icon {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.features__item strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.features__item span {
    display: block;
    color: var(--muted);
    font-size: 13.5px;
}

/* ── Правая колонка (форма) ────────────────────────────────────── */
.auth {
    min-width: 0;
    padding: 48px 44px;
    display: grid;
    place-items: center;
    background: rgba(9, 12, 24, 0.35);
}

.auth__card {
    width: 100%;
    max-width: 360px;
}

.auth__head h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth__head p {
    color: var(--muted);
    font-size: 14.5px;
    margin-top: 6px;
}

.form {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.field__wrap {
    position: relative;
}

.field__input {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field__wrap .field__input {
    padding-right: 48px;
}

.field__input::placeholder {
    color: rgba(154, 163, 189, 0.55);
}

.field__input:focus {
    border-color: var(--brand);
    background: rgba(108, 140, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(108, 140, 255, 0.18);
}

.field__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 8px;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.field__toggle:hover,
.field__toggle.is-active {
    opacity: 1;
}

.form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13.5px;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.link:hover {
    color: #9db3ff;
}

/* ── Кнопка ────────────────────────────────────────────────────── */
.btn {
    position: relative;
    margin-top: 4px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 28px rgba(108, 140, 255, 0.4);
    transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(108, 140, 255, 0.5);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.btn__spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__text {
    visibility: hidden;
}

.btn.is-loading .btn__spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form__note {
    font-size: 13.5px;
    min-height: 18px;
    text-align: center;
    color: var(--muted);
}

.form__note.is-error {
    color: var(--danger);
}

/* ── Разделитель и соцкнопки ───────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

.social__btn {
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.social__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

.auth__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.hero__tag {
    display: inline-block;
    align-self: flex-start;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: rgba(56, 224, 200, 0.1);
    border: 1px solid rgba(56, 224, 200, 0.28);
    border-radius: 999px;
}

.hero__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.hero__link {
    align-self: flex-start;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: color 0.15s, transform 0.15s;
}

.hero__link:hover {
    color: #9db3ff;
    transform: translateX(2px);
}

/* ── Навигация в верхней панели ────────────────────────────────── */
.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topnav__link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
}

.topnav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.topnav__link.is-active {
    color: var(--text);
    background: rgba(108, 140, 255, 0.16);
}

/* ── Страница «Об ОС» ──────────────────────────────────────────── */
.page {
    display: block;
    place-items: unset;
    padding: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 22px 24px;
}

.topbar .brand {
    text-decoration: none;
    color: var(--text);
}

.btn--ghost {
    padding: 10px 16px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.article {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

.article__head {
    max-width: 720px;
    margin-bottom: 40px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: rgba(56, 224, 200, 0.1);
    border: 1px solid rgba(56, 224, 200, 0.28);
    border-radius: 999px;
    margin-bottom: 18px;
}

.article__title {
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.article__lead {
    margin-top: 16px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.os-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
}

.os-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.os-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 20px 50px rgba(4, 8, 24, 0.45);
}

.os-card__top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.os-card__logo {
    flex: none;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 26px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.os-card__top h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.os-card__vendor {
    font-size: 12.5px;
    color: var(--muted);
}

.os-card p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
}

.os-card__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.os-card__list li {
    position: relative;
    padding-left: 22px;
    font-size: 13.5px;
    color: var(--text);
}

.os-card__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 700;
}

.article__cta {
    margin-top: 44px;
    padding: 34px;
    text-align: center;
    background: linear-gradient(
        135deg,
        rgba(108, 140, 255, 0.14),
        rgba(176, 108, 255, 0.08)
    );
    border: 1px solid var(--border);
    border-radius: 20px;
}

.article__cta p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.article__cta .btn {
    display: inline-block;
    text-decoration: none;
    padding: 13px 30px;
}

.footer {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    border-top: 1px solid var(--border);
}

/* ── Адаптив ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding: 30px 24px 26px;
        gap: 18px;
    }

    .hero__lead {
        font-size: 15px;
        max-width: none;
    }

    .features {
        gap: 14px;
        margin-top: 4px;
    }

    .auth {
        padding: 30px 24px 36px;
    }

    .topbar {
        padding: 18px 20px;
    }

    .article {
        padding: 16px 20px 48px;
    }

    .article__head {
        margin-bottom: 28px;
    }

    .article__lead {
        font-size: 16px;
    }

    .article__cta {
        margin-top: 32px;
        padding: 26px 20px;
    }
}

@media (max-width: 560px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .topnav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* 16px — иначе Safari на iOS зумит страницу при фокусе в поле */
    .field__input {
        font-size: 16px;
    }

    .os-grid {
        gap: 16px;
    }

    .os-card {
        padding: 22px 20px;
    }

    .blob {
        filter: blur(70px);
        opacity: 0.45;
    }

    .blob--1 {
        width: 300px;
        height: 300px;
    }

    .blob--2 {
        width: 280px;
        height: 280px;
    }

    .blob--3 {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 14px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }

    .shell {
        border-radius: 22px;
    }

    .hero {
        padding: 24px 18px 22px;
    }

    .auth {
        padding: 26px 18px 32px;
    }

    .topbar {
        padding: 16px 16px;
    }

    .article {
        padding: 12px 16px 40px;
    }

    .os-card {
        padding: 20px 16px;
    }

    .article__cta {
        padding: 24px 16px;
    }
}

/* Экономим батарею и убираем анимацию для тех, кто её отключил */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
