/* =========================================================
   LOGIN + REGISTER BACKGROUND
   Loaded only by Views/Account/Login.cshtml and Register.cshtml
   ========================================================= */

/* Full-screen picture behind the page (does not scroll) */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(12, 35, 78, 0.82), rgba(31, 78, 140, 0.62) 55%, rgba(120, 170, 220, 0.45)), url('/images/auth-lab-bg.jpg') center / cover no-repeat;
}

    /* Soft floating glow circles for a modern look */
    .auth-bg::before,
    .auth-bg::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        filter: blur(60px);
        opacity: .45;
        animation: authFloat 14s ease-in-out infinite alternate;
    }

    .auth-bg::before {
        width: 420px;
        height: 420px;
        background: #4f8fd8;
        top: -120px;
        left: -100px;
    }

    .auth-bg::after {
        width: 360px;
        height: 360px;
        background: #9cc7f2;
        bottom: -120px;
        right: -80px;
        animation-delay: -6s;
    }

@keyframes authFloat {
    to {
        transform: translate(40px, 30px) scale(1.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg::before, .auth-bg::after {
        animation: none;
    }
}

/* Stops the page shifting sideways when a scrollbar appears/disappears */
html {
    scrollbar-gutter: stable;
}

/* Page wrapper (both pages) */
.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 14px 110px;
}

/* ---------- The card ---------- */
.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(5, 20, 50, 0.5), 0 2px 6px rgba(5, 20, 50, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

    .auth-card.auth-wide {
        max-width: 760px;
    }

.auth-card-body {
    padding: 26px 30px 30px;
}

/* Brand header */
.auth-brand {
    background: #2563EB;
    color: #fff;
    padding: 22px 30px 18px;
    text-align: center;
}

.auth-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: 2px solid rgba(255, 255, 255, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.auth-brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: .3px;
}

.auth-brand p {
    margin: 2px 0 0;
    font-size: .85rem;
    opacity: .8;
}

/* Sign in / Register switch */
.auth-tabs {
    display: flex;
    background: #e8eef7;
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 22px;
}

    .auth-tabs a {
        flex: 1;
        text-align: center;
        padding: 8px 0;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 500;
        color: #5b6b86;
        transition: background .2s, color .2s;
    }

        .auth-tabs a.active {
            background: #fff;
            color: #12306a;
            box-shadow: 0 2px 8px rgba(18, 48, 106, .18);
        }

.auth-title {
    color: #12306a;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 18px;
}

/* Section headings (Register) */
.auth-section {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2a5fa8;
    border-bottom: 1px solid #dbe5f3;
    padding-bottom: 5px;
    margin: 20px 0 12px;
}

/* Fields */
.auth-card .form-label {
    font-size: .85rem;
    font-weight: 500;
    color: #243556 !important;
    margin-bottom: 4px;
}

.auth-card .input-group-text {
    background: #f1f5fb;
    border-color: #ced8e8;
    color: #2a5fa8;
}

.auth-card .form-control,
.auth-card .form-select {
    background: #fff !important;
    border-color: #ced8e8;
    color: #1b2a47 !important;
}

    .auth-card .form-control:focus,
    .auth-card .form-select:focus {
        border-color: #2a5fa8;
        box-shadow: 0 0 0 .2rem rgba(42, 95, 168, .18);
    }

.auth-btn {
    width: 100%;
    background: #2563EB;
    border: 0;
    color: #fff;
    padding: 11px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: .3px;
    transition: transform .15s, box-shadow .15s;
}

    .auth-btn:hover {
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
    }

.auth-links a {
    color: #2a5fa8;
    font-size: .9rem;
    text-decoration: none;
}

    .auth-links a:hover {
        text-decoration: underline;
    }

.auth-foot {
    text-align: center;
    color: #7a89a3;
    font-size: .78rem;
    margin-top: 18px;
}

/* Error message: floats over the page so nothing moves */
.auth-toast {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
    width: min(380px, 92vw);
    background: #fdecec;
    color: #8a1c1c;
    border: 1px solid #f3b4b4;
    border-left: 5px solid #d33;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
    font-size: .92rem;
    animation: authToastIn .3s ease;
}

@keyframes authToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
}

/* Register page: remove old site-wide look */
.register-page {
    background: none !important;
}

/* Card + error message under it.
   The message is positioned absolutely under the card, so it takes no
   space in the page: the card can never move when it appears or leaves. */
.auth-stack {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.auth-error {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 14px;
    background: #fdecec;
    color: #8a1c1c;
    border: 1px solid #f3b4b4;
    border-left: 5px solid #d33;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: .92rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
    opacity: 0;
    animation: authErrIn .45s ease .1s forwards;
    transition: opacity .6s ease;
}

    .auth-error.hide {
        opacity: 0 !important;
        animation: none;
    }

@keyframes authErrIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------- Sign-in page: wider card, centred, never scrolls ---------- */
.auth-login {
    height: calc(100vh - 58px);
    min-height: 0;
    align-items: center;
    padding: 0 14px 70px; /* bottom room for the error message */
    overflow: hidden;
}

    .auth-login .auth-stack {
        max-width: 540px;
    }

    .auth-login .auth-card-body {
        padding: 26px 40px 30px;
    }

/* Short screens: tighten the card so it still fits without scrolling */
@media (max-height: 760px) {
    .auth-login .auth-brand {
        padding: 14px 24px 12px;
    }

    .auth-login .auth-logo {
        width: 42px;
        height: 42px;
        font-size: 20px;
        margin-bottom: 6px;
    }

    .auth-login .auth-card-body {
        padding: 18px 32px 20px;
    }

    .auth-login .auth-tabs {
        margin-bottom: 14px;
    }

    .auth-login .mb-3 {
        margin-bottom: .7rem !important;
    }

    .auth-login .auth-foot {
        margin-top: 10px;
    }
}

@media (max-height: 640px) {
    .auth-login .auth-logo, .auth-login .auth-brand p, .auth-login .auth-foot {
        display: none;
    }
}
