/* ─────────────────────────────────────────────────────────────
   LAYOUT BUNDLE — _LoginLayout chrome
   Loaded by Views/Shared/_LoginLayout.cshtml only, for the two
   pages that use it: Login and the public account-deletion form.
   The dark stage, starfield, drifting orbs and hero card have no
   business loading on the other ~30 admin pages.

   This is a layout bundle, not css/pages/auth.css, because both
   of those pages need it — and because a pages/auth.css would be
   linked a second time by _PageStyles on /Auth/Login.
   ────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────
   Login screen v2 — single centered hero card.
   Designed bulletproof: explicit dimensions on the <img> tag,
   no filter:drop-shadow on the image (uses box-shadow on wrapper),
   no pseudo-element rings overlapping it.
   ────────────────────────────────────────────────────────── */

body.login-body { background: transparent; margin: 0; }

.auth-stage {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(ellipse 60% 50% at 80% 20%, #0369A1 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 20% 80%, #075985 0%, transparent 65%),
        linear-gradient(135deg, #0C4A6E 0%, #075985 40%, #0369A1 75%, #0284C7 100%);
}

/* Video background for login page */
.auth-video-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.auth-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(3,105,161,.55) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 20% 80%, rgba(7,89,133,.55) 0%, transparent 65%),
        linear-gradient(135deg, rgba(12,74,110,.6) 0%, rgba(7,89,133,.45) 40%, rgba(3,105,161,.35) 75%, rgba(2,132,199,.25) 100%);
    pointer-events: none;
}

/* Tiny twinkling stars across the bg */
.auth-stage::before {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 2;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.6), transparent 60%),
        radial-gradient(1.5px 1.5px at 80% 60%, rgba(255,255,255,.5), transparent 60%),
        radial-gradient(2px 2px at 50% 20%, rgba(255,255,255,.45), transparent 60%),
        radial-gradient(1px 1px at 70% 85%, rgba(255,255,255,.55), transparent 60%),
        radial-gradient(1.5px 1.5px at 30% 75%, rgba(255,255,255,.45), transparent 60%),
        radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,.45), transparent 60%),
        radial-gradient(1.5px 1.5px at 15% 50%, rgba(255,255,255,.40), transparent 60%);
    background-size: 420px 420px;
    opacity: .85;
    animation: auth-stars 80s linear infinite;
}

@keyframes auth-stars {
    from { background-position: 0 0; }
    to   { background-position: 420px 420px; }
}

/* Floating coloured orbs */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    z-index: 2;
    opacity: .55;
    filter: blur(90px);
}

.auth-orb-1 {
    width: 560px; height: 560px;
    top: -160px; right: -160px;
    background: radial-gradient(circle, #38BDF8 0%, rgba(56,189,248,0) 70%);
    animation: auth-drift-a 14s ease-in-out infinite;
}
.auth-orb-2 {
    width: 520px; height: 520px;
    bottom: -180px; left: -120px;
    background: radial-gradient(circle, #7dd3fc 0%, rgba(125,211,252,0) 70%);
    animation: auth-drift-b 18s ease-in-out infinite;
}
.auth-orb-3 {
    width: 360px; height: 360px;
    top: 12%; left: 18%;
    background: radial-gradient(circle, #0EA5E9 0%, rgba(14,165,233,0) 70%);
    opacity: .45;
    animation: auth-drift-c 22s ease-in-out infinite;
}
.auth-orb-4 {
    width: 320px; height: 320px;
    bottom: 8%; right: 18%;
    background: radial-gradient(circle, #38bdf8 0%, rgba(56,189,248,0) 70%);
    opacity: .40;
    animation: auth-drift-c 26s ease-in-out -10s infinite;
}

@keyframes auth-drift-a {
    0%, 100% { transform: translate(0, 0)   scale(1); }
    50%      { transform: translate(-80px, 100px) scale(1.18); }
}
@keyframes auth-drift-b {
    0%, 100% { transform: translate(0, 0)   scale(1); }
    50%      { transform: translate(110px, -80px) scale(1.20); }
}
@keyframes auth-drift-c {
    0%, 100% { transform: translate(0, 0)   scale(1); }
    33%      { transform: translate(80px, -50px) scale(1.10); }
    66%      { transform: translate(-60px, 70px) scale(.90); }
}

/* Theme toggle floating on the dark stage */
.auth-theme-toggle {
    position: absolute;
    top: 18px;
    inset-inline-start: 18px;
    z-index: 10;
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.20);
    color: #fff;
    backdrop-filter: blur(12px);
}
.auth-theme-toggle:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
    border-color: rgba(255,255,255,.32);
}

/* ── Centered hero card ──────────────────────────────────── */

.auth-hero {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
}

.auth-hero > * {
    opacity: 0;
    animation: auth-fade-up .65s cubic-bezier(.22,.9,.25,1) forwards;
}
.auth-hero-logo     { animation-delay: .05s; }
.auth-hero-title    { animation-delay: .18s; }
.auth-hero-tagline  { animation-delay: .26s; }
.auth-card-v2       { animation-delay: .36s; }
.auth-hero-foot     { animation-delay: .55s; }

@keyframes auth-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── LOGO — bulletproof, no img filter, glow via wrapper ── */

.auth-hero-logo {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 28px;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.22);
    box-shadow:
        0 0 0 6px rgba(56,189,248,.15),
        0 20px 60px rgba(7, 89, 133, .55),
        0 0 36px rgba(125, 211, 252, .35),
        inset 0 1px 0 rgba(255,255,255,.30);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: auth-logo-float 4.5s ease-in-out infinite;
}

@keyframes auth-logo-float {
    0%, 100% { transform: translateY(0)   rotate(0deg); }
    50%      { transform: translateY(-8px) rotate(-1.2deg); }
}

/* The img tag itself — explicit sizing wins over any other CSS */
.auth-hero-logo img {
    display: block !important;
    width: 110px !important;
    height: 110px !important;
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

/* Rotating soft halo behind the logo card */
.auth-hero-logo::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 32px;
    background: conic-gradient(from 0deg,
        rgba(56,189,248,.6), rgba(14,165,233,.4),
        rgba(56,189,248,.5),  rgba(56,189,248,.6));
    z-index: 0;
    filter: blur(14px);
    opacity: .55;
    animation: auth-halo-spin 9s linear infinite;
}

@keyframes auth-halo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Brand title + tagline ──────────────────────────────── */

.auth-hero-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -.6px;
    margin: 0 0 6px;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #e9d5ff 55%, #7dd3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 4px 24px rgba(125, 211, 252, .25);
}

