:root {
    --ice-bg: #06111d;
    --ice-panel: rgba(5, 20, 34, 0.82);
    --ice-input: rgba(4, 17, 30, 0.72);
    --ice-cyan: #2bc8ff;
    --ice-blue: #087bff;
    --ice-mint: #54e8d1;
    --ice-text: #f2f8ff;
    --ice-muted: #9db2c6;
    --ice-border: rgba(164, 217, 250, 0.34);
    --ice-danger: #ff8998;
    --ice-warning: #ffd17a;
    --ice-font: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    color: var(--ice-text);
    background: var(--ice-bg);
    font-family: var(--ice-font);
}

button,
input {
    font: inherit;
}

.login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(2, 10, 19, 0.48) 0%, rgba(2, 10, 19, 0.12) 55%, rgba(2, 10, 19, 0.1) 100%),
        url("../imgs/login-bg.webp") center / cover no-repeat;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 14%, rgba(43, 200, 255, 0.11), transparent 30%),
        linear-gradient(90deg, rgba(2, 9, 17, 0.28), transparent 58%);
    pointer-events: none;
}

.login-panel-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    width: min(46%, 720px);
    min-width: 560px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(28px, 4vw, 72px);
}

.login-panel {
    width: min(100%, 560px);
    padding: clamp(32px, 4.3vw, 56px);
    border: 1px solid var(--ice-border);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 0%, rgba(43, 200, 255, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(8, 29, 48, 0.9), rgba(3, 15, 27, 0.82));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(18px) saturate(115%);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
    animation: panel-enter 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand {
    text-align: center;
}

.login-brand__mark {
    width: clamp(104px, 8vw, 138px);
    margin: 0 auto 14px;
    filter: drop-shadow(0 0 18px rgba(43, 200, 255, 0.58));
}

.login-brand__mark svg {
    display: block;
    width: 100%;
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(2.35rem, 3.5vw, 3.35rem);
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.045em;
}

.login-brand h1 span {
    color: var(--ice-cyan);
}

.login-brand p {
    margin: 18px 0 0;
    color: var(--ice-muted);
    font-size: clamp(0.93rem, 1.15vw, 1.08rem);
    line-height: 1.55;
}

.ice-divider {
    position: relative;
    height: 1px;
    margin: 27px 0 30px;
    background: linear-gradient(90deg, transparent, rgba(43, 200, 255, 0.82), transparent);
}

.ice-divider::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 9px;
    height: 9px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--ice-cyan);
    box-shadow: 0 0 16px rgba(43, 200, 255, 0.88);
}

.auth-messages {
    display: grid;
    gap: 9px;
    margin: -6px 0 20px;
}

.auth-message {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: message-enter 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-message--danger {
    border-color: rgba(255, 137, 152, 0.42);
    background: rgba(97, 20, 35, 0.42);
    color: #ffdce1;
}

.auth-message--warning {
    border-color: rgba(255, 209, 122, 0.4);
    background: rgba(82, 57, 17, 0.42);
    color: #ffe7b8;
}

.auth-message__icon {
    width: 22px;
    height: 22px;
    color: currentColor;
}

.auth-message svg,
.login-field__icon svg,
.password-toggle svg,
.security-note svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

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

.login-field__control {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 62px;
    border: 1px solid rgba(180, 220, 255, 0.3);
    border-radius: 12px;
    background: var(--ice-input);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-field__control:focus-within {
    border-color: var(--ice-cyan);
    background: rgba(8, 29, 48, 0.9);
    box-shadow: 0 0 0 3px rgba(43, 200, 255, 0.13), 0 0 24px rgba(43, 200, 255, 0.26);
}

.login-field--invalid .login-field__control {
    border-color: rgba(255, 137, 152, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 137, 152, 0.1);
}

.login-field__icon {
    position: absolute;
    z-index: 2;
    left: 21px;
    width: 24px;
    height: 24px;
    color: rgba(214, 235, 249, 0.75);
    pointer-events: none;
}

.login-input {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 0 58px 0 62px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ice-text);
    font-size: 1rem;
}

.login-input::placeholder {
    color: rgba(174, 194, 211, 0.7);
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    border-radius: 11px;
    caret-color: var(--ice-text);
    -webkit-text-fill-color: var(--ice-text);
    -webkit-box-shadow: 0 0 0 1000px #071827 inset;
    box-shadow: 0 0 0 1000px #071827 inset;
}

.login-input:autofill {
    border-radius: 11px;
    background-color: #071827;
    color: var(--ice-text);
    caret-color: var(--ice-text);
    box-shadow: 0 0 0 1000px #071827 inset;
}

.login-field__message {
    margin: 0 3px;
    color: var(--ice-danger);
    font-size: 0.82rem;
    line-height: 1.35;
}

.password-toggle {
    position: absolute;
    z-index: 2;
    right: 15px;
    width: 36px;
    height: 36px;
    padding: 7px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(214, 235, 249, 0.7);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
    color: var(--ice-cyan);
    background: rgba(43, 200, 255, 0.1);
}

.password-toggle:focus-visible,
.login-button:focus-visible,
.login-remember__input:focus-visible {
    outline: 2px solid var(--ice-cyan);
    outline-offset: 3px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--ice-muted);
    font-size: 0.92rem;
    cursor: pointer;
}

