:root {
    color-scheme: dark;
    --bg: #10110f;
    --ink: #ecece5;
    --muted: #9b9d94;
    --line: rgba(236, 236, 229, 0.12);
    --panel: rgba(23, 25, 22, 0.84);
    --panel-strong: #1d211b;
    --accent: #a7b39a;
    --accent-dark: #7f8e74;
    --shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 78% 18%, rgba(167, 179, 154, 0.16), transparent 28%),
        radial-gradient(circle at 14% 82%, rgba(108, 118, 127, 0.18), transparent 30%),
        linear-gradient(145deg, #0d0e0d 0%, var(--bg) 48%, #151812 100%);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
    overflow-x: hidden;
}

body::before,
body::after {
    position: fixed;
    content: "";
    inset: auto;
    pointer-events: none;
    border: 1px solid rgba(236, 236, 229, 0.08);
    animation: drift 12s ease-in-out infinite alternate;
}

body::before {
    width: 42vw;
    height: 42vw;
    min-width: 260px;
    min-height: 260px;
    right: -14vw;
    top: -16vw;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(167, 179, 154, 0.08), transparent);
}

body::after {
    width: 22vw;
    height: 22vw;
    min-width: 180px;
    min-height: 180px;
    left: -9vw;
    bottom: -10vw;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(236, 236, 229, 0.05), transparent);
    animation-delay: -4s;
}

.page {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 18px;
}

.brand {
    position: fixed;
    top: 22px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    animation: fade-up 700ms ease both;
    z-index: 3;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(236, 236, 229, 0.18);
    border-radius: 10px;
    background: linear-gradient(145deg, var(--accent), #d6dacb);
    color: #11130f;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(236, 236, 229, 0.88);
}

.shell {
    position: relative;
    width: min(100%, 440px);
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    animation: fade-up 850ms 80ms ease both;
    overflow: hidden;
}

.shell::before {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%);
    content: "";
    pointer-events: none;
}

.shell > * {
    position: relative;
}

.intro {
    margin-bottom: 30px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2.35rem, 8vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: 0;
    color: #f4f4ee;
}

.subtitle {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: rgba(7, 8, 7, 0.52);
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus {
    border-color: rgba(167, 179, 154, 0.72);
    box-shadow: 0 0 0 4px rgba(167, 179, 154, 0.14);
    transform: translateY(-1px);
}

input::selection {
    background: rgba(167, 179, 154, 0.3);
}

button,
.button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(236, 236, 229, 0.18);
    border-radius: 14px;
    padding: 0 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
        linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #10110f;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 16px 34px rgba(0, 0, 0, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover,
.button:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 20px 42px rgba(0, 0, 0, 0.38);
}

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

.button.secondary {
    margin-top: 22px;
    background: rgba(236, 236, 229, 0.04);
    color: var(--ink);
}

.error {
    margin: 0;
    border: 1px solid rgba(224, 149, 127, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(224, 149, 127, 0.08);
    color: #f0d1c8;
    font-size: 0.92rem;
    animation: shake 280ms ease;
}

.welcome {
    display: grid;
    gap: 16px;
}

.welcome h1 {
    font-size: clamp(2.3rem, 8vw, 4rem);
}

.status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 650;
    background: rgba(167, 179, 154, 0.07);
}

.status::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    to {
        transform: translate3d(-18px, 16px, 0) rotate(8deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    30% {
        transform: translateX(-5px);
    }

    70% {
        transform: translateX(5px);
    }
}

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

@media (max-width: 520px) {
    .brand {
        left: 18px;
        top: 18px;
    }

    .shell {
        padding: 28px 22px;
    }
}
