:root {
    --bg-1: #f8efe4;
    --bg-2: #efe2d1;
    --bg-3: #e7d6c0;

    --glass-1: rgba(255, 255, 255, 0.42);
    --glass-2: rgba(255, 250, 242, 0.24);
    --glass-3: rgba(255, 255, 255, 0.12);

    --accent: #173f73;
    --accent-2: #245489;
    --accent-hover: #0f2f59;
    --accent-soft: rgba(23, 63, 115, 0.12);

    --text: #171717;
    --muted: #4f4a44;

    --border-light: rgba(255, 255, 255, 0.66);
    --border-warm: rgba(190, 170, 145, 0.38);

    --shadow-main:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18),
        0 30px 90px rgba(69, 52, 35, 0.22),
        0 14px 34px rgba(23, 63, 115, 0.10);

    --shadow-soft:
        0 12px 30px rgba(69, 52, 35, 0.13);

    --shadow-blue:
        0 16px 38px rgba(23, 63, 115, 0.26),
        0 8px 20px rgba(69, 52, 35, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: 'Comfortaa', Arial, sans-serif;
    color: var(--text);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.68), transparent 34%),
        radial-gradient(circle at 82% 92%, rgba(214, 194, 166, 0.52), transparent 42%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);

    overflow-x: hidden;
    position: relative;
}

/* Едва заметная архитектурная/официальная подложка */
body::before {
    content: "";
    position: fixed;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent 0%,
            transparent 7%,
            rgba(120, 102, 84, 0.055) 7.2%,
            transparent 7.6%,
            transparent 13%,
            rgba(120, 102, 84, 0.04) 13.2%,
            transparent 13.7%,
            transparent 86%,
            rgba(120, 102, 84, 0.04) 86.2%,
            transparent 86.7%,
            transparent 92%,
            rgba(120, 102, 84, 0.055) 92.2%,
            transparent 92.6%,
            transparent 100%
        );

    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    left: 50%;
    bottom: -180px;
    transform: translateX(-50%);

    width: min(980px, 120vw);
    height: 360px;

    background:
        radial-gradient(ellipse at center, rgba(23, 63, 115, 0.075), transparent 62%),
        linear-gradient(to top, rgba(120, 102, 84, 0.07), transparent 55%);

    filter: blur(2px);
    pointer-events: none;
    z-index: 0;
}

/* ===== AUTH CARD ===== */

.auth-wrap {
    position: relative;
    z-index: 1;

    width: min(92vw, 420px);

    padding: 34px 32px 30px;

    border-radius: 32px;
    border: 1px solid var(--border-light);

    color: var(--text);

    background:
        linear-gradient(
            135deg,
            var(--glass-1) 0%,
            var(--glass-2) 46%,
            var(--glass-3) 100%
        );

    box-shadow: var(--shadow-main);

    backdrop-filter: blur(34px) saturate(1.45) contrast(1.06) brightness(1.04);
    -webkit-backdrop-filter: blur(34px) saturate(1.45) contrast(1.06) brightness(1.04);

    overflow: hidden;
    isolation: isolate;

    animation: fadeIn 0.28s ease-out;
}

/* liquid glass блик */
.auth-wrap::before {
    content: "";
    position: absolute;
    inset: 1px;

    border-radius: 31px;

    background:
        linear-gradient(
            125deg,
            rgba(255, 255, 255, 0.72) 0%,
            rgba(255, 255, 255, 0.24) 22%,
            rgba(255, 255, 255, 0.04) 46%,
            rgba(23, 63, 115, 0.045) 100%
        );

    pointer-events: none;
    z-index: -1;
}

/* мягкое синее свечение в углу */
.auth-wrap::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -120px;

    width: 260px;
    height: 260px;
    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.58) 0%,
            rgba(255, 255, 255, 0.24) 24%,
            rgba(23, 63, 115, 0.12) 46%,
            transparent 72%
        );

    filter: blur(10px);
    opacity: 0.95;
    pointer-events: none;
    z-index: -1;
}

/* ===== TEXT ===== */

h1 {
    margin: 0 0 14px;

    text-align: center;

    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.055em;

    color: var(--text);
}

