/* ==========================================
   MODERN LOGIN — Clean Light
   Scoped under body.modern-login
   ========================================== */

@keyframes loginGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.modern-login {
    background: linear-gradient(-45deg, #e8edf5, #dbeafe, #e8e0f7, #d4dff7, #e2ecf5) !important;
    background-size: 400% 400% !important;
    animation: loginGradient 15s ease infinite !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Mesh gradient — colored blobs for depth */
body.modern-login::before,
body.modern-login::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body.modern-login::before {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(147, 197, 253, 0.15) 40%, transparent 70%);
    filter: blur(80px);
    top: -20%;
    right: -12%;
    animation: loginGradient 20s ease infinite;
}

body.modern-login::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.3) 0%, rgba(196, 181, 253, 0.12) 40%, transparent 70%);
    filter: blur(90px);
    bottom: -15%;
    left: -10%;
    animation: loginGradient 25s ease infinite reverse;
}

/* Third blob — warm accent bottom-right */
@keyframes loginFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-30px, -20px) scale(1.05); }
}

body.modern-login .container-fluid::before {
    content: '';
    position: fixed;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.18) 0%, transparent 70%);
    filter: blur(100px);
    bottom: -5%;
    right: 15%;
    pointer-events: none;
    z-index: 0;
    animation: loginFloat 18s ease-in-out infinite;
}

/* Main container above blobs */
body.modern-login .container-fluid {
    position: relative;
    z-index: 1;
}

/* Hide snow/Three.js canvas */
body.modern-login > div[style*="position: absolute"] {
    display: none !important;
}

/* --- Logo container --- */
body.modern-login .modern-login-logo {
    background: rgba(59, 130, 246, 0.06);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px 16px 0 0;
    margin: -40px -32px 28px;
    padding: 30px 20px;
    text-align: center;
}

body.modern-login .modern-login-logo img {
    width: 120px;
    height: auto;
}

/* --- Glass card --- */
body.modern-login .login-container,
body.modern-login .forgot-password-container {
    width: 380px;
    max-width: 95vw;
}

/* Hide header (BiOz title bar) */
body.modern-login .box-header.gradient-dark-theme {
    display: none !important;
}

/* Hide logo animation */
body.modern-login #logo-animation {
    display: none !important;
}

body.modern-login .box-body {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 16px !important;
    box-shadow:
      0 25px 80px rgba(0, 0, 0, 0.1),
      0 8px 24px rgba(0, 0, 0, 0.06),
      0 0 0 1px rgba(255, 255, 255, 0.7) inset !important;
    padding: 40px 32px 32px !important;
    overflow: visible !important;
}

/* Hide the text-align:left wrapper that held the logo */
body.modern-login .box-body > div[style*="text-align:left"] {
    display: none !important;
}

/* --- Input containers --- */
body.modern-login .box-body > div > div[style*="margin-bottom"] {
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-bottom: 16px !important;
}

/* --- Input fields --- */
body.modern-login .userLogin,
body.modern-login .userPassword {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    color: #1e293b !important;
    font-size: 14px !important;
    height: 46px !important;
    padding: 0 14px 0 42px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    outline: none !important;
    margin: 0 !important;
    line-height: 46px !important;
}

body.modern-login .userPassword {
    border-radius: 10px 0 0 10px !important;
    flex: 1;
}

body.modern-login .userLogin:focus,
body.modern-login .userPassword:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.08) !important;
}

body.modern-login .userLogin::placeholder,
body.modern-login .userPassword::placeholder {
    color: #94a3b8 !important;
    line-height: normal !important;
}

/* Kill browser autofill */
body.modern-login .userLogin:-webkit-autofill,
body.modern-login .userPassword:-webkit-autofill,
body.modern-login .userLogin:-webkit-autofill:hover,
body.modern-login .userPassword:-webkit-autofill:hover,
body.modern-login .userLogin:-webkit-autofill:focus,
body.modern-login .userPassword:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
    border: 1.5px solid #cbd5e1 !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.modern-login input[type="text"]:-webkit-autofill,
body.modern-login input[type="password"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
}

/* Input icons */
body.modern-login .box-body .fa-user,
body.modern-login .box-body .fa-lock {
    position: absolute !important;
    color: #94a3b8 !important;
    font-size: 14px !important;
    z-index: 2;
    top: 50% !important;
    left: 14px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/* Eye toggle button */
body.modern-login .add-on {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1.5px solid #cbd5e1 !important;
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    text-shadow: none !important;
    height: 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

body.modern-login .add-on:hover {
    background: rgba(241, 245, 249, 0.9) !important;
}

body.modern-login .add-on .fa-eye {
    color: #94a3b8 !important;
    font-size: 13px !important;
}

/* --- Login button --- */
body.modern-login .login-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    width: 100% !important;
    height: 48px !important;
    cursor: pointer;
    transition: all 0.3s !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25) !important;
    margin-top: 8px;
}

body.modern-login .login-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px);
}

body.modern-login .login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2) !important;
}

/* --- Forgot password link --- */
body.modern-login #forgot-password,
body.modern-login #cancel-forgot-password,
body.modern-login .goto-login {
    color: #64748b !important;
    font-size: 12px !important;
    text-decoration: none !important;
    transition: color 0.2s;
    margin-top: 16px !important;
}

body.modern-login #forgot-password:hover,
body.modern-login #cancel-forgot-password:hover,
body.modern-login .goto-login:hover {
    color: #3b82f6 !important;
}

/* --- SSO button --- */
body.modern-login .sso-login p {
    color: #64748b;
    font-size: 13px;
}

body.modern-login .sso-login .btn-primary {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1.5px solid #3b82f6 !important;
    border-radius: 10px !important;
    color: #2563eb !important;
    font-weight: 500;
    padding: 10px 24px;
    transition: all 0.2s;
}

body.modern-login .sso-login .btn-primary:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #1d4ed8 !important;
}

/* --- Error alert --- */
body.modern-login .alert-error {
    background: rgba(254, 226, 226, 0.8) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 10px !important;
    color: #dc2626 !important;
    font-size: 13px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px !important;
}

/* --- Footer --- */
body.modern-login #footer {
    margin-top: 4px;
}

body.modern-login #footer a {
    color: #94a3b8 !important;
    font-size: 11px !important;
    text-align: center !important;
    display: block;
    letter-spacing: 0.3px;
}

body.modern-login #footer a:hover {
    color: #64748b !important;
}

body.modern-login #footer p {
    text-align: center !important;
    padding: 8px 0 !important;
}

/* --- Forgot password view texts --- */
body.modern-login .forgot-password-container .send-view p,
body.modern-login .forgot-password-container .sent-view p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

body.modern-login .forgot-password-container .send-view h5,
body.modern-login .forgot-password-container .sent-view h5 {
    color: #1e293b;
    font-weight: 500;
}

body.modern-login .forgot-password-container #forgot-password-errors {
    background: rgba(254, 226, 226, 0.8) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 10px !important;
    color: #dc2626 !important;
}

/* --- Transition overlay --- */
@keyframes transitionSpin {
    to { transform: rotate(360deg); }
}

.modern-login-transition {
    position: fixed;
    inset: 0;
    background: #f8fafc;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.modern-login-transition--active {
    opacity: 1;
    visibility: visible;
}

.modern-login-transition::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: transitionSpin 0.7s linear infinite;
}
