/* Modern Login Page Styles - YourPensya */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@100..900&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --white: #ffffff;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
    --glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure Heebo font for ALL text elements */
*, *::before, *::after {
    font-family: 'Heebo', sans-serif !important;
}

/* Preserve FontAwesome icons in Login */
.fas, .far, .fab, .fal, .fa,
i[class*="fa-"], 
[class*="fa-"]::before,
button i, a i, span i,
.btn i, .input-icon i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
}

/* Ultimate FontAwesome fix for Login */
[class^="fa-"], [class*=" fa-"],
[class^="fas"], [class*=" fas"],
[class^="far"], [class*=" far"],
[class^="fab"], [class*=" fab"],
[class^="fal"], [class*=" fal"],
i.fas, i.far, i.fab, i.fal, i.fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}
.modal.show{
    z-index: 9999 !important;
}
.modal-backdrop.show {
    z-index: 1 !important;
}
.modal-header .btn-close {
    margin: calc(-.5 * var(--bs-modal-header-padding-y)) auto calc(-.5 * var(--bs-modal-header-padding-y)) calc(-.5 * var(--bs-modal-header-padding-x));
}

body {
    font-family: 'Heebo', sans-serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    position: relative;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

/* Animated Background */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    border: 1px solid var(--glass-border);
    transform: perspective(1000px) rotateX(0deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.login-container:hover {
    transform: perspective(1000px) rotateX(2deg) translateY(-5px);
    box-shadow: var(--shadow-strong), var(--glow);
}

/* Force Change Password Modal - Modern Styling */
#forceChangeModal .modal-dialog {
    max-width: 360px; /* narrower than login card (420px) for clear overlay feel */
    margin: 1.25rem auto;
}

#forceChangeModal .modal-content {
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    /* Stronger layered shadow + subtle ring for edge separation */
    box-shadow:
        0 24px 64px rgba(17, 24, 39, 0.25),
        0 2px 8px rgba(17, 24, 39, 0.12),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    position: relative;
    animation: modalPop 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
/* subtle inner highlight to accentuate edges on white backgrounds */
#forceChangeModal .modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

@keyframes modalPop {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

#forceChangeModal .modal-header {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 1.25rem 1.25rem;
}

#forceChangeModal .modal-title {
    font-weight: 800;
    letter-spacing: 0.3px;
}

#forceChangeModal .modal-body {
    padding: 1.5rem;
}

#forceChangeModal .form-label {
    font-weight: 700;
    color: var(--text-primary);
}

#forceChangeModal .form-control {
    background: #f8fafc;
    border: 2px solid #e9edf3;
    border-radius: 14px;
}

/* Style the show-password button to match input */
#forceChangeModal .input-group .btn {
    background: #ffffff;
    border: 2px solid #e9edf3;
    color: #64748b;
}

#forceChangeModal .input-group .btn:hover {
    background: #eef2f7;
    color: #334155;
}

#forceChangeModal .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#forceChangeModal .modal-footer {
    background: #f8f9fb;
    border: none;
    padding: 1rem 1.25rem;
}

#forceChangeModal .btn-primary {
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-weight: 700;
}

#forceChangeModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(79, 172, 254, 0.35);
}

#forceChangeModal .btn-secondary {
    border-radius: 12px;
}

/* RTL input-group rounding inside modal */
html[dir="rtl"] #forceChangeModal .input-group .form-control {
    border-radius: 0 14px 14px 0;
    border-left: none;
}

html[dir="rtl"] #forceChangeModal .input-group .btn {
    border-radius: 14px 0 0 14px;
    border-right: none;
}

