/* --- Local Poppins Font Setup --- */
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* --- CSS Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif; 
}

body {
    background-color: #f4f7fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Main Card Container */
.login-wrapper {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
}

/* Left Side - Illustration */
.card-left {
    background-color: #ebfcfa;
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.illustration-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.illustration-container img {
    max-width: 100%;
    height: auto;
}

/* Right Side - Login Form */
.card-right {
    width: 50%;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    position: relative;
}

/* --- Custom Language Selector Styles --- */
.custom-language-selector {
    align-self: flex-end;
    position: relative;
    margin-bottom: 20px;
    user-select: none;
    z-index: 100;
}

.lang-selected {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: auto;
    font-weight: 500;
    transition: all 0.2s;
}

.lang-selected:hover {
    border-color: #cbd5e1;
}

.lang-selected .arrow {
    font-size: 10px;
    margin-left: 10px;
    color: #94a3b8;
}

.lang-options {
    display: none; 
    position: absolute;
    top: 110%;
    right: 0;
    background-color: #ffffff;
    min-width: 170px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.lang-options.show {
    display: block; 
}

.lang-option {
    color: #334155;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.lang-option:hover {
    background-color: #f8fafc;
}

.flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    margin-right: 12px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.checkmark {
    margin-left: auto;
    color: #10b981;
    font-weight: bold;
}

/* Form Styles */
.logo-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-header img {
    height: 100px;
    margin-bottom: 10px;
}

.logo-header h1 {
    color: #0f172a;
    font-size: 26px;
    font-weight: 700;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.input-group input[type="text"],
.input-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #10b981;
}

/* Password Wrapper & FontAwesome Icon */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #10b981;
}

.form-actions {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.login-btn {
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #059669;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.divider {
    text-align: center;
    margin: 25px 0;
    color: #64748b;
    font-size: 14px;
}

.forgot-password {
    text-align: center;
    display: block;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.footer-terms {
    margin-top: 30px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.footer-terms a {
    color: #64748b;
    text-decoration: underline;
    font-weight: 500;
}

/* =========================================
   Forgot Password Modal - Fixed Positioning
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.modal-header h2 i {
    color: #f59e0b;
    margin-right: 8px;
}

.close-modal-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Forgot Modal Form */
.forgot-modal .form-group {
    margin-bottom: 20px;
}

.forgot-modal .form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.forgot-modal .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #ffffff;
}

.forgot-modal .form-control:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    outline: none;
}

.forgot-modal .info-box {
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #fcd34d;
}

.forgot-modal .info-box p {
    font-size: 13px;
    color: #92400e;
    margin: 0;
}

.forgot-modal .info-box i {
    color: #f59e0b;
    margin-right: 6px;
}

.btn-forgot-submit {
    background: #f59e0b;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-forgot-submit:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-forgot-submit:active {
    transform: scale(0.98);
}

/* Forgot Button */
.btn-forgot-trigger {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 8px;
    transition: color 0.2s;
}

.btn-forgot-trigger:hover {
    color: #0f172a;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        min-height: auto;
    }
    
    .card-left {
        display: none; 
    }
    
    .card-right {
        width: 100%;
        padding: 40px 30px;
    }

    .modal-box {
        padding: 24px 20px;
        margin: 10px;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .modal-box {
        padding: 20px 16px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
}