/* ========================================
   NEW Modern Login Page Design
   ======================================== */

.new-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.new-login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.new-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(60px);
}

.new-shape-1 {
    width: 500px;
    height: 500px;
    top: -200px;
    right: -150px;
    animation: floatShape1 20s ease-in-out infinite;
}

.new-shape-2 {
    width: 350px;
    height: 350px;
    bottom: -100px;
    left: -100px;
    animation: floatShape2 18s ease-in-out infinite;
}

.new-shape-3 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape3 22s ease-in-out infinite;
}

.new-login-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.new-login-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.new-login-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    color: white;
}

.new-brand-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.new-brand-icon img {
    width: 48px;
    height: 48px;
    outline: none;
}

.new-brand-icon:focus,
.new-brand-icon img:focus {
    outline: none;
}

.new-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    outline: none !important;
    user-select: none;
}

.new-brand-title:focus {
    outline: none !important;
}

.new-brand-subtitle {
    font-size: 0.9375rem;
    opacity: 0.9;
    margin: 0;
    outline: none !important;
    user-select: none;
}

.new-brand-subtitle:focus {
    outline: none !important;
}

.new-login-content {
    padding: 2.5rem 2rem 2rem;
}

.new-login-header {
    margin-bottom: 2rem;
    text-align: center;
}

.new-login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.new-login-header p {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0;
}

/* Form Fields */
.new-form-field {
    margin-bottom: 1.5rem;
}

.new-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.required-mark {
    color: #ef4444;
    margin-left: 0.25rem;
}

.new-input-wrapper {
    position: relative;
}

.new-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
}

[dir="rtl"] .new-input-icon {
    left: auto;
    right: 1rem;
}

.new-form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1e293b !important;
    background: #f8fafc !important;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
}

[dir="rtl"] .new-form-input {
    padding: 0.875rem 3rem 0.875rem 1rem;
}

.new-form-input:focus {
    background: #ffffff !important;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    color: #1e293b !important;
}

.new-form-input::placeholder {
    color: #94a3b8;
}

/* Light Mode Autofill Styling */
.new-form-input:-webkit-autofill,
.new-form-input:-webkit-autofill:hover,
.new-form-input:-webkit-autofill:focus,
.new-form-input:-webkit-autofill:active {
    -webkit-text-fill-color: #1e293b !important;
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    box-shadow: 0 0 0 1000px #f8fafc inset !important;
    background-color: #f8fafc !important;
    caret-color: #1e293b !important;
    border-color: #e2e8f0 !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.new-form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 0 0 1000px #ffffff inset !important;
}

/* Password Toggle */
.new-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

[dir="rtl"] .new-password-toggle {
    right: auto;
    left: 0.75rem;
}

.new-password-toggle:hover {
    background: #f1f5f9;
    color: #667eea;
}

.new-password-toggle:focus {
    outline: none;
    background: #e0e7ff;
    color: #667eea;
}

.new-password-toggle i {
    font-size: 1rem;
}

/* Login Button */
.new-btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.new-btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.new-btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.new-btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.new-btn-login:focus {
    outline: none;
}

.new-btn-login i {
    font-size: 1.5rem;
}

/* Spinner */
.new-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Alert */
.new-alert {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.new-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.new-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Validation Message */
.new-validation-msg {
    display: block;
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    margin-left: 0.25rem;
}

/* Footer */
.new-login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatShape1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, -80px) scale(0.9); }
    75% { transform: translate(60px, -40px) scale(1.05); }
}

@keyframes floatShape2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 50px) scale(1.1); }
    66% { transform: translate(40px, -30px) scale(0.95); }
}