.login-remember__input {
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: var(--ice-cyan);
}

.login-button {
    position: relative;
    width: 100%;
    min-height: 64px;
    margin-top: 2px;
    overflow: hidden;
    border: 1px solid rgba(125, 220, 255, 0.54);
    border-radius: 12px;
    background:
        radial-gradient(circle at 72% 18%, rgba(100, 232, 255, 0.38), transparent 25%),
        linear-gradient(135deg, #0765d7, #078ff0 52%, #075fc5);
    color: #f7fbff;
    box-shadow: 0 16px 34px rgba(0, 104, 218, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    font-size: 1.13rem;
    font-weight: 680;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-button::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}

.login-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 20px 44px rgba(0, 136, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.login-button:hover::before {
    animation: button-shine 0.9s ease;
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.84;
}

.login-button__arrow {
    position: absolute;
    top: 50%;
    right: 28px;
    transform: translateY(-54%);
    font-size: 1.8rem;
    font-weight: 320;
}

.login-button__loader {
    position: absolute;
    top: calc(50% - 12px);
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #f7fbff;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.75s linear infinite;
}

.login-button.is-loading .login-button__text,
.login-button.is-loading .login-button__arrow {
    opacity: 0;
}

.login-button.is-loading .login-button__loader {
    opacity: 1;
}

.security-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 0;
    color: var(--ice-muted);
    font-size: 0.88rem;
}

.security-note svg {
    width: 21px;
    height: 21px;
}

.ice-markers {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.ice-marker {
    position: absolute;
    left: var(--marker-x);
    top: var(--marker-y);
    width: var(--marker-size);
    height: var(--marker-size);
    border: 1px solid var(--marker-color);
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 16px color-mix(in srgb, var(--marker-color) 76%, transparent);
    opacity: 0;
    animation: marker-pulse var(--marker-duration) ease-in-out var(--marker-delay) infinite;
}

.ice-marker::after {
    content: "";
    position: absolute;
    inset: 34%;
    border-radius: 50%;
    background: var(--marker-color);
    box-shadow: 0 0 10px var(--marker-color);
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes message-enter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-shine {
    to {
        transform: translateX(120%);
    }
}

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

@keyframes marker-pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) rotate(45deg) scale(0.78);
    }
    48% {
        opacity: 0.95;
        transform: translate(-50%, -50%) rotate(45deg) scale(1.28);
    }
}

@media (max-width: 960px) {
    .login-page {
        display: grid;
        place-items: center;
        padding: 24px;
        background-position: 62% center;
    }

    .login-page::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: rgba(2, 11, 20, 0.38);
        pointer-events: none;
    }

    .login-panel-wrap {
        width: 100%;
        min-width: 0;
        min-height: auto;
        padding: 0;
        justify-content: center;
    }

    .login-panel {
        width: min(100%, 500px);
    }
}

@media (max-width: 520px) {
    .login-page {
        align-items: start;
        min-height: 100dvh;
        padding: 14px;
        overflow-y: auto;
    }

    .login-panel {
        margin: 0;
        padding: 28px 20px;
        border-radius: 21px;
    }

    .login-brand__mark {
        width: 94px;
        margin-bottom: 10px;
    }

    .login-brand h1 {
        font-size: 2.18rem;
    }

    .login-brand p {
        font-size: 0.88rem;
    }

    .ice-divider {
        margin: 22px 0 25px;
    }

    .login-form {
        gap: 17px;
    }

    .login-field__control {
        min-height: 57px;
    }

    .login-input {
        min-height: 55px;
        padding-left: 58px;
    }

    .login-button {
        min-height: 59px;
    }
}

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