@font-face {
    font-family: "Onest";
    src: url("../assets/fonts/onest-cyrillic.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Onest";
    src: url("../assets/fonts/onest-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Geologica";
    src: url("../assets/fonts/geologica-cyrillic.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Geologica";
    src: url("../assets/fonts/geologica-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --login-ink: #413943;
    --login-muted: #746d77;
    --login-line: rgba(74, 61, 77, 0.14);
    --login-canvas: #f3efe9;
    --login-surface: #fffdfa;
    --login-accent: #573c61;
    --login-accent-hover: #432e4b;
    --login-focus: #9e69ae;
    --login-story: #252129;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--login-ink);
    background: var(--login-canvas);
    font-family: "Onest", sans-serif;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
summary,
a {
    -webkit-tap-highlight-color: transparent;
}

:where(button, input, summary, a):focus-visible {
    outline: 2px solid var(--login-focus);
    outline-offset: 3px;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 0.92fr) minmax(540px, 1.08fr);
}

.login-story {
    position: relative;
    min-height: 100vh;
    padding: clamp(34px, 4.2vw, 70px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #f8f4f8;
    background:
        radial-gradient(circle at 12% 12%, rgba(215, 163, 226, 0.2), transparent 25%),
        radial-gradient(circle at 85% 82%, rgba(220, 170, 102, 0.13), transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 48%),
        var(--login-story);
}

.login-story::before {
    content: "";
    position: absolute;
    width: min(42vw, 560px);
    aspect-ratio: 1;
    right: -24%;
    top: 22%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
    box-shadow:
        0 0 0 70px rgba(255, 255, 255, 0.018),
        0 0 0 140px rgba(255, 255, 255, 0.014);
}

.login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 13px;
    align-items: center;
}

.login-brand__mark {
    width: 48px;
    height: 48px;
    padding: 2px;
    overflow: hidden;
    border-radius: 15px;
    background: linear-gradient(145deg, #efb76e, #cf8fdb 48%, #75c9bd);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.login-brand__mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 13px;
}

.login-brand > span:last-child {
    display: grid;
    gap: 2px;
}

.login-brand strong {
    font-family: "Geologica", sans-serif;
    font-size: 19px;
    font-weight: 620;
    letter-spacing: -0.025em;
}

.login-brand small {
    color: rgba(248, 244, 248, 0.58);
    font-size: 10px;
    font-weight: 620;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.login-story__content {
    position: relative;
    z-index: 1;
    max-width: 630px;
    margin: auto 0 52px;
}

.login-kicker {
    margin: 0 0 14px;
    color: #d7a3e2;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-story h1 {
    max-width: 650px;
    margin: 0;
    font-family: "Geologica", sans-serif;
    font-size: clamp(38px, 4.3vw, 66px);
    font-weight: 570;
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.login-story__content > p:last-child {
    max-width: 560px;
    margin: 28px 0 0;
    color: rgba(248, 244, 248, 0.66);
    font-size: 15px;
    line-height: 1.72;
}

.login-principles {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-principles article {
    min-width: 0;
    padding: 16px 15px;
    display: flex;
    gap: 11px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.login-principles i {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #d7a3e2;
    box-shadow: 0 0 0 4px rgba(215, 163, 226, 0.1);
}

.login-principles span {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.login-principles strong {
    font-size: 11px;
    line-height: 1.25;
}

.login-principles small {
    color: rgba(248, 244, 248, 0.5);
    font-size: 10px;
    line-height: 1.45;
}

.login-story__footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    color: rgba(248, 244, 248, 0.38);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-access {
    position: relative;
    min-height: 100vh;
    padding: clamp(34px, 6vw, 94px);
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 78% 8%, rgba(199, 166, 207, 0.18), transparent 27%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 36%),
        var(--login-canvas);
}

.login-access__inner {
    width: min(100%, 470px);
}

.login-state {
    width: max-content;
    min-height: 30px;
    margin-bottom: 42px;
    padding: 0 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #655c68;
    border: 1px solid var(--login-line);
    border-radius: 999px;
    background: rgba(255, 253, 250, 0.66);
    font-size: 10px;
    font-weight: 650;
}

.login-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #55a984;
    box-shadow: 0 0 0 4px rgba(85, 169, 132, 0.1);
}

.login-state.is-warning i {
    background: #c8893e;
    box-shadow: 0 0 0 4px rgba(200, 137, 62, 0.1);
}

.login-state.is-loading i {
    background: #9165a0;
    animation: loginPulse 900ms ease-in-out infinite alternate;
}

.login-heading {
    margin-bottom: 32px;
}

.login-heading .login-kicker {
    color: #92603a;
}

.login-heading h2 {
    margin: 0;
    font-family: "Geologica", sans-serif;
    font-size: clamp(31px, 3vw, 42px);
    font-weight: 610;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.login-heading > p:last-child {
    margin: 13px 0 0;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.55;
}

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

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

.login-field > span:first-child {
    color: #5e5661;
    font-size: 11px;
    font-weight: 680;
}

.login-field input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    color: var(--login-ink);
    border: 1px solid var(--login-line);
    border-radius: 12px;
    outline: 0;
    background: rgba(255, 253, 250, 0.76);
    font-size: 14px;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-field input::placeholder {
    color: #aaa3ab;
}

.login-field input:hover {
    border-color: rgba(74, 61, 77, 0.24);
    background: var(--login-surface);
}

.login-field input:focus {
    border-color: #9e69ae;
    background: var(--login-surface);
    box-shadow: 0 0 0 4px rgba(158, 105, 174, 0.1);
}

.login-password {
    position: relative;
    display: block;
}

.login-password input {
    padding-right: 92px;
}

.login-password button {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 36px;
    padding: 0 10px;
    color: #6c5c70;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.login-password button:hover {
    background: #f0e9f2;
}

.login-advanced {
    border-bottom: 1px solid var(--login-line);
}

.login-advanced summary {
    width: max-content;
    padding: 3px 0 13px;
    color: var(--login-muted);
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
}

.login-advanced > div {
    padding: 2px 0 18px;
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 12px;
}

.login-advanced .login-field input {
    height: 44px;
    font-size: 12px;
}

.login-error {
    padding: 12px 14px;
    color: #8c3f49;
    border: 1px solid rgba(164, 67, 74, 0.17);
    border-radius: 11px;
    background: rgba(247, 228, 229, 0.8);
    font-size: 11px;
    line-height: 1.5;
}

.login-submit {
    height: 52px;
    padding: 0 17px;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    color: #fff;
    border: 0;
    border-radius: 12px;
    background: var(--login-accent);
    box-shadow: 0 13px 30px rgba(70, 45, 78, 0.18);
    font-size: 13px;
    font-weight: 720;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-submit:hover {
    background: var(--login-accent-hover);
    box-shadow: 0 16px 34px rgba(70, 45, 78, 0.24);
    transform: translateY(-1px);
}

.login-submit:disabled {
    cursor: wait;
    opacity: 0.76;
    transform: none;
}

.login-submit i {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
}

.login-submit.is-loading i {
    display: block;
    animation: loginSpin 700ms linear infinite;
}

.login-help {
    margin-top: 24px;
    padding: 15px 0;
    display: flex;
    gap: 11px;
    align-items: center;
    color: var(--login-muted);
    border-top: 1px solid var(--login-line);
    border-bottom: 1px solid var(--login-line);
}

.login-help > span {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    color: #795f80;
    border-radius: 9px;
    background: #eee6f0;
    font-family: "Geologica", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.login-help p {
    margin: 0;
    display: grid;
    gap: 3px;
}

.login-help strong {
    color: #5b525e;
    font-size: 11px;
}

.login-help small {
    font-size: 10px;
    line-height: 1.45;
}

.login-access__footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #8d858f;
    font-size: 10px;
}

.login-access__footer a {
    color: #705a76;
    text-decoration: none;
    border-bottom: 1px solid rgba(112, 90, 118, 0.28);
}

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

@keyframes loginPulse {
    to { opacity: 0.45; }
}

@media (max-width: 1080px) {
    .login-layout {
        grid-template-columns: minmax(360px, 0.78fr) minmax(470px, 1.22fr);
    }

    .login-principles {
        grid-template-columns: 1fr;
    }

    .login-principles article:nth-child(3) {
        display: none;
    }
}

@media (max-width: 820px) {
    .login-layout {
        display: block;
    }

    .login-story {
        min-height: auto;
        padding: 25px 24px 28px;
    }

    .login-story__content {
        margin: 76px 0 30px;
    }

    .login-story h1 {
        max-width: 570px;
        font-size: clamp(34px, 8vw, 52px);
    }

    .login-principles {
        display: none;
    }

    .login-story__footer {
        display: none;
    }

    .login-access {
        min-height: auto;
        padding: 42px 24px 60px;
        place-items: start center;
    }
}

@media (max-width: 520px) {
    .login-story {
        padding: 20px 18px 24px;
    }

    .login-story__content {
        margin: 54px 0 6px;
    }

    .login-story__content > p:last-child {
        margin-top: 18px;
        font-size: 13px;
    }

    .login-access {
        padding: 34px 18px 48px;
    }

    .login-state {
        margin-bottom: 32px;
    }

    .login-advanced > div {
        grid-template-columns: 1fr;
    }

    .login-access__footer {
        display: grid;
    }
}

@media (pointer: coarse) {
    .login-password button,
    .login-submit,
    .login-advanced summary,
    .login-access__footer a {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
