* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;

    background: #eef0f3;
}

/* =========================================
   BACKGROUND
========================================= */

.login-page {
    min-height: 100vh;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;

    padding: 104px 20px 36px;

    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.65) 25%,
            transparent 55%
        ),
        radial-gradient(
            circle at 85% 70%,
            rgba(215, 220, 228, 0.8) 0%,
            transparent 45%
        ),
        linear-gradient(
            135deg,
            #f7f8fa 0%,
            #e8eaee 50%,
            #f5f6f8 100%
        );
}

/* мягкие световые пятна */

.login-page::before {
    content: "";

    position: absolute;

    width: 600px;
    height: 600px;

    left: -250px;
    top: 100px;

    background: rgba(255, 255, 255, 0.8);

    filter: blur(100px);

    border-radius: 50%;

    pointer-events: none;
}

.login-page::after {
    content: "";

    position: absolute;

    width: 500px;
    height: 500px;

    right: -180px;
    bottom: 20px;

    background: rgba(190, 197, 207, 0.55);

    filter: blur(100px);

    border-radius: 50%;

    pointer-events: none;
}

.login-topbar {
    position: absolute;
    z-index: 3;
    top: 24px;
    left: 50%;
    width: min(100% - 40px, 1120px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateX(-50%);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #12161a;
    text-decoration: none;
    letter-spacing: -0.025em;
}

.login-brand img {
    height: 45px;
    width: 45px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
}

.login-brand-copy {
    display: grid;
    gap: 2px;
    line-height: 1;
}

.login-brand-copy > span {
    font-size: 20px;
    font-weight: 750;
}

.login-brand-copy small {
    color: #687076;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}

.login-preferences {
    display: flex;
    gap: 7px;
    padding: 5px;
    border: 1px solid rgba(18, 22, 26, 0.1);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 8px 22px rgba(20, 28, 36, 0.06);
    backdrop-filter: blur(12px);
}

.language-switcher,
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
}

.language-switcher {
    padding-right: 6px;
    border-right: 1px solid rgba(18, 22, 26, 0.1);
}

.language-switcher button,
.theme-toggle button {
    min-width: 42px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1a2024;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.language-switcher button.is-active,
.theme-toggle button:hover {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(18, 22, 26, 0.15);
}

.theme-toggle button {
    width: 38px;
    min-width: 38px;
    font-size: 20px;
    line-height: 1;
}

body.login-dark-mode {
    background: #101416;
}

body.login-dark-mode .login-page {
    background: radial-gradient(circle at 20% 30%, rgba(24, 35, 37, 0.9), transparent 52%), linear-gradient(135deg, #0e1315 0%, #172022 55%, #101416 100%);
}

body.login-dark-mode .login-brand {
    color: #f3f7f6;
}

body.login-dark-mode .login-brand-copy small {
    color: #aeb9b7;
}

body.login-dark-mode .login-brand img {
    filter: brightness(0) invert(1);
}

body.login-dark-mode .login-preferences {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(21, 28, 30, 0.75);
}

body.login-dark-mode .language-switcher {
    border-color: rgba(255, 255, 255, 0.12);
}

body.login-dark-mode .language-switcher button,
body.login-dark-mode .theme-toggle button {
    color: #f3f7f6;
}

body.login-dark-mode .language-switcher button.is-active,
body.login-dark-mode .theme-toggle button:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}


/* =========================================
   GLASS LOGIN CARD
========================================= */

.login-container {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 420px;

    padding: 34px 32px 30px;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(70, 74, 82, 0.72),
            rgba(42, 45, 52, 0.78)
        );

    backdrop-filter: blur(35px) saturate(120%);
    -webkit-backdrop-filter: blur(35px) saturate(120%);

    border: 1px solid rgba(255, 255, 255, 0.22);

    box-shadow:
        0 35px 80px rgba(30, 34, 42, 0.28),
        inset 0 1px 1px rgba(255, 255, 255, 0.16);

    color: #ffffff;

    animation: cardAppear 0.55s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================
   LOGO
========================================= */

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;

    margin-bottom: 34px;
}

.login-logo img {
    display: block;

    max-width: 220px;
    max-height: 100px;

    object-fit: contain;
}

/*
   Если ваш логотип прозрачный и чёрный,
   этот filter сделает его белым.
*/
.login-logo.logo-light img {
    filter: brightness(0) invert(1);
}


/* =========================================
   TITLE
========================================= */

.login-title {
    margin: 0;

    text-align: center;

    font-size: 30px;
    line-height: 1.15;

    font-weight: 700;

    letter-spacing: -0.8px;

    color: #ffffff;
}

.login-subtitle {
    margin: 8px 0 26px;

    text-align: center;

    font-size: 15px;

    color: rgba(255, 255, 255, 0.68);
}


/* =========================================
   ERRORS / SUCCESS
========================================= */

.form-errors {
    margin-bottom: 22px;

    padding: 14px 17px;

    border-radius: 14px;

    background: rgba(150, 40, 40, 0.35);

    border: 1px solid rgba(255, 150, 150, 0.35);

    color: #ffffff;

    font-size: 14px;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.form-success {
    margin-bottom: 22px;

    padding: 14px 17px;

    border-radius: 14px;

    background: rgba(15, 139, 141, 0.28);

    border: 1px solid rgba(120, 220, 210, 0.35);

    color: #ffffff;

    font-size: 14px;
}


/* =========================================
   FORM
========================================= */

.login-form {
    display: flex;

    flex-direction: column;

    gap: 0;
}

.form-field {
    position: relative;

    margin-bottom: 16px;
}

.form-field label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 500;

    color: #ffffff;
}

/* styles.css defines its own unrelated ".form-field span" (grey, for forms
   elsewhere on the site) that otherwise wins over the label color above —
   a direct match on the span always beats an inherited value, regardless
   of load order. ".form-field label span" is more specific, so it wins. */
.form-field label span {
    color: #ffffff;
}


/* =========================================
   INPUTS
========================================= */

.form-field input {
    width: 100%;

    height: 52px;

    padding: 0 20px;

    border-radius: 13px;

    border: 1px solid rgba(255, 255, 255, 0.22);

    background: rgba(255, 255, 255, 0.09);

    color: #ffffff;

    font-family: inherit;

    font-size: 16px;

    outline: none;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.form-field input::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

.form-field input:hover {
    background: rgba(255, 255, 255, 0.12);
}

.form-field input:focus {
    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.55);

    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.07);
}