.login-header {
    background: var(--primary-gradient);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.logo-container {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.logo {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: var(--white);
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-5deg);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-title {
    color: var(--white);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

.login-form {
    padding: 40px 30px;
    background: var(--white);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
    direction: rtl;
    padding-bottom: 18px; /* reserve space for inline errors without layout shift */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    direction: rtl;
    transition: all 0.3s ease;
}

.form-group:focus-within label {
    color: #667eea;
    transform: translateX(-5px);
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    background: #f8fafc;
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.form-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-control:focus::before {
    left: 100%;
}

.form-control::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
    text-align: right;
    direction: rtl;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group:focus-within .input-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.login-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alert {
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    display: none;
    text-align: right;
    direction: rtl;
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 15px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 20px;
    font-weight: 400;
    direction: rtl;
    opacity: 0.7;
}

.footer-text .itox-sep {
    margin: 0 8px;
    opacity: 0.4;
}

.brand-itox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
    color: #3b82f6;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.brand-itox::before {
    content: '\f121'; /* code icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: right;
    direction: rtl;
    font-weight: 500;
}

.error-message i {
    font-size: 14px;
    margin-left: 6px;
}

.form-control.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    background: rgba(239, 68, 68, 0.02);
}

.form-group.has-error label {
    color: #ef4444;
}

/* Hover Effects */
.form-control.hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.form-group.focused label {
    color: #667eea;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        border-radius: 20px;
        max-width: 100%;
    }
    
    .login-header {
        padding: 30px 20px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        padding: 12px;
    }
}

/* Animation for form appearance */
.login-container {
    animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: perspective(1000px) rotateX(10deg) translateY(50px);
    }
    to {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg) translateY(0);
    }
}

/* Floating Labels */
.floating-label {
    position: relative;
}

.floating-label .form-control {
    padding-top: 20px;
    padding-bottom: 8px;
}

.floating-label label {
    position: absolute;
    right: 20px;
    top: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    transform-origin: right top;
}

.floating-label label.floating {
    transform: translateY(-8px) scale(0.85);
    color: #667eea;
    right: 16px;
}

.floating-label .form-control:focus + label,
.floating-label .form-control:not(:placeholder-shown) + label {
    transform: translateY(-8px) scale(0.85);
    color: #667eea;
    right: 16px;
}

/* Additional RTL Support */
.login-container input::placeholder {
    text-align: right;
    direction: rtl;
}

.login-container .form-control {
    text-align: right;
    direction: rtl;
}

.login-container .form-group {
    text-align: right;
    direction: rtl;
}

.me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Glass morphism effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Particle effects */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    contain: layout;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle-float 6s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float-dot 4s ease-in-out infinite;
}

.floating-dot:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.floating-dot:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: 1s;
}

.floating-dot:nth-child(3) {
    bottom: 30%;
    left: 50%;
    animation-delay: 2s;
}

@keyframes float-dot {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.5);
        opacity: 0.8;
    }
}

/* Input Highlights */
/* Disable bottom highlight line to avoid clash with rounded corners */
.input-highlight { display: none; }

/* Button Enhancements */
.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.login-btn:hover .btn-background {
    opacity: 1;
}

/* Enhanced Focus Effects */
.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Smooth Transitions */
* {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hover Effects for Form Groups */
.form-group:hover .form-control {
    border-color: #667eea;
    transform: translateY(-1px);
}

.form-group:hover label {
    color: #667eea;
}

/* Enhanced Logo Animation */
.logo {
    animation: logo-float 6s ease-in-out infinite;
}

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

/* Glass Morphism Enhancement */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Enhanced Shadows */
.login-container:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(102, 126, 234, 0.3),
        0 0 60px rgba(102, 126, 234, 0.1);
}

/* Mobile Overflow Fix */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .particles {
        display: none !important;
    }
    
    .floating-elements {
        display: none !important;
    }
    
    body::before {
        animation: none !important;
        transform: none !important;
    }
    
    .login-container {
        margin: 10px !important;
        max-width: calc(100vw - 20px) !important;
        width: 100% !important;
    }
    
    .login-container:hover {
        transform: perspective(1000px) rotateX(0deg) translateY(0px) !important;
    }
} 