:root {
    --auth-primary: #dc2626;
    --auth-primary-soft: #fee2e2;
    --auth-accent: #1f4d9d;
    --auth-text: #1e2b45;
    --auth-muted: #5f6779;
    --auth-border: #f3d0d0;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f8fc;
    color: var(--auth-text);
    overflow: hidden;
}

.auth-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.auth-grid span {
    position: absolute;
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    animation: auth-float 7s ease-in-out infinite;
}

.auth-grid span:nth-child(1) { top: 12%; left: 14%; animation-delay: .1s; }
.auth-grid span:nth-child(2) { top: 22%; left: 78%; animation-delay: .4s; }
.auth-grid span:nth-child(3) { top: 42%; left: 9%; animation-delay: .6s; }
.auth-grid span:nth-child(4) { top: 58%; left: 82%; animation-delay: .2s; }
.auth-grid span:nth-child(5) { top: 74%; left: 14%; animation-delay: .5s; }
.auth-grid span:nth-child(6) { top: 81%; left: 74%; animation-delay: .9s; }
.auth-grid span:nth-child(7) { top: 31%; left: 55%; animation-delay: .7s; }
.auth-grid span:nth-child(8) { top: 68%; left: 48%; animation-delay: .3s; }

@keyframes auth-float {
    0%, 100% {
        transform: translateY(0);
        opacity: .25;
    }
    50% {
        transform: translateY(-10px);
        opacity: .7;
    }
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel {
    width: min(460px, 100%);
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(2, 16, 43, 0.45);
    padding: 28px 28px 22px;
}

.auth-panel-denied {
    text-align: center;
}

.auth-head {
    margin-bottom: 18px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    padding: 10px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #f3d0d0;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.12);
}

.auth-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-logo-centered {
    margin: 0 auto 10px;
}

.auth-kicker {
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .73rem;
    margin: 12px 0 4px;
}

.auth-head h1,
.auth-panel h1 {
    margin: 0;
    font-size: 1.56rem;
    color: var(--auth-text);
    font-weight: 700;
}

.auth-subtitle {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: .95rem;
}

.auth-role-pill {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-weight: 600;
    font-size: .78rem;
}

.auth-input {
    border-color: var(--auth-border);
    border-radius: .72rem;
    min-height: 44px;
}

.auth-password-field {
    position: relative;
}

.auth-password-input {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--auth-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-password-toggle:focus-visible {
    outline: 3px solid rgba(220, 38, 38, .22);
    outline-offset: 2px;
}

.auth-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .22);
}

.auth-submit {
    border: 0;
    border-radius: .72rem;
    min-height: 44px;
    font-weight: 600;
    background: linear-gradient(130deg, #ef4444, #b91c1c);
    color: #ffffff;
}

.auth-submit:hover {
    background: linear-gradient(130deg, #f87171, #dc2626);
    color: #ffffff;
}

.auth-submit:disabled {
    opacity: .78;
}

.auth-foot {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-foot a {
    color: var(--auth-accent);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
}

.auth-foot a:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .auth-panel {
        border-radius: 14px;
        padding: 22px 18px 18px;
    }

    .auth-head h1,
    .auth-panel h1 {
        font-size: 1.35rem;
    }
}