.auth-hero-tagline {
    margin: 0 0 28px;
    color: rgba(255,255,255,.82);
    font-size: 15px;
    font-weight: 500;
}

.auth-hero-foot {
    margin: 22px 0 0;
    color: rgba(255,255,255,.55);
    font-size: 12px;
}

/* ── Form card ──────────────────────────────────────────── */

.auth-card-v2 {
    width: 100%;
    padding: 32px 28px 28px;
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255,255,255,.30);
    box-shadow:
        0 30px 80px rgba(20, 11, 58, .50),
        0 0 0 1px rgba(167, 139, 250, .08),
        inset 0 1px 0 rgba(255, 255, 255, .80);
    color: var(--ea-text);
    text-align: start;
}

:root[data-theme="dark"] .auth-card-v2 {
    background: rgba(33, 28, 54, .88);
    border-color: rgba(167, 139, 250, .18);
    color: #f3f0ff;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(167, 139, 250, .15);
}

.auth-card-head { margin-bottom: 18px; }
.auth-card-head h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--ea-text);
}
.auth-card-head h2 .wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: auth-wave 1.6s ease-in-out infinite;
}
.auth-card-head p {
    color: var(--ea-muted);
    font-size: 13px;
    margin: 0;
}

@keyframes auth-wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%           { transform: rotate(14deg); }
    20%           { transform: rotate(-8deg); }
    30%           { transform: rotate(14deg); }
    40%           { transform: rotate(-4deg); }
    50%           { transform: rotate(10deg); }
}

/* Floating-label inputs */
.field-float {
    position: relative;
    margin-bottom: 16px;
}

.field-float .form-control {
    height: 56px;
    padding: 22px 16px 8px 44px;
    font-size: 15px;
    border-radius: 14px;
    background: rgba(2, 132, 199, .04);
    border: 1.5px solid var(--ea-border);
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}

:root[data-theme="dark"] .field-float .form-control {
    background: rgba(167, 139, 250, .07);
}

.field-float .form-control:focus {
    background: var(--ea-card);
    border-color: var(--ea-primary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, .14);
}

.field-float .form-control::placeholder { color: transparent; }

.field-float label {
    position: absolute;
    top: 18px;
    inset-inline-start: 44px;
    color: var(--ea-muted);
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    pointer-events: none;
    transition: transform .18s ease, color .18s ease, font-size .18s ease;
}

.field-float .form-control:focus ~ label,
.field-float .form-control:not(:placeholder-shown) ~ label {
    transform: translateY(-12px);
    font-size: 11px;
    color: var(--ea-primary);
    font-weight: 600;
}

.field-float .field-icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ea-muted);
    font-size: 18px;
    pointer-events: none;
    transition: color .18s ease;
}

.field-float .form-control:focus ~ .field-icon {
    color: var(--ea-primary);
}

.field-float .field-trailing {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--ea-muted);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
}
.field-float .field-trailing:hover {
    color: var(--ea-primary);
    background: var(--ea-primary-soft);
}

.auth-card-v2 .form-check-label {
    color: var(--ea-text-2);
    font-size: 14px;
}

/* Submit button — gradient + shimmer + arrow shift */
.btn-login {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: var(--ea-primary-grad);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(2, 132, 199, .35);
    transition: transform .15s ease, box-shadow .2s ease;
}

.btn-login::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
    transition: inset-inline-start .6s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(2, 132, 199, .50);
}
.btn-login:hover::before { inset-inline-start: 120%; }
.btn-login:active        { transform: translateY(0) scale(.99); }

.btn-login .arrow { transition: transform .18s ease; }
html[dir="rtl"] .btn-login:hover .arrow { transform: translateX(-4px); }

.btn-login.is-loading .label,
.btn-login.is-loading .arrow { visibility: hidden; }

.btn-login.is-loading::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ── Responsive: tighter on small screens ───────────────── */

@media (max-width: 480px) {
    .auth-hero-logo { width: 110px; height: 110px; border-radius: 22px; }
    .auth-hero-logo img { width: 86px !important; height: 86px !important; }
    .auth-hero-title { font-size: 42px; }
    .auth-hero-tagline { font-size: 13px; margin-bottom: 22px; }
    .auth-card-v2 { padding: 26px 22px 22px; border-radius: 18px; }
}

/* ── Reduced-motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .auth-orb,
    .auth-stage::before,
    .auth-hero-logo,
    .auth-hero-logo::before,
    .auth-card-head h2 .wave,
    .auth-hero > * {
        animation: none !important;
    }
    /* The hero children start at opacity:0 and rely on the fade-up
       animation to become visible. Killing the animation must NOT
       leave them invisible — force them fully shown, no transform. */
    .auth-hero > * {
        opacity: 1 !important;
        transform: none !important;
    }
    .auth-video-bg,
    .splash-video-bg {
        display: none;
    }
}

