:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --neu-base: rgba(15, 23, 42, 0.75);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding: 2rem 0;
}

.background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e2937 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.16;
    mix-blend-mode: screen;
}

.orb-1 { width: 600px; height: 600px; background: #3b82f6; top: -10%; left: -10%; }
.orb-2 { width: 800px; height: 800px; background: #8b5cf6; bottom: -20%; right: -15%; }
.orb-3 { width: 500px; height: 500px; background: #06b6d4; top: 30%; right: 10%; }

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ====================== HYBRID GLASS + NEUMORPHISM CARD ====================== */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 460px;
    padding: 1.5rem;
}

.login-card {
    background: var(--neu-base);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 3rem 2.75rem;
    box-shadow: 
        /* Neumorphism Outer Shadows */
        12px 12px 24px rgba(0, 0, 0, 0.5),
        -8px -8px 20px rgba(255, 255, 255, 0.08),
        /* Glass + Depth */
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Subtle inner glass highlight */
.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,0.09), transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Typography */
.form-header {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.login-card h1 {
    font-size: 2.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.login-card p {
    color: #94a3b8;
    font-size: 1.05rem;
}

/* ====================== HYBRID INPUTS ====================== */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
}

.modern-input,
.login-page input[type="text"],
.login-page input[type="password"],
.login-page input[type="email"] {
    width: 100% !important;
    padding: 14px 16px !important;
    background: rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 14px !important;
    color: white !important;
    font-size: 1.05rem !important;
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.08) !important;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.modern-input:focus,
.login-page input:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.08),
        0 0 0 3px rgba(59, 130, 246, 0.3) !important;
    background: rgba(255,255,255,0.12) !important;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper .modern-input,
.password-wrapper input[type="password"] {
    padding-right: 52px !important; /* Retains nice spacing so letters don't look crowded behind eye */
}

/* Eye Icon */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;               /* Fixed explicit width avoids horizontal size jumping */
    height: 28px;              /* Explicit uniform bounds wrapper */
    display: flex;
    align-items: center;
    justify-content: center;   /* Perfectly centers Font Awesome 4 vectors */
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;                /* Reset padding layout values */
    z-index: 10;
}

.toggle-password:hover {
    color: #e2e8f0;
}

/* Button - Hybrid Style */
.btn-primary {
    width: 100%;
    padding: 16px;
    margin-top: 1.5rem;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 
        6px 6px 12px rgba(0, 0, 0, 0.4),
        -4px -4px 10px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.4),
        -2px -2px 6px rgba(255, 255, 255, 0.1);
}

.btn-primary.loading {
    color: transparent;
}

.btn-primary .btn-spinner {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-primary.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); } /* Preserves layout centering alignment rules */
}

/* Rest of the styles (form options, divider, footer) */
.form-options, .divider, .logo-section, .login-footer {
    position: relative;
    z-index: 2;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    font-size: 0.95rem;
}

/* Hide the native checkbox visually, but stretch it over the entire label area */
.remember-me input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
    inset: 0;
    z-index: 3; /* Sits over your custom span to intercept the click */
    margin: 0;
}

/* Ensure the label is positioned correctly to bound the absolute checkbox */
.remember-me {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #cbd5e1;
    user-select: none; /* Prevents text highlighting on accidental double clicks */
}
.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #64748b;
    border-radius: 6px;
    position: relative;
}

/* Change the '+' to '~' so it finds the custom checkbox regardless of Razor's hidden inputs */
input[type="checkbox"]:checked ~ .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked ~ .custom-checkbox::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.forgot-link {
    color: #93c5fd; /* A much softer, premium pastel blue */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary); /* Snaps beautifully to your bright theme blue */
    text-decoration: none;
}

.divider {
    text-align: center;
    margin: 2rem 0;
    color: #64748b;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.divider span {
    background: var(--neu-base);
    padding: 0 20px;
}

.logo-section { text-align: center; margin-bottom: 2rem; }
.login-logo { max-height: 48px; }

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    .login-card { padding: 2rem 1.75rem; }
}