/*
  Login / account pages (everything on _LoginLayout) - Modena360 branded split screen.
  Left: brand panel on an animated indigo background with particles. Right: the page's own card.
  The views keep their markup (#wrapper > .login-register > .login-box.card); this restyles it.
  Scoped to body.m360-auth, loaded after the older login stylesheets so it wins.
*/

.m360-auth {
    --auth-purple: #7c3aed;
    --auth-purple-dark: #6d28d9;
    --auth-magenta: #c026d3;
    --auth-heading: #111827;
    --auth-body: #455a64;
    --auth-subtle: #6b7280;
    --auth-border: #e2e8f0;
    --auth-spectrum: linear-gradient(90deg, #2F2A95 0%, #6558B1 20%, #924E9C 40%, #CF578A 60%, #ED9B33 80%, #F1BE48 100%);

    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    color: var(--auth-body);
    background: #1e1b4b;
    overflow-x: hidden;
}

/* ---------- animated background ---------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(124, 58, 237, .35) 0%, transparent 55%),
        linear-gradient(135deg, #17153b 0%, #2d2070 45%, #4c1d95 100%);
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
    will-change: transform;
}

.auth-blob.b1 { width: 520px; height: 520px; background: #7c3aed; top: -140px; left: -120px; animation: auth-drift-1 18s ease-in-out infinite alternate; }
.auth-blob.b2 { width: 460px; height: 460px; background: #c026d3; bottom: -160px; left: 30%; opacity: .4; animation: auth-drift-2 22s ease-in-out infinite alternate; }
.auth-blob.b3 { width: 380px; height: 380px; background: #f97316; top: 10%; right: -120px; opacity: .3; animation: auth-drift-3 20s ease-in-out infinite alternate; }

@keyframes auth-drift-1 { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes auth-drift-2 { to { transform: translate(-120px, -110px) scale(1.1); } }
@keyframes auth-drift-3 { to { transform: translate(-90px, 140px) scale(.9); } }

/* particles.js draws here (Scripts/Particles/Particles.js) - overrides the old gradient in particles.css */
.auth-bg #particles-js {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: none;
}

/* ---------- split layout ---------- */
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    pointer-events: none; /* the particles canvas underneath reacts to the mouse... */
}

.auth-shell .auth-main > *,
.auth-shell .auth-brand a {
    pointer-events: auto; /* ...except over the card and links */
}

.auth-brand {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 7vw;
    color: #ffffff;
}

.auth-brand-logo {
    width: 230px;
    max-width: 70%;
    margin-bottom: 48px;
    animation: auth-rise .7s cubic-bezier(.22, .9, .32, 1) both;
}

.auth-eyebrow {
    font-family: "Archivo", "Poppins", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #f0abfc;
    margin-bottom: 14px;
    animation: auth-rise .7s .08s cubic-bezier(.22, .9, .32, 1) both;
}

.auth-headline {
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 16px;
    color: #ffffff;
    animation: auth-rise .7s .14s cubic-bezier(.22, .9, .32, 1) both;
}

.auth-headline span {
    background: linear-gradient(90deg, #f0abfc 0%, #fdba74 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-lead {
    max-width: 460px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
    margin: 0 0 36px;
    animation: auth-rise .7s .2s cubic-bezier(.22, .9, .32, 1) both;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 230px));
    gap: 14px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    animation: auth-rise .7s cubic-bezier(.22, .9, .32, 1) both;
}

.auth-features li:nth-child(1) { animation-delay: .28s; }
.auth-features li:nth-child(2) { animation-delay: .34s; }
.auth-features li:nth-child(3) { animation-delay: .40s; }
.auth-features li:nth-child(4) { animation-delay: .46s; }

.auth-features i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    box-shadow: 0 4px 14px rgba(124, 58, 237, .45);
    font-size: 17px;
    font-style: normal;
}

.auth-features small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, .65);
}

.auth-footer {
    margin-top: 48px;
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
}

