body {
    background: #050508;
    background-image:
        radial-gradient(ellipse at 50% -10%, rgb(16 185 129 / 10%) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 110%, rgb(59 130 246 / 6%) 0%, transparent 45%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, Inter, 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 1.5rem;
    box-sizing: border-box;
}

.login {
    width: 100%;
    max-width: 380px;
    background: rgb(255 255 255 / 2.5%);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 18px;
    padding: 2.75rem 2.5rem;
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 3.5%),
        0 30px 60px rgb(0 0 0 / 70%),
        0 0 100px rgb(16 185 129 / 5%);
}

/* Radar logo animation */
.login-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.radar-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid #10b981;
    animation: ring-pulse 2.4s ease-out infinite;
    opacity: 0;
}

.radar-ring:nth-child(1) { animation-delay: 0s; }
.radar-ring:nth-child(2) { animation-delay: 0.8s; }
.radar-ring:nth-child(3) { animation-delay: 1.6s; }

@keyframes ring-pulse {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.8;
    }

    100% {
        width: 52px;
        height: 52px;
        opacity: 0;
    }
}

.radar-dot {
    width: 9px;
    height: 9px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px #10b981, 0 0 22px rgb(16 185 129 / 50%), 0 0 40px rgb(16 185 129 / 20%);
}

/* Heading */
.login h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem;
}

.login-tagline {
    text-align: center;
    font-size: 0.875rem;
    color: #fff;
    margin: 0 0 2.25rem;
    letter-spacing: 0.02em;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    background: rgb(255 255 255 / 4.5%);
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 9px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-sizing: border-box;
    appearance: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    background: rgb(255 255 255 / 7%);
    border-color: rgb(16 185 129 / 55%);
    box-shadow: 0 0 0 3px rgb(16 185 129 / 14%);
}

input:-webkit-autofill {
    box-shadow: 0 0 0 100px #0d1117 inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
}

/* Submit */
button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 9px;
    padding: 0.875rem;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    margin-top: 0.375rem;
    letter-spacing: 0.015em;
    box-shadow: 0 4px 16px rgb(16 185 129 / 35%), inset 0 1px 0 rgb(255 255 255 / 15%);
}

button[type="submit"]:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgb(16 185 129 / 45%), inset 0 1px 0 rgb(255 255 255 / 15%);
}

button[type="submit"]:active {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 3px 10px rgb(16 185 129 / 30%);
}

/* Error */
.alert-danger {
    background: rgb(239 68 68 / 10%);
    border: 1px solid rgb(239 68 68 / 22%);
    color: #fca5a5;
    border-radius: 9px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Code input — big, centered, monospace (2FA + TOTP setup) */
.code-input {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    letter-spacing: 0.4rem;
    padding: 1rem !important;
    height: auto;
    font-weight: 600;
}

/* TOTP setup page (wider card) */
.login-wide {
    max-width: 460px;
}

.setup-step {
    margin: 0 0 1.75rem;
}

.setup-step:last-of-type {
    margin-bottom: 0;
}

.setup-step h2 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.setup-help {
    color: #fff;
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.qr-enrol {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
}

.qr-enrol img {
    display: block;
}

.link-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.875rem;
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
    margin: 0 0 0.5rem;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
}

.link-button:hover {
    color: #10b981;
}

.manual-secret {
    background: rgb(255 255 255 / 5%);
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 9px;
    padding: 0.75rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: #fff;
    letter-spacing: 0.1em;
    text-align: center;
    word-break: break-all;
    user-select: all;
}

.hidden {
    display: none;
}

/* Footer link (Sign out on 2FA screen) */
.login-foot {
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: 0.8125rem;
}

.login-foot a {
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.login-foot a:hover {
    color: #10b981;
}