@keyframes floatShape3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
/* Remove all focus outlines */
.new-login-card *:focus,
.new-login-card button:focus,
.new-login-card a:focus,
.new-brand-icon:focus,
img:focus {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 576px) {
    .new-login-wrapper {
        padding: 1rem;
    }
    
    .new-login-brand {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .new-brand-title {
        font-size: 1.25rem;
    }
    
    .new-login-content {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .new-login-header h2 {
        font-size: 1.5rem;
    }
}

.auth-page {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.login-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Left Side - Branding
   ======================================== */

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-brand {
    max-width: 500px;
    text-align: center;
    z-index: 1;
}

/* Bubble base styles */
.bubble {
    position: absolute;
    border-radius: 50%;
    backdrop-filter: blur(2px);
    pointer-events: none;
    will-change: transform;
}

/* Shape base styles */
.shape {
    position: absolute;
    backdrop-filter: blur(2px);
    pointer-events: none;
    will-change: transform;
}

.rectangle {
    border-radius: 12px;
}

/* First bubble - top right */
.bubble-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.15);
    top: -150px;
    right: -150px;
    animation: floatBubble1 8s ease-in-out infinite;
}

/* Second bubble - bottom left */
.bubble-2 {
    width: 300px;
    height: 300px;
    background: rgba(96, 165, 250, 0.3);
    bottom: -100px;
    left: -100px;
    animation: floatBubble2 10s ease-in-out infinite;
}

/* Third bubble - middle floating */
.bubble-3 {
    width: 250px;
    height: 250px;
    background: rgba(147, 197, 253, 0.25);
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    animation: floatBubble3 12s ease-in-out infinite;
}

/* Fourth bubble - top center */
.bubble-4 {
    width: 180px;
    height: 180px;
    background: rgba(191, 219, 254, 0.2);
    top: 15%;
    left: 50%;
    animation: floatBubble4 9s ease-in-out infinite;
}

/* Fifth bubble - bottom right */
.bubble-5 {
    width: 200px;
    height: 200px;
    background: rgba(59, 130, 246, 0.18);
    bottom: 10%;
    right: 15%;
    animation: floatBubble5 11s ease-in-out infinite;
}

/* Rectangle 1 - rotated, top left */
.rect-1 {
    width: 120px;
    height: 120px;
    background: rgba(219, 234, 254, 0.22);
    top: 20%;
    left: 10%;
    transform: rotate(25deg);
    animation: floatRect1 14s ease-in-out infinite;
}

/* Rectangle 2 - horizontal, middle right */
.rect-2 {
    width: 160px;
    height: 80px;
    background: rgba(147, 197, 253, 0.18);
    top: 60%;
    right: 8%;
    transform: rotate(-15deg);
    animation: floatRect2 13s ease-in-out infinite;
}

/* Rectangle 3 - vertical, bottom center */
.rect-3 {
    width: 90px;
    height: 140px;
    background: rgba(191, 219, 254, 0.15);
    bottom: 20%;
    left: 45%;
    transform: rotate(10deg);
    animation: floatRect3 15s ease-in-out infinite;
}

.brand-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    backdrop-filter: blur(10px);
}

.brand-icon i {
    font-size: 4rem;
    color: white;
}

.login-brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.login-brand p {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* ========================================
   Right Side - Login Form
   ======================================== */

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 1rem;
    color: #64748b;
}

/* ========================================
   Form Styles
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.form-label i {
    color: #3b82f6;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Password input group with toggle button */
.password-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.password-group .form-control {
    flex: 1;
}

/* LTR: password input on left, button on right */
[dir="ltr"] .password-group .form-control {
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: none;
}

[dir="ltr"] .password-group .password-toggle {
    border-radius: 0 0.5rem 0.5rem 0;
    border-left: 2px solid #e2e8f0;
}

/* RTL: password input on right, button on left */
[dir="rtl"] .password-group .form-control {
    border-radius: 0 0.5rem 0.5rem 0;
    border-left: none;
}

[dir="rtl"] .password-group .password-toggle {
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: 2px solid #e2e8f0;
}

.password-toggle {
    padding: 0.875rem 1rem;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    background-color: #e2e8f0;
    color: #3b82f6;
}