p.desc {
    margin: 0 0 22px;

    text-align: center;
    color: var(--muted);

    font-size: 14px;
    line-height: 1.55;
}

/* ===== INPUT ===== */

.input-field {
    width: 100%;

    padding: 14px 16px;

    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.58);

    font-size: 16px;
    color: var(--text);

    outline: none;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.54),
            rgba(255, 250, 242, 0.28)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.74),
        inset 0 0 18px rgba(255, 255, 255, 0.12),
        0 8px 20px rgba(69, 52, 35, 0.08);

    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.input-field::placeholder {
    color: rgba(79, 74, 68, 0.68);
}

.input-field:focus {
    border-color: rgba(23, 63, 115, 0.42);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.68),
            rgba(255, 250, 242, 0.38)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 0 0 4px rgba(23, 63, 115, 0.12),
        0 12px 26px rgba(69, 52, 35, 0.12);
}

/* ===== ACTIONS ===== */

.actions {
    margin-top: 14px;
    display: grid;
    gap: 11px;
}

button.btn {
    position: relative;

    min-height: 48px;

    padding: 13px 16px;

    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;

    color: #ffffff;
    cursor: pointer;

    font: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;

    background:
        linear-gradient(
            145deg,
            #2d6099 0%,
            var(--accent) 54%,
            var(--accent-hover) 100%
        );

    box-shadow: var(--shadow-blue);

    overflow: hidden;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease,
        background 0.18s ease;
}

button.btn::before {
    content: "";
    position: absolute;
    inset: 1px;

    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.42),
            rgba(255, 255, 255, 0.04) 52%,
            rgba(255, 255, 255, 0.18)
        );

    pointer-events: none;
}

button.btn:hover {
    transform: translateY(-2px);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.36),
        0 20px 46px rgba(23, 63, 115, 0.34),
        0 12px 28px rgba(69, 52, 35, 0.18);

    filter: saturate(1.08) brightness(1.03);
}

button.btn:active {
    transform: translateY(0);
}

button.btn.secondary {
    color: var(--accent);

    border: 1px solid rgba(255, 255, 255, 0.56);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.42),
            rgba(255, 255, 255, 0.18)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 0 18px rgba(255, 255, 255, 0.12),
        0 10px 26px rgba(69, 52, 35, 0.12);
}

button.btn.secondary:hover {
    color: var(--accent-hover);

    border-color: rgba(23, 63, 115, 0.28);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.56),
            rgba(23, 63, 115, 0.08)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 0 22px rgba(255, 255, 255, 0.18),
        0 12px 30px rgba(69, 52, 35, 0.14);
}

button.btn:focus-visible,
.input-field:focus-visible,
.toggle input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(23, 63, 115, 0.24);
    outline-offset: 3px;
}

/* ===== ERROR ===== */

.error {
    display: none;

    margin: 12px 0 0;

    color: #9f2f2f;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;

    padding: 10px 12px;
    border-radius: 16px;

    background: rgba(159, 47, 47, 0.08);
    border: 1px solid rgba(159, 47, 47, 0.16);
}

/* ===== CHECKBOX ===== */

.toggle {
    margin-top: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;

    accent-color: var(--accent);
    cursor: pointer;
}

/* ===== ANIMATION ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== MOBILE ===== */

@media (max-width: 480px) {
    body {
        padding: 18px;
        align-items: flex-start;
        padding-top: 14vh;
    }

    .auth-wrap {
        width: 100%;
        padding: 26px 20px 22px;
        border-radius: 28px;

        backdrop-filter: blur(28px) saturate(1.32) contrast(1.05);
        -webkit-backdrop-filter: blur(28px) saturate(1.32) contrast(1.05);
    }

    .auth-wrap::before {
        border-radius: 27px;
    }

    h1 {
        font-size: 25px;
    }

    p.desc {
        font-size: 13px;
    }

    .input-field {
        border-radius: 16px;
        font-size: 15px;
    }

    button.btn {
        min-height: 46px;
        font-size: 15px;
    }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    .auth-wrap,
    .input-field,
    button.btn {
        animation: none !important;
        transition: none !important;
    }
}