/**
 * Shared visuals for user register / login and admin login.
 * Scoped to body.auth-page — does not affect app chrome elsewhere.
 */

body.auth-page {
    position: relative;
    isolation: isolate;
    background: transparent;
    padding: clamp(1rem, 4vw, 2rem);
}

/* Full-viewport background image + cinematic overlays */
body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-color: #111827;
    background-image:
        linear-gradient(
            165deg,
            rgba(17, 24, 39, 0.88) 0%,
            rgba(249, 115, 22, 0.22) 42%,
            rgba(17, 24, 39, 0.9) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.35) 0%,
            transparent 40%,
            rgba(0, 0, 0, 0.5) 100%
        ),
        url("/chopbeta/public/assets/auth-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Admin: cooler slate wash over the same art direction */
body.auth-page--admin::before {
    background-image:
        linear-gradient(
            165deg,
            rgba(15, 23, 42, 0.92) 0%,
            rgba(59, 130, 246, 0.12) 45%,
            rgba(15, 23, 42, 0.94) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(15, 23, 42, 0.5) 0%,
            transparent 45%,
            rgba(15, 23, 42, 0.65) 100%
        ),
        url("/chopbeta/public/assets/auth-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Soft floating rim light (no layout impact) */
body.auth-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 90% 55% at 50% 110%,
        rgba(249, 115, 22, 0.28) 0%,
        transparent 52%
    );
    animation: auth-rim-glow 10s ease-in-out infinite alternate;
}

body.auth-page--admin::after {
    background: radial-gradient(
        ellipse 85% 50% at 50% 108%,
        rgba(96, 165, 250, 0.18) 0%,
        transparent 50%
    );
    animation: auth-rim-glow-admin 12s ease-in-out infinite alternate;
}

@keyframes auth-rim-glow {
    0% {
        opacity: 0.75;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes auth-rim-glow-admin {
    0% {
        opacity: 0.65;
    }
    100% {
        opacity: 0.95;
    }
}

/* Frosted card */
body.auth-page .card {
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.94) 0%,
        rgba(255, 247, 237, 0.9) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow:
        12px 12px 28px rgba(0, 0, 0, 0.28),
        -6px -6px 18px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.auth-page--admin .card {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.93) 0%,
        rgba(241, 245, 249, 0.88) 100%
    );
    box-shadow:
        0 28px 64px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(148, 163, 184, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Primary actions — neumorphic orange */
body.auth-page .btn {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, #FF8A2A 0%, #F97316 45%, #EA580C 100%) !important;
    box-shadow:
        6px 6px 14px rgba(212, 95, 12, 0.4),
        -4px -4px 12px rgba(255, 176, 112, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition:
        transform 0.18s ease,
        box-shadow 0.2s ease,
        filter 0.15s ease;
}

body.auth-page .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        7px 7px 16px rgba(212, 95, 12, 0.45),
        -5px -5px 12px rgba(255, 176, 112, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.auth-page .btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 4px 4px 10px rgba(180, 75, 8, 0.45),
        inset -3px -3px 8px rgba(255, 160, 90, 0.25);
}

/* Inputs: gentle lift on focus */
body.auth-page input:not([type="checkbox"]):not([type="radio"]),
body.auth-page select {
    transition:
        border-color 0.2s ease,
        box-shadow 0.25s ease;
}

body.auth-page input:focus,
body.auth-page select:focus {
    box-shadow:
        0 0 0 3px rgba(249, 115, 22, 0.18),
        0 0 24px rgba(249, 115, 22, 0.12);
}

/* Footer links */
body.auth-page .link a {
    transition:
        color 0.2s ease,
        text-shadow 0.25s ease,
        filter 0.2s ease;
}

body.auth-page .link a:hover {
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.45);
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.35));
}

body.auth-page--admin .link a:hover {
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.4);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.35));
}

/* Password visibility toggle (register) */
body.auth-page .pw-toggle:hover {
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.35);
}

/* Logo + title block (user login & register) */
body.auth-page .auth-card-head {
    text-align: center;
    margin-bottom: 1rem;
}

body.auth-page .auth-card-head .cb-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.75rem;
    margin: 0 auto 0.85rem;
    font-weight: 900;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
    color: var(--text-main, #1f2937);
}

body.auth-page .auth-card-head .cb-brand span {
    color: var(--brand, #ff7a00);
}

body.auth-page .auth-card-head .cb-brand img.cb-brandlogo {
    max-height: 52px;
    width: auto;
    max-width: min(240px, 100%);
    object-fit: contain;
    display: block;
}

body.auth-page .auth-card-head h1 {
    margin: 0 0 0.5rem;
    font-size: 1.55rem;
    line-height: 1.25;
    text-align: center;
}

body.auth-page .auth-card-head .subtext {
    margin: 0 auto;
    max-width: 28rem;
    line-height: 1.55;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page::after {
        animation: none;
    }

    body.auth-page .btn {
        transition: none;
    }

    body.auth-page .btn:hover {
        transform: none;
    }
}
