@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --auth-hero-night-rgb: 11, 57, 80;
    --auth-hero-ink-rgb: 19, 100, 136;
    --auth-blue-rgb: 55, 166, 216;
    --auth-orange-rgb: 222, 115, 54;
    --auth-text: #ffffff;
    --auth-ink: #10384d;
    --auth-muted: rgba(255, 255, 255, 0.84);
    --auth-card-bg: rgba(235, 247, 252, 0.14);
    --auth-card-border: rgba(255, 255, 255, 0.22);
    --auth-card-shadow: 0 34px 90px rgba(3, 25, 39, 0.34);
    --auth-input-bg: rgba(244, 250, 253, 0.16);
    --auth-input-border: rgba(255, 255, 255, 0.18);
    --auth-input-divider: rgba(16, 56, 77, 0.18);
    --auth-input-text: #17394d;
    --auth-input-placeholder: rgba(23, 57, 77, 0.88);
    --auth-accent: #de7336;
    --auth-accent-hover: #c85f2a;
    --auth-link: #ffffff;
    --auth-danger-bg: rgba(147, 28, 28, 0.18);
    --auth-danger-border: rgba(255, 255, 255, 0.14);
    --auth-danger-text: #fff0f0;
}

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

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

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--auth-text);
    background:
        linear-gradient(rgba(var(--auth-hero-night-rgb), 0.86), rgba(var(--auth-hero-ink-rgb), 0.78)),
        url("../images/hero-background.webp") center / cover no-repeat,
        #0b3950;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.00)),
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.14), transparent 26%),
        radial-gradient(circle at 82% 30%, rgba(255, 255, 255, 0.10), transparent 24%);
    opacity: 0.86;
}

body::after {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 32%);
    mix-blend-mode: soft-light;
}

a {
    color: var(--auth-link);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: 32px 20px 22px;
}

.auth-stage {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    position: relative;
    width: min(100%, 448px);
    padding: 44px 34px 32px;
    border-radius: 24px;
    border: 1px solid var(--auth-card-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.08)),
        var(--auth-card-bg);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
}

.auth-card::before,
.auth-card::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.auth-card::before {
    top: -84px;
    right: -76px;
    width: 210px;
    height: 210px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}

.auth-card::after {
    left: -60px;
    bottom: -72px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(var(--auth-orange-rgb), 0.18), transparent 72%);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.auth-brand__logo {
    height: 68px;
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 22px rgba(12, 71, 105, 0.20));
}

.auth-brand__copy {
    min-width: 0;
}

.auth-kicker {
    padding-left: 1.5px;
    margin: 0 0 2px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.auth-brand h1 {
    margin: 0;
    font-size: clamp(2rem, 2.1vw, 2.4rem);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.auth-subtitle {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.auth-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
}

.auth-field {
    display: block;
    min-width: 0;
}

.auth-input {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    min-height: 58px;
    border-radius: 14px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 10px 24px rgba(3, 25, 39, 0.10);
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.auth-input--password {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
}

.auth-input:focus-within {
    transform: translateY(-1px);
    background: rgba(249, 252, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow:
        0 0 0 4px rgba(var(--auth-orange-rgb), 0.18),
        0 14px 28px rgba(3, 25, 39, 0.14);
}

.auth-input__icon {
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-input-text);
    border-right: 1px solid var(--auth-input-divider);
}

.auth-input__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.auth-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 14px;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--auth-input-text);
}

.auth-input input::placeholder {
    color: var(--auth-input-placeholder);
}

.auth-password-toggle {
    height: 100%;
    min-width: 48px;
    border: 0;
    border-left: 1px solid var(--auth-input-divider);
    background: transparent;
    color: var(--auth-input-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.auth-password-toggle:hover {
    background: rgba(255, 255, 255, 0.10);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.22);
    outline-offset: -2px;
}

.auth-password-toggle__icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.auth-password-toggle__icon--hide {
    display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-toggle__icon--show {
    display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-toggle__icon--hide {
    display: block;
}

.auth-button {
    margin-top: 10px;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #e78945 0%, var(--auth-accent) 100%);
    color: #ffffff;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(var(--auth-orange-rgb), 0.30);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #e07f3b 0%, var(--auth-accent-hover) 100%);
    box-shadow: 0 20px 38px rgba(var(--auth-orange-rgb), 0.34);
}

.auth-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.18);
    outline-offset: 2px;
}

.auth-links {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    text-align: center;
}

.auth-links p {
    margin: 0;
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.82);
}

.auth-note {
    position: relative;
    z-index: 1;
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.80);
}

.auth-footer {
    text-align: center;
    padding-top: 16px;
}

.auth-footer p {
    margin: 0;
    font-size: clamp(0.92rem, 1.5vw, 1rem);
    color: rgba(255, 255, 255, 0.90);
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--auth-danger-border);
    background: var(--auth-danger-bg);
    color: var(--auth-danger-text);
    font-size: 0.88rem;
    line-height: 1.5;
}

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

@media (max-width: 860px) {
    body {
        background:
            linear-gradient(rgba(var(--auth-hero-night-rgb), 0.88), rgba(var(--auth-hero-ink-rgb), 0.80)),
            url("../images/hero-background.webp") center center / cover no-repeat,
            #0b3950;
    }

    body::after {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%);
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 18px 14px 16px;
    }

    .auth-card {
        width: 100%;
        padding: 30px 18px 24px;
        border-radius: 18px;
    }

    .auth-brand {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 22px;
    }

    .auth-brand__logo {
        width: auto;
        height: 50px;
    }

    .auth-brand h1 {
        font-size: 1.55rem;
        line-height: 1.05;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-input {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 54px;
    }

    .auth-input--password {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
    }

    .auth-input input {
        padding: 0 12px;
        font-size: 0.92rem;
    }

    .auth-password-toggle {
        min-width: 44px;
    }

    .auth-button {
        min-height: 50px;
        font-size: 0.95rem;
    }

    .auth-footer p {
        font-size: 0.84rem;
        line-height: 1.5;
    }
}

@media (max-width: 380px) {
    .auth-shell {
        padding-inline: 10px;
    }

    .auth-card {
        padding: 24px 14px 20px;
    }

    .auth-brand {
        gap: 10px;
    }

    .auth-brand__logo {
        height: 42px;
    }

    .auth-brand h1 {
        font-size: 1.36rem;
    }

    .auth-kicker {
        font-size: 0.66rem;
    }

    .auth-subtitle {
        font-size: 0.84rem;
    }

    .auth-input {
        grid-template-columns: 40px minmax(0, 1fr);
        min-height: 50px;
        border-radius: 12px;
    }

    .auth-input--password {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }

    .auth-input__icon svg,
    .auth-password-toggle__icon {
        width: 16px;
        height: 16px;
    }

    .auth-password-toggle {
        min-width: 40px;
    }

    .auth-note {
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
