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

:root {
    --auth-bg: #06181b;
    --auth-panel: rgba(8, 24, 28, 0.56);
    --auth-panel-strong: rgba(5, 17, 20, 0.72);
    --auth-panel-soft: rgba(255, 255, 255, 0.08);
    --auth-line: rgba(255, 255, 255, 0.16);
    --auth-line-strong: rgba(94, 234, 212, 0.36);
    --auth-text: #f4fbfb;
    --auth-muted: rgba(231, 247, 246, 0.76);
    --auth-accent: #22d3c5;
    --auth-accent-deep: #0f8e88;
    --auth-accent-glow: rgba(34, 211, 197, 0.28);
    --auth-danger-bg: rgba(220, 38, 38, 0.18);
    --auth-danger-text: #fecaca;
    --auth-success-bg: rgba(13, 148, 136, 0.18);
    --auth-success-text: #bdfcf5;
    --auth-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

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

body {
    margin: 0;
    color: var(--auth-text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: var(--auth-bg);
}

a {
    color: inherit;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

.auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.auth-bg__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
}

.auth-bg__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, rgba(2, 9, 10, 0.82) 0%, rgba(3, 13, 15, 0.64) 34%, rgba(7, 32, 34, 0.42) 58%, rgba(11, 83, 80, 0.48) 100%),
        radial-gradient(circle at 18% 18%, rgba(34, 211, 197, 0.36), transparent 34%),
        radial-gradient(circle at 86% 72%, rgba(20, 184, 166, 0.26), transparent 30%);
}

.auth-scene {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    align-items: stretch;
}

.auth-bg__content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 3rem clamp(1.5rem, 4vw, 4.5rem);
}

.auth-bg__content::before {
    content: none;
}

.auth-bg__logo {
    width: clamp(13rem, 24vw, 19rem);
    height: auto;
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.24));
}

.auth-hero {
    max-width: 34rem;
}

.auth-hero h2 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2.8rem, 5vw, 4.85rem);
    line-height: 1;
    letter-spacing: -0.05em;
    text-wrap: balance;
}

.auth-bg__tagline {
    margin: 0;
    max-width: 31rem;
    color: var(--auth-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem clamp(1.25rem, 3vw, 3rem);
}

.auth-card {
    width: min(30rem, 100%);
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border-radius: 1.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)),
        linear-gradient(145deg, rgba(10, 38, 42, 0.88), rgba(4, 17, 19, 0.82));
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.auth-logo {
    width: 10rem;
    height: auto;
}

.auth-title {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 2.65rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    position: relative;
}

.auth-field--icon .auth-input {
    padding-left: 3rem;
}

.auth-field--password .auth-input {
    padding-right: 3rem;
}

.auth-field-icon {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 1;
    color: rgba(211, 255, 250, 0.72);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    min-height: 3.55rem;
    border-radius: 1rem;
    border: 1px solid var(--auth-line);
    background: rgba(255, 255, 255, 0.08);
    color: var(--auth-text);
    padding: 0.95rem 1rem;
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-input::placeholder {
    color: rgba(224, 247, 245, 0.52);
}

.auth-input:focus {
    border-color: var(--auth-line-strong);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 0.28rem var(--auth-accent-glow);
}

.auth-password-toggle {
    position: absolute;
    top: 0.82rem;
    right: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(224, 247, 245, 0.7);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.auth-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.1rem;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(235, 248, 247, 0.8);
    font-size: 0.92rem;
}

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-accent);
}

.auth-link {
    color: #aaf5ee;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.auth-link:hover {
    color: #d7fffb;
}

.auth-button {
    appearance: none;
    width: 100%;
    min-height: 3.55rem;
    border: 0;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    background: linear-gradient(135deg, #24d4c6, #149b93);
    color: #052a29;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 34px rgba(20, 155, 147, 0.34);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
    box-shadow: 0 22px 38px rgba(20, 155, 147, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:focus-visible {
    outline: 0;
    box-shadow:
        0 0 0 0.28rem rgba(173, 255, 247, 0.22),
        0 18px 34px rgba(20, 155, 147, 0.34);
}

.auth-footer {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.95rem;
    text-align: center;
    color: rgba(235, 248, 247, 0.72);
    font-size: 0.92rem;
}

.auth-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.auth-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(237, 254, 252, 0.82);
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.auth-social a:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 234, 212, 0.34);
    background: rgba(34, 211, 197, 0.12);
}

.auth-fineprint {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(219, 244, 242, 0.52);
}

.field-validation-error {
    display: block;
    margin-top: 0.1rem;
    color: #ffd3d3;
    font-size: 0.84rem;
}

.alert {
    margin: 0 0 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    font-size: 0.92rem;
    line-height: 1.5;
}

.alert-danger {
    background: var(--auth-danger-bg);
    border-color: rgba(254, 202, 202, 0.2);
    color: var(--auth-danger-text);
}

.alert-success {
    background: var(--auth-success-bg);
    border-color: rgba(153, 246, 228, 0.2);
    color: var(--auth-success-text);
}

@media (max-width: 1080px) {
    .auth-scene {
        grid-template-columns: 1fr;
    }

    .auth-bg__content {
        min-height: 44vh;
        justify-content: center;
        padding-bottom: 1.25rem;
    }

    .auth-bg__content::before {
        display: none;
    }

    .auth-panel {
        padding-top: 0;
    }
}

@media (max-width: 720px) {
    .auth-bg__content {
        min-height: auto;
        gap: 1rem;
        padding: 1.5rem 1.1rem 1rem;
    }

    .auth-bg__logo {
        width: clamp(10.5rem, 46vw, 13rem);
    }

    .auth-hero h2 {
        font-size: 2.3rem;
    }

    .auth-bg__tagline {
        font-size: 0.96rem;
        line-height: 1.6;
    }

    .auth-panel {
        padding: 0 1rem 1rem;
    }

    .auth-card {
        width: 100%;
        border-radius: 1.5rem;
    }
}

@media (max-width: 520px) {
    .auth-row {
        grid-template-columns: 1fr;
    }

    .auth-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-title {
        font-size: 1.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg__video {
        transform: none;
    }

    .auth-button,
    .auth-social a,
    .auth-password-toggle,
    .auth-input {
        transition: none;
    }
}