/* Chrome/Edge/Safari autofill forces its own background + dark text unless
   overridden — this is what actually made the login/password text unreadable
   once a browser had saved credentials for this form. */
.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 1000px rgba(70, 74, 82, 0.95) inset;
    transition: background-color 9999s ease-in-out 0s;
}


/* =========================================
   OPTIONS
========================================= */

.login-options {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-top: 2px;

    margin-bottom: 20px;

    font-size: 15px;
}

.remember {
    display: flex;

    align-items: center;

    gap: 10px;

    color: rgba(255, 255, 255, 0.86);

    cursor: pointer;

    user-select: none;
}

.remember input {
    appearance: none;
    -webkit-appearance: none;

    width: 20px;
    height: 20px;

    margin: 0;

    border-radius: 6px;

    border: 1px solid rgba(255, 255, 255, 0.6);

    background: rgba(255, 255, 255, 0.06);

    cursor: pointer;

    position: relative;
}

.remember input:checked {
    background: #4f8ee8;

    border-color: #4f8ee8;
}

.remember input:checked::after {
    content: "✓";

    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -55%);

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;
}

.forgot-password {
    color: #5e9bf5;

    text-decoration: none;

    transition: opacity 0.2s ease;
}

.forgot-password:hover {
    opacity: 0.75;
}


/* =========================================
   LOGIN BUTTON
========================================= */

.login-btn {
    width: 100%;

    height: 52px;

    border: none;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #0f8b8d,
            #0a6668
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 17px;

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 8px 24px rgba(15, 139, 141, 0.24);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

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

    filter: brightness(1.06);

    box-shadow:
        0 12px 30px rgba(15, 139, 141, 0.3);
}

.login-btn:active {
    transform: scale(0.99);
}


/* =========================================
   DIVIDER
========================================= */

.divider {
    display: flex;

    align-items: center;

    gap: 16px;

    margin: 22px 0 18px;

    color: rgba(255, 255, 255, 0.48);

    font-size: 14px;
}

.divider::before,
.divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: rgba(255, 255, 255, 0.18);
}


/* =========================================
   CONTACT
========================================= */

.contact-link {
    text-align: center;

    font-size: 15px;

    color: rgba(255, 255, 255, 0.82);
}

.contact-link a {
    color: #5b9cf4;

    text-decoration: none;

    font-weight: 500;
}

.contact-link a:hover {
    text-decoration: underline;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    .login-page {
        padding: 96px 16px 24px;
    }

    .login-topbar {
        top: 16px;
        width: calc(100% - 32px);
    }

    .login-brand {
        gap: 9px;
    }

    .login-brand img {
        width: 33px;
        height: 33px;
    }

    .login-brand-copy > span {
        font-size: 16px;
    }

    .login-brand-copy small {
        font-size: 10px;
    }

    .login-preferences {
        gap: 3px;
        padding: 4px;
    }

    .language-switcher {
        padding-right: 3px;
    }

    .language-switcher button {
        min-width: 34px;
        height: 31px;
        font-size: 12px;
    }

    .theme-toggle button {
        width: 34px;
        min-width: 34px;
        height: 31px;
        font-size: 18px;
    }

    .login-container {
        padding: 30px 24px 26px;

        border-radius: 24px;
    }

    .login-title {
        font-size: 30px;
    }

    .login-subtitle {
        font-size: 15px;

        margin-bottom: 30px;
    }

    .form-field input {
        height: 58px;
    }

    .login-btn {
        height: 58px;
    }

    .login-options {
        font-size: 14px;
    }
}
