﻿:root {
    --bg: #07100e;
    --bg-soft: #0b1613;
    --green: #57f287;
    --green-hover: #73f59a;
    --green-soft: rgba(87, 242, 135, .10);
    --text: #f4f7f5;
    --muted: #8d9b95;
    --border: rgba(255, 255, 255, .09);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, .08);
}


/* =========================================================
   BASE
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow-x: hidden;
    background: radial-gradient( circle at 50% 32%, rgba(87, 242, 135, .11), transparent 36% ), var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
}


/* =========================================================
   PAGE
   ========================================================= */

.auth-page {
    position: relative;
    width: 100%;
    max-width: 470px;
}


/* =========================================================
   BACKGROUND
   ========================================================= */

.auth-glow {
    position: absolute;
    z-index: 0;
    width: 420px;
    height: 420px;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(87, 242, 135, .10);
    filter: blur(100px);
    pointer-events: none;
}

.auth-ring {
    position: absolute;
    z-index: 0;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(87, 242, 135, .07);
    pointer-events: none;
}

.auth-ring-one {
    width: 550px;
    height: 550px;
}

.auth-ring-two {
    width: 700px;
    height: 700px;
    border-color: rgba(255, 255, 255, .025);
}


/* =========================================================
   BACK LINK
   ========================================================= */

.back-link {
    position: relative;
    z-index: 5;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 20px;
    color: var(--muted);
    font-size: 13px;
    transition: color .2s ease, transform .2s ease;
}

    .back-link:hover {
        color: var(--text);
        transform: translateX(-2px);
    }


/* =========================================================
   CARD
   ========================================================= */

.auth-card {
    position: relative;
    z-index: 5;
    width: 100%;
    padding: 38px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient( 145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025) );
    box-shadow: 0 35px 100px rgba(0, 0, 0, .40);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

    .auth-card::before {
        content: "";
        position: absolute;
        width: 220px;
        height: 220px;
        top: -120px;
        right: -100px;
        border-radius: 50%;
        background: rgba(87, 242, 135, .08);
        filter: blur(60px);
        pointer-events: none;
    }


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    margin-bottom: 34px;
    color: white;
}

.brand-logo {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--green);
    color: #05130b;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 8px 25px rgba(87, 242, 135, .12);
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.6px;
}

    .brand-name span {
        color: var(--green);
    }


/* =========================================================
   HEADER TEXT
   ========================================================= */

.auth-label {
    position: relative;
    z-index: 2;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 7px 11px;
    border-radius: 100px;
    background: var(--green-soft);
    border: 1px solid rgba(87, 242, 135, .13);
    color: #baf8ce;
    font-size: 11px;
    font-weight: 600;
}

.auth-label-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(87, 242, 135, .9);
}

.auth-title {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: clamp(30px, 7vw, 36px);
    line-height: 1.08;
    letter-spacing: -1.6px;
    font-weight: 800;
}

    .auth-title span {
        color: var(--green);
    }

.auth-subtitle {
    position: relative;
    z-index: 2;
    max-width: 370px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}


/* =========================================================
   FORM
   ========================================================= */

.auth-form {
    position: relative;
    z-index: 2;
    margin-top: 30px;
}

.form-group {
    margin-bottom: 19px;
}

.form-group-last {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #c7d0ca;
    font-size: 12px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    outline: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

    .form-control::placeholder {
        color: #58645d;
    }

    .form-control:hover {
        border-color: rgba(255, 255, 255, .14);
    }

    .form-control:focus {
        border-color: rgba(87, 242, 135, .50);
        background: rgba(255, 255, 255, .05);
        box-shadow: 0 0 0 4px rgba(87, 242, 135, .07);
    }


    /* Browser autofill */

    .form-control:-webkit-autofill,
    .form-control:-webkit-autofill:hover,
    .form-control:-webkit-autofill:focus {
        -webkit-text-fill-color: var(--text);
        -webkit-box-shadow: 0 0 0 1000px #101a16 inset;
        transition: background-color 9999s ease-in-out 0s;
        caret-color: var(--text);
    }


/* =========================================================
   VALIDATION
   ========================================================= */

.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 107, 107, .17);
    border-radius: 13px;
    background: var(--danger-soft);
    color: #ff9999;
    font-size: 12px;
    line-height: 1.5;
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

.field-validation-valid {
    display: none;
}

.field-validation-error {
    display: block;
    margin-top: 7px;
    color: #ff8585;
    font-size: 11px;
    line-height: 1.4;
}

.input-validation-error {
    border-color: rgba(255, 107, 107, .45);
}

    .input-validation-error:focus {
        border-color: rgba(255, 107, 107, .65);
        box-shadow: 0 0 0 4px rgba(255, 107, 107, .07);
    }


/* =========================================================
   LOGIN BUTTON
   ========================================================= */

.login-button {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    background: var(--green);
    color: #05130b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

    .login-button:hover {
        transform: translateY(-2px);
        background: var(--green-hover);
        box-shadow: 0 14px 35px rgba(87, 242, 135, .10);
    }

    .login-button:active {
        transform: translateY(0);
    }

    .login-button span {
        font-size: 16px;
    }


/* =========================================================
   REGISTER
   ========================================================= */

.register-block {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    color: #66736b;
    text-align: center;
    font-size: 12px;
}

    .register-block a {
        color: var(--green);
        font-weight: 600;
        transition: color .2s ease;
    }

        .register-block a:hover {
            color: var(--green-hover);
        }


/* =========================================================
   OTHER METHODS
   ========================================================= */

.other-methods {
    position: relative;
    z-index: 2;
    margin-top: 13px;
    text-align: center;
}

    .other-methods a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #718078;
        font-size: 11px;
        transition: color .2s ease;
    }

        .other-methods a:hover {
            color: var(--text);
        }