.password-toggle:focus {
    outline: none;
    background-color: white;
    color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-group:focus-within .password-toggle {
    border-color: #3b82f6;
}

.password-group:focus-within .form-control {
    border-color: #3b82f6;
}

/* ========================================
   Button Styles
   ======================================== */

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-login i {
    font-size: 1.25rem;
}

/* ========================================
   Alert Styles
   ======================================== */

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-danger i {
    font-size: 1.25rem;
}

/* ========================================
   Footer
   ======================================== */

.login-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 992px) {
    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .login-right {
        padding: 2rem 1.5rem;
    }

    .login-header h2 {
        font-size: 1.75rem;
    }

    .login-card {
        max-width: 100%;
    }
}

/* ========================================
   Spinner Animation
   ======================================== */

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.15em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Floating Bubble Animations
   ======================================== */

@keyframes floatBubble1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
        opacity: 0.2;
    }
    50% {
        transform: translate(-20px, -50px) scale(0.95);
        opacity: 0.18;
    }
    75% {
        transform: translate(40px, -20px) scale(1.08);
        opacity: 0.22;
    }
}

@keyframes floatBubble2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.3;
    }
    20% {
        transform: translate(-25px, 35px) scale(1.1) rotate(45deg);
        opacity: 0.35;
    }
    40% {
        transform: translate(30px, 20px) scale(0.9) rotate(90deg);
        opacity: 0.28;
    }
    60% {
        transform: translate(-30px, -25px) scale(1.05) rotate(180deg);
        opacity: 0.32;
    }
    80% {
        transform: translate(20px, 30px) scale(0.95) rotate(270deg);
        opacity: 0.38;
    }
}

@keyframes floatBubble3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.25;
    }
    25% {
        transform: translate(-30%, -60%) scale(1.15) rotate(60deg);
        opacity: 0.3;
    }
    50% {
        transform: translate(-70%, -40%) scale(0.9) rotate(120deg);
        opacity: 0.22;
    }
    75% {
        transform: translate(-40%, -70%) scale(1.1) rotate(240deg);
        opacity: 0.28;
    }
}

@keyframes floatBubble4 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.2;
    }
    33% {
        transform: translate(-40px, 30px) scale(1.1);
        opacity: 0.25;
    }
    66% {
        transform: translate(35px, -25px) scale(0.95);
        opacity: 0.18;
    }
}

@keyframes floatBubble5 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.18;
    }
    30% {
        transform: translate(-30px, -35px) scale(1.08) rotate(90deg);
        opacity: 0.22;
    }
    60% {
        transform: translate(25px, 30px) scale(0.92) rotate(180deg);
        opacity: 0.2;
    }
}

@keyframes floatRect1 {
    0%, 100% {
        transform: rotate(25deg) translate(0, 0) scale(1);
        opacity: 0.22;
    }
    25% {
        transform: rotate(40deg) translate(20px, -30px) scale(1.05);
        opacity: 0.26;
    }
    50% {
        transform: rotate(15deg) translate(-25px, 20px) scale(0.95);
        opacity: 0.2;
    }
    75% {
        transform: rotate(35deg) translate(15px, -15px) scale(1.02);
        opacity: 0.24;
    }
}

@keyframes floatRect2 {
    0%, 100% {
        transform: rotate(-15deg) translate(0, 0) scale(1);
        opacity: 0.18;
    }
    33% {
        transform: rotate(-25deg) translate(-20px, 25px) scale(1.08);
        opacity: 0.22;
    }
    66% {
        transform: rotate(-5deg) translate(18px, -20px) scale(0.94);
        opacity: 0.16;
    }
}

@keyframes floatRect3 {
    0%, 100% {
        transform: rotate(10deg) translate(0, 0) scale(1);
        opacity: 0.15;
    }
    40% {
        transform: rotate(25deg) translate(30px, -25px) scale(1.1);
        opacity: 0.2;
    }
    80% {
        transform: rotate(-5deg) translate(-28px, 22px) scale(0.9);
        opacity: 0.12;
    }
}

.me-2 {
    margin-right: 0.5rem;
}
