:root {
    --login-bg: #041a13;
    --login-bg-soft: #0b382a;
    --login-panel: #0d4634;
    --login-panel-strong: #15724e;
    --login-border: rgba(245, 250, 248, 0.16);
    --login-border-strong: rgba(1, 227, 164, 0.68);
    --login-text: #f5faf8;
    --login-muted: #c7ddd5;
    --login-subtle: #94b9ab;
    --login-accent: #01e3a4;
    --login-accent-strong: #79f2d0;
    --login-danger-bg: rgba(220, 53, 69, 0.16);
    --login-danger-border: rgba(248, 113, 113, 0.45);
    --login-danger-text: #fecaca;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--login-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Exo 2", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 78% 18%, rgba(1, 227, 164, 0.22), transparent 26%),
        linear-gradient(135deg, rgba(32, 169, 121, 0.18), transparent 38%),
        linear-gradient(180deg, var(--login-bg-soft), var(--login-bg));
    color: var(--login-text);
    overflow-x: hidden;
}

.login-shell {
    width: min(400px, calc(100% - 32px));
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.login-brand {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 560px;
}

.brand-mark {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border: 1px solid var(--login-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.brand-mark img,
.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--login-accent-strong);
    font-size: 0.86rem;
    font-weight: 800;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 14ch;
    margin-bottom: 18px;
    color: var(--login-text);
    font-family: "Brice SemiExpanded", "Exo 2", sans-serif;
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: 0;
    text-wrap: balance;
}

.brand-copy {
    max-width: 58ch;
    margin-bottom: 0;
    color: var(--login-muted);
    font-size: 1rem;
    line-height: 1.7;
    text-wrap: pretty;
}

.brand-status {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--login-border);
    border-radius: 999px;
    color: var(--login-muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.9rem;
    font-weight: 600;
}

.brand-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.login-panel {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border: 1px solid var(--login-border);
    border-radius: 14px;
    background: var(--login-panel);
    box-shadow: 0 24px 70px rgba(2, 22, 16, 0.38);
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    width: min(230px, 82%);
}

.logo img { height: auto; }

.login-intro h1 { max-width: none; margin-bottom: 8px; }

.login-intro .eyebrow { margin-bottom: 8px; }

h2 {
    margin-bottom: 4px;
    color: var(--login-text);
    font-size: 1.35rem;
    line-height: 1.2;
}

.subtitle {
    margin: 0;
    color: var(--login-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.form-group {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    color: var(--login-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-input {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    outline: none;
    background: rgba(4, 26, 19, 0.32);
    color: var(--login-text);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-input:hover {
    border-color: rgba(203, 213, 225, 0.24);
}

.form-input:focus {
    border-color: var(--login-border-strong);
    background: rgba(4, 26, 19, 0.46);
    box-shadow: 0 0 0 3px rgba(1, 227, 164, 0.18);
}

.btn-login {
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--login-accent);
    color: #073326;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.btn-login:hover {
    background: var(--login-accent-strong);
}

.btn-login:focus-visible {
    outline: 3px solid rgba(1, 227, 164, 0.34);
    outline-offset: 3px;
}

.btn-login:active {
    transform: translateY(1px);
}

.btn-login:disabled {
    cursor: wait;
    opacity: 0.72;
}

.error-message {
    display: none;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--login-danger-border);
    border-radius: 8px;
    background: var(--login-danger-bg);
    color: var(--login-danger-text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.error-message.show {
    display: block;
}

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--login-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(1, 227, 164, 0.28);
    border-top-color: var(--login-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 840px) {
    .login-shell {
        padding: 32px 0;
        max-width: 440px;
    }

    .login-brand {
        gap: 18px;
        max-width: 100%;
    }

    h1 {
        max-width: 100%;
        font-size: 2rem;
    }

    .brand-copy {
        font-size: 0.96rem;
    }
}

@media (max-width: 520px) {
    .login-shell {
        width: min(100% - 24px, 400px);
        min-height: 100svh;
        padding: 24px 0;
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        max-width: none;
        padding: 22px;
    }

    .login-header {
        align-items: center;
        margin-bottom: 24px;
    }
}

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