/* =========================================================
   FOOTER
   ========================================================= */

.auth-footer {
    position: relative;
    z-index: 5;
    margin-top: 20px;
    text-align: center;
    color: #4d5952;
    font-size: 10px;
    line-height: 1.5;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 768px) {

    body {
        padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    }

    .auth-page {
        max-width: 450px;
    }

    .auth-card {
        padding: 34px;
    }

    .auth-ring-one {
        width: 500px;
        height: 500px;
    }

    .auth-ring-two {
        width: 620px;
        height: 620px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

    body {
        align-items: flex-start;
        padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    }

    .auth-page {
        max-width: 100%;
    }

    .auth-glow {
        width: 320px;
        height: 320px;
        top: 38%;
        filter: blur(80px);
    }

    .auth-ring {
        display: none;
    }

    .back-link {
        margin-bottom: 16px;
        font-size: 12px;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 22px;
        box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    }

    .brand {
        margin-bottom: 27px;
    }

    .brand-logo {
        width: 39px;
        height: 39px;
        border-radius: 12px;
        font-size: 19px;
    }

    .brand-name {
        font-size: 19px;
    }

    .auth-label {
        font-size: 10px;
    }

    .auth-title {
        font-size: 31px;
        letter-spacing: -1.3px;
    }

    .auth-subtitle {
        margin-top: 12px;
        font-size: 13px;
        line-height: 1.6;
    }

    .auth-form {
        margin-top: 25px;
    }

    .form-group {
        margin-bottom: 17px;
    }

    .form-group-last {
        margin-bottom: 21px;
    }

    .form-control {
        height: 54px;
        padding: 0 14px;
        border-radius: 13px;
        font-size: 13px;
    }

    .form-label {
        margin-bottom: 7px;
        font-size: 11px;
    }

    .login-button {
        min-height: 54px;
        border-radius: 13px;
        font-size: 13px;
    }

    .register-block {
        margin-top: 21px;
        padding-top: 19px;
        font-size: 11px;
    }

    .other-methods {
        margin-top: 12px;
    }

        .other-methods a {
            font-size: 10px;
        }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 390px) {

    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    .auth-card {
        padding: 24px 17px;
    }

    .auth-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .auth-subtitle {
        font-size: 12px;
    }

    .form-control {
        height: 52px;
        font-size: 12px;
    }

    .login-button {
        min-height: 52px;
        font-size: 12px;
    }

    .register-block {
        font-size: 10px;
    }
}


/* =========================================================
   SHORT HEIGHT / LANDSCAPE
   ========================================================= */

@media (max-height: 720px) and (min-width: 521px) {

    body {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .back-link {
        margin-bottom: 12px;
    }

    .auth-card {
        padding: 28px 34px;
    }

    .brand {
        margin-bottom: 22px;
    }

    .auth-form {
        margin-top: 22px;
    }

    .register-block {
        margin-top: 18px;
        padding-top: 17px;
    }
}


/* =========================================================
   TOUCH DEVICES
   ========================================================= */

@media (hover: none) {

    .login-button:hover {
        transform: none;
        background: var(--green);
        box-shadow: none;
    }

    .login-button:active {
        transform: scale(.99);
        background: var(--green-hover);
    }

    .back-link:hover {
        transform: none;
        color: var(--muted);
    }
}


/* =========================================================
   ADMIN LOGIN
   ========================================================= */

.remember-row {
    position: relative;
    display: flex;
    align-items: center;
    width: fit-content;
    gap: 10px;
    margin: -2px 0 24px;
    color: #8d9b95;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}


/* Настоящий checkbox скрываем */

.remember-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}


/* Кастомный checkbox */

.remember-custom {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 6px;
    background: rgba(255, 255, 255, .035);
    color: transparent;
    font-size: 11px;
    font-weight: 900;
    transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}


.remember-row:hover
.remember-custom {
    border-color: rgba(87, 242, 135, .30);
}


.remember-checkbox:checked + .remember-custom {
    background: var(--green);
    border-color: var(--green);
    color: #05130b;
    box-shadow: 0 5px 18px rgba(87, 242, 135, .10);
}


.remember-checkbox:focus-visible + .remember-custom {
    box-shadow: 0 0 0 4px rgba(87, 242, 135, .08);
}


.remember-text {
    line-height: 1.4;
}


/* =========================================================
   ADMIN NOTE
   ========================================================= */

.admin-note {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    padding: 15px;
    border: 1px solid rgba(87, 242, 135, .10);
    border-radius: 15px;
    background: rgba(87, 242, 135, .045);
}


.admin-note-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--green);
    color: #05130b;
    font-size: 13px;
    font-weight: 900;
}


.admin-note strong {
    display: block;
    margin-bottom: 4px;
    color: #dfffe8;
    font-size: 11px;
}


.admin-note p {
    margin: 0;
    color: #78877e;
    font-size: 10px;
    line-height: 1.55;
}


/* =========================================================
   ADMIN MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .remember-row {
        margin-bottom: 21px;
        font-size: 11px;
    }

    .remember-custom {
        width: 19px;
        height: 19px;
    }

    .admin-note {
        margin-top: 20px;
        padding: 13px;
    }

    .admin-note-icon {
        width: 31px;
        height: 31px;
    }

    .admin-note p {
        font-size: 9px;
    }
}