/* Admin authentication screens */

.auth-page {
    display: grid;
    place-items: center;
    padding: 26px;
    background:
        radial-gradient(circle at 25% 18%, rgba(196, 18, 24, 0.08), transparent 28%),
        linear-gradient(135deg, #f7fafc 0%, #edf3f8 48%, #f4f7fb 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(285px, 330px) minmax(330px, 370px);
    width: min(100%, 700px);
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(17, 24, 39, 0.16);
    animation: auth-shell-in 520ms ease both;
}

.auth-card,
.panel,
.metric-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 34px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: auth-panel-in 620ms ease 80ms both;
}

.auth-title {
    margin-bottom: 22px;
}

.auth-title p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-title span,
.page-heading p,
.metric-card span {
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-title h1,
.page-heading h1 {
    margin: 4px 0 0;
    font-size: 1.8rem;
    font-weight: 800;
}

.auth-title span {
    color: #c5161d;
    font-size: 0.68rem;
    font-weight: 800;
}

.auth-title h1 {
    margin-top: 4px;
    color: #171116;
    font-size: 1.62rem;
    letter-spacing: 0;
}

.auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 62px 32px 42px;
    background:
        linear-gradient(155deg, rgba(197, 22, 29, 0.12) 0%, rgba(29, 23, 27, 0) 46%),
        #1d171b;
    color: #ffffff;
    overflow: hidden;
}

.auth-intro::after {
    content: "";
    position: absolute;
    right: -84px;
    bottom: -84px;
    width: 210px;
    height: 210px;
    border: 17px solid rgba(255, 255, 255, 0.055);
    border-radius: 999px;
    animation: auth-ring-float 7s ease-in-out infinite;
}

.auth-intro > * {
    position: relative;
    z-index: 1;
}

.auth-intro span {
    color: #f3c7c9;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-intro p {
    margin: 8px 0 0;
    max-width: 245px;
    color: #d8d2d6;
    font-size: 0.75rem;
    line-height: 1.65;
}

.auth-modern-brand {
    display: inline-flex;
    width: min(100%, 278px);
    min-height: 165px;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: auto 0;
    padding: 0;
    text-decoration: none;
    transition: transform 180ms ease, filter 180ms ease;
}

.auth-modern-brand img {
    display: block;
    width: 100%;
    max-height: 134px;
    filter: brightness(0) invert(1);
    object-fit: contain;
    animation: auth-logo-in 680ms ease 160ms both;
}

.auth-modern-brand:hover {
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.22));
    transform: translateY(-2px);
}

.stack-form {
    display: grid;
    gap: 13px;
}

.stack-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-card .form-control {
    min-height: 42px;
    padding: 9px 12px;
    border-color: #dfe4ea;
    border-radius: 7px;
    background-color: #f4f8ff;
    font-size: 0.82rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.auth-card .form-control:focus {
    border-color: #c5161d;
    background-color: #ffffff;
    box-shadow: 0 0 0 0.18rem rgba(197, 22, 29, 0.13);
    transform: translateY(-1px);
}

.auth-link {
    display: inline-block;
    color: #c5161d;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
}

.auth-link:hover {
    color: #8f1117;
    transform: translateY(-1px);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 12px;
}

.secondary-auth-link {
    color: var(--muted);
}

.auth-back-link {
    margin-top: 10px;
}

.auth-submit {
    position: relative;
    min-height: 42px;
    overflow: hidden;
    border: 0;
    border-radius: 7px;
    background: #c5161d;
    box-shadow: 0 12px 24px rgba(197, 22, 29, 0.24);
    font-size: 0.88rem;
    font-weight: 800;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-submit:hover {
    background: #a91318;
    box-shadow: 0 16px 30px rgba(197, 22, 29, 0.28);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    line-height: 1;
}

.password-toggle:hover,
.password-toggle.is-visible {
    background: #f1e8e9;
    color: #c5161d;
}

@keyframes auth-shell-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }

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

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateX(14px);
    }

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

@keyframes auth-logo-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.94);
    }

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

@keyframes auth-ring-float {
    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-8px, -6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-card,
    .auth-modern-brand img,
    .auth-intro::after {
        animation: none;
    }

    .auth-modern-brand,
    .auth-card .form-control,
    .auth-link,
    .auth-submit {
        transition: none;
    }
}

