/**
 * MhSys SaaS - Authentication, Login & Password Recovery Stylesheet (Modern Suite 2026)
 * Design: High-Impact Glassmorphic SaaS Aesthetics, Ultra-Crisp Typography & Kinetic Ambient Mesh
 */

/* ========================================================
   GLOBAL AUTH DESIGN TOKENS
   ======================================================== */
:root {
    --auth-primary: #6366f1;
    --auth-primary-dark: #4f46e5;
    --auth-primary-light: rgba(99, 102, 241, 0.09);
    --auth-accent: #06b6d4;
    --auth-text-title: #0f172a;
    --auth-text-body: #334155;
    --auth-text-muted: #64748b;
    --auth-text-dim: #94a3b8;
    --auth-border: #e2e8f0;
    --auth-card-bg: rgba(255, 255, 255, 0.88);
    --auth-card-border: rgba(255, 255, 255, 0.95);
    --auth-card-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.05);
    --auth-radius-card: 28px;
    --auth-radius-input: 14px;
    --auth-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================
   1. LOGIN & RECOVERY BACKGROUND & AMBIENT GLOW MESH
   ======================================================== */
body.login-bg {
    background: radial-gradient(at 0% 0%, hsla(220, 70%, 94%, 1) 0, transparent 50%),
                radial-gradient(at 100% 0%, hsla(243, 80%, 94%, 1) 0, transparent 50%),
                radial-gradient(at 50% 100%, hsla(260, 60%, 93%, 1) 0, transparent 60%),
                #f8fafc;
    min-height: 100vh;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 30px 15px;
    margin: 0;
}

/* Dynamic Ambient Glow Orbs */
.bg-glow-1 {
    position: absolute;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0) 70%);
    top: -140px;
    left: -120px;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
    animation: floatOrb1 18s ease-in-out infinite alternate;
}

.bg-glow-2 {
    position: absolute;
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0) 70%);
    bottom: -180px;
    right: -140px;
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
    animation: floatOrb2 22s ease-in-out infinite alternate;
}

.bg-glow-3 {
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, rgba(6, 182, 212, 0) 70%);
    top: 35%;
    left: 65%;
    filter: blur(45px);
    z-index: 0;
    pointer-events: none;
    animation: floatOrb3 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 80px) scale(1.12); }
}

@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, -60px) scale(1.15); }
}

@keyframes floatOrb3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 40px) scale(0.9); }
}

/* ========================================================
   2. LOGIN GLASS CARD & CONTAINER
   ======================================================== */
.login-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius-card);
    box-shadow: var(--auth-card-shadow);
    z-index: 10;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 30px 70px -15px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.login-header-subtitle {
    font-size: 13.5px;
    color: var(--auth-text-muted);
    font-weight: 500;
    margin-top: 6px;
    margin-bottom: 0;
}

.login-step-container {
    position: relative;
    min-height: 240px;
    transition: var(--auth-transition);
}

.login-step {
    transition: var(--auth-transition);
    width: 100%;
}

.login-step.slide-active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: auto;
}

.login-step.slide-exit {
    opacity: 0;
    transform: translateX(-40px);
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.login-step.slide-enter-prep {
    opacity: 0;
    transform: translateX(40px);
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* ========================================================
   3. INPUTS, FLOATING LABELS & TYPOGRAPHY
   ======================================================== */
.login-card .form-floating {
    position: relative;
}

.login-card .form-floating > .form-control {
    background-color: rgba(248, 250, 252, 0.85) !important;
    border: 1.5px solid var(--auth-border) !important;
    color: var(--auth-text-title) !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    border-radius: var(--auth-radius-input) !important;
    height: 56px !important;
    padding: 1.35rem 1rem 0.45rem 1rem !important;
    transition: var(--auth-transition);
}

.login-card .form-floating > .form-control::placeholder {
    color: transparent;
}

.login-card .form-floating > .form-control:focus {
    background-color: #ffffff !important;
    border-color: var(--auth-primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    color: var(--auth-text-title) !important;
}

.login-card .form-floating > label {
    color: var(--auth-text-muted) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    padding: 1rem 1rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.login-card .form-floating > .form-control:focus ~ label,
.login-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--auth-primary) !important;
    font-weight: 600 !important;
    font-size: 11.5px !important;
    transform: scale(0.85) translateY(-0.75rem) translateX(0.15rem) !important;
    opacity: 1 !important;
}

/* Password Toggle Icon Button */
.login-card .password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--auth-text-muted);
    font-size: 1.15rem;
    padding: 4px 8px;
    cursor: pointer;
    z-index: 5;
    transition: color 0.2s ease;
    border-radius: 8px;
}

.login-card .password-toggle-btn:hover {
    color: var(--auth-text-title);
}

/* ========================================================
   4. BUTTONS & MICRO-ACTIONS
   ======================================================== */
.btn-primary-custom {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.2px !important;
    border-radius: var(--auth-radius-input) !important;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px -3px rgba(99, 102, 241, 0.42) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(99, 102, 241, 0.58) !important;
    color: #ffffff !important;
}

.btn-primary-custom:active {
    transform: translateY(0);
}

.btn-create-account {
    background: #ffffff !important;
    border: 1.5px solid var(--auth-border) !important;
    color: var(--auth-text-body) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: var(--auth-radius-input) !important;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease !important;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.btn-create-account:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--auth-text-title) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.login-link-forgot {
    color: var(--auth-primary-dark) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.login-link-forgot:hover {
    color: #3730a3 !important;
    text-decoration: underline !important;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 16px 0;
    color: var(--auth-text-dim);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--auth-border);
}

.login-divider span {
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--auth-text-muted);
}

.login-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--auth-text-muted);
    font-size: 12px;
    font-weight: 500;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-border);
}

/* ========================================================
   5. AUTOCOMPLETE SUGGESTIONS (STEP 2)
   ======================================================== */
.autocomplete-list {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    overflow-y: auto;
    max-height: 240px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    display: none;
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    cursor: pointer;
    text-align: left;
    transition: var(--auth-transition);
    background: none;
    border-left: 3px solid transparent;
    width: 100%;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background-color: var(--auth-primary-light);
    border-left-color: var(--auth-primary);
}

/* Alerts */
.alert-premium {
    background-color: hsla(346, 84%, 61%, 0.08);
    border: 1px solid hsla(346, 84%, 61%, 0.18);
    color: hsl(346, 84%, 50%);
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Loader */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    top: calc(50% - 11px);
    left: calc(50% - 11px);
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   6. FORCE_CHANGE_PASSWORD & SCOPED STYLES
   ======================================================== */
.force-pwd-body {
    background-color: #0b1120;
    background-image: 
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%);
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.auth-card {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 36px 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.7);
}

.form-control-custom {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-size: 0.95rem;
    border-radius: 12px;
    padding: 12px 42px 12px 16px;
    transition: all 0.25s ease;
    width: 100%;
}

.form-control-custom:focus {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25) !important;
    outline: none;
    color: #ffffff !important;
}

.btn-submit {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 14px 20px;
    border-radius: 12px;
    width: 100%;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
    color: #ffffff !important;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}