.auth-main {
    flex: 0 0 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes auth-card-in {
    0% { opacity: 0; transform: translateY(24px) scale(.96); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.01); }
    100% { opacity: 1; transform: none; }
}

/* ---------- the views' own markup ---------- */
.m360-auth #wrapper {
    width: 100%;
}

.m360-auth .login-register,
.m360-auth .login-register.blue-background {
    position: static;
    height: auto;
    width: 100%;
    padding: 0;
    background: none !important;
}

.m360-auth .login-box,
.m360-auth .login-box.card {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 30px 80px rgba(10, 6, 40, .45), 0 8px 24px rgba(10, 6, 40, .25);
    overflow: hidden;
    animation: auth-card-in .75s .15s cubic-bezier(.22, .9, .32, 1) both;
}

/* brand spectrum line along the top of the card */
.m360-auth .login-box::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--auth-spectrum);
}

.m360-auth .login-box > .card-body {
    padding: 36px 38px 30px;
}

/* the card's logo is only needed when the brand panel is hidden (tablet/phone) */
.m360-auth .login-box .modena-logo {
    background: linear-gradient(135deg, #2d2070 0%, #4c1d95 100%) !important;
    box-shadow: none;
    border-radius: 12px;
    padding: 14px 18px;
    text-align: center;
}

.m360-auth .login-box .modena-logo img {
    max-width: 200px;
    width: 100%;
}

.m360-auth .login-box h3,
.m360-auth .login-box .box-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-heading);
    margin: 0 0 6px;
}

.m360-auth .auth-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--auth-subtle);
    margin: 0 0 24px;
}

/* inputs - boxed instead of the theme's underline */
.m360-auth .form-material .form-group {
    margin-bottom: 14px;
    overflow: visible;
}

.m360-auth .form-material .form-control,
.m360-auth .login-box .form-control {
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--auth-heading);
    background: #f8fafc;
    background-image: none;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.m360-auth .form-material .form-control:hover,
.m360-auth .login-box .form-control:hover {
    border-color: #94a3b8;
}

.m360-auth .form-material .form-control:focus,
.m360-auth .login-box .form-control:focus {
    background: #ffffff;
    background-image: none;
    border-color: var(--auth-purple);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .14);
    outline: 0;
}

.m360-auth .form-control::placeholder {
    color: #9ca3af;
}

.m360-auth .login-box .text-danger,
.m360-auth .field-validation-error {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

/* ...but not the required-field "*" inside a label - keep it on the same line as the label text */
.m360-auth .login-box label .text-danger {
    display: inline;
    font-size: inherit;
    margin-top: 0;
}

/* buttons */
.m360-auth .login-box .btn-lg,
.m360-auth .login-box .btn-block {
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #7c3aed 0%, #c026d3 100%);
    box-shadow: 0 10px 24px rgba(124, 58, 237, .35);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: transform .15s, box-shadow .15s, filter .15s;
}

.m360-auth .login-box .btn-lg:hover,
.m360-auth .login-box .btn-block:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 14px 30px rgba(124, 58, 237, .45);
    color: #ffffff;
}

.m360-auth .login-box .btn-lg:active,
.m360-auth .login-box .btn-block:active,
.m360-auth .login-box .btn-lg:focus,
.m360-auth .login-box .btn-block:focus {
    transform: none;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .25);
}

/* links */
.m360-auth .login-box a:not(.btn) {
    color: var(--auth-purple) !important;
    font-weight: 500;
}

.m360-auth .login-box a:not(.btn):hover {
    color: var(--auth-purple-dark) !important;
    text-decoration: none;
}

.m360-auth .modena-logo a {
    color: inherit !important;
}

/* alerts - softer, rounded */
.m360-auth .login-box .alert {
    border-radius: 10px;
    font-size: 13px;
    border-width: 1px;
}

.m360-auth .login-box .alert-info {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #5b21b6;
}

.m360-auth .login-box .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.m360-auth .login-box .alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.m360-auth .auth-card-foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    text-align: center;
    color: var(--auth-subtle);
}

/* ---------- responsive ---------- */
@media (min-width: 992px) {
    .m360-auth .login-box .modena-logo {
        display: none;
    }
}

@media (max-width: 991px) {
    .auth-brand {
        display: none;
    }

    .auth-main {
        flex: 1 1 auto;
        padding: 32px 16px;
    }
}

@media (max-width: 480px) {
    .m360-auth .login-box > .card-body {
        padding: 28px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-blob,
    .auth-brand-logo,
    .auth-eyebrow,
    .auth-headline,
    .auth-lead,
    .auth-features li,
    .m360-auth .login-box {
        animation: none;
    }
}

/* ================= stress-relief effects (Scripts/App/Login/loginEffects.js) ================= */

/* soft glow that trails the cursor */
.auth-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 132, 252, .32) 0%, rgba(192, 38, 211, .14) 35%, transparent 68%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
    will-change: transform;
}

.auth-spotlight.is-visible {
    opacity: 1;
}

/* click ripples */
.auth-ripple {
    position: absolute;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .6);
    box-shadow: 0 0 18px rgba(196, 132, 252, .55), inset 0 0 12px rgba(196, 132, 252, .35);
    pointer-events: none;
    animation: auth-ripple 1.6s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes auth-ripple {
    0% { opacity: .9; transform: scale(0); }
    100% { opacity: 0; transform: scale(14); }
}

/* ---- "Logging in..." button state (LoginSeparateScreens.cshtml) ---- */
.m360-auth #login-button .login-button-busy {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.m360-auth #login-button.is-busy {
    pointer-events: none;
    cursor: progress;
    opacity: .9;
}
.m360-auth #login-button.is-busy .login-button-text { display: none; }
.m360-auth #login-button.is-busy .login-button-busy { display: inline-flex; }
.m360-auth #login-button .login-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .8s linear infinite;
}
@keyframes login-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .m360-auth #login-button .login-spinner { animation-duration: 2s; }
}

/* ---- wider card for password creation and 2FA setup (views set ViewBag.AuthWideCard) ---- */
.m360-auth.auth-wide .login-box,
.m360-auth.auth-wide .login-box.card {
    max-width: 580px;
}
@media (min-width: 992px) {
    .m360-auth.auth-wide .auth-main {
        flex-basis: 680px;
    }
}

/* ---- "page had expired" notice (_LoginLayout, set by ValidateAntiForgeryTokenOnPostAttribute) ---- */
.auth-expired-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 12px 20px;
    border-radius: 12px;
    background: #ffffff;
    color: #1e1b4b;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(10, 6, 40, .35);
    border-left: 4px solid #f97316;
    transform: translateX(-50%);
    animation: auth-notice-in .5s cubic-bezier(.22, .9, .32, 1) both;
}
.auth-expired-notice .mdi { font-size: 20px; color: #f97316; }
@keyframes auth-notice-in {
    from { opacity: 0; transform: translate(-50%, -16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-expired-notice { animation: none; }
}

/* ---- "You don't have access" page (Areas/Account/Views/Account/NoAccess.cshtml) ---- */
.m360-auth .no-access-icon {
    width: 64px;
    height: 64px;
    margin: 4px auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 30px;
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    box-shadow: 0 8px 20px rgba(192, 38, 211, .35);
}
.m360-auth .no-access-path {
    padding: 1px 6px;
    border-radius: 6px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 12px;
    word-break: break-all;
}
.m360-auth .no-access-switch { margin-top: 12px; }
.m360-auth .login-box .btn-lg.no-access-secondary,
.m360-auth .login-box .btn-lg.no-access-secondary:hover,
.m360-auth .login-box .btn-lg.no-access-secondary:focus {
    background: #ffffff;
    color: #6d28d9 !important;
    border: 1px solid #ddd6fe;
    box-shadow: none;
}
.m360-auth .login-box .btn-lg.no-access-secondary:hover { background: #f5f3ff; }
