/* --- Global Styles & Variables --- */
:root {
    --primary-1: #0066B3; /* Royal Blue */
    --accent: #A7904C;    /* Golden Beige */
    --neutral-1: #333333;  /* Dark Gray for Text */
    --text-white: #FFFFFF;
    --border-color: #ddd;
    --background-light: #f9f9f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-light);
    padding: 20px; /* Add some padding for smaller viewports */
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 600px;
    background: var(--text-white);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12); /* Slightly softer shadow */
    border-radius: 20px;
    overflow: hidden;
}

/* --- Login Form Section (Left Side) --- */
.login-form-wrapper {
    flex-basis: 45%;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header .logo img {
    height: 100px; /* Slightly adjusted for better balance */
    margin-bottom: 20px;
}

.form-header h2 {
    color: var(--primary-1);
    font-size: 2rem;
    margin-bottom: 10px;
}

.form-header p {
    color: #777;
    font-size: 1rem;
}

/* Form Inputs */
.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--neutral-1);
    text-align: right;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    padding-left: 40px; /* Add space for the icon */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-1);
    box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

/* --- FIX: Consolidated toggle button style --- */
.toggle-password {
    position: absolute;
    top: 68%; /* Adjusted for better alignment */
    left: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 1.1rem;
    padding: 0;
}

/* Form Button & Footer */
.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-1);
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-login:hover {
    background-color: #005a9e; /* Darker blue */
    transform: translateY(-2px);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.forgot-password {
    color: var(--neutral-1);
    text-decoration: none;
    font-size: 0.9rem;
}
.forgot-password:hover {
    text-decoration: underline;
    color: var(--primary-1);
}

/* --- Image Section (Right Side) --- */
.login-image-wrapper {
    flex-basis: 55%;
}

.login-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#message-container {
  display: none;
  padding: 10px;
  border-radius: 5px;
  margin-top: 15px;
}

.message-success {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

.message-error {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}
* تنسيقات الرسائل */
.message {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: 500;
    text-align: center;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Login Method Toggle */
.login-method-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.method-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.method-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.method-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Form Visibility */
.phone-form {
    display: none;
}

.email-form.active,
.phone-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
/* Ensure forms are properly hidden/shown */
.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

/* Make sure toggle buttons are visible */
.login-method-toggle {
    display: flex !important;
}

.method-btn {
    display: flex !important;
}
/* Add to your CSS */
.login-method-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.method-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.method-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.method-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

.otp-form {
    display: none;
}

.email-form.active,
.otp-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-send-otp, .btn-verify-otp {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-verify-otp {
    background: #007bff;
}

.otp-resend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 14px;
}

#resend-otp {
    color: #007bff;
    text-decoration: none;
}

#resend-otp:hover {
    text-decoration: underline;
}

#otp-timer {
    color: #6c757d;
    font-size: 12px;
}

#otp-code {
    text-align: center;
    letter-spacing: 8px;
    font-size: 18px;
    font-weight: bold;
}
.recaptcha-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

/* Ensure reCAPTCHA displays properly */
.g-recaptcha {
    transform: scale(0.9);
    transform-origin: center;
}
.input-group input[type="tel"] {
    direction: ltr;
    text-align: left;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Phone Input Styling */
.input-group input[type="tel"] {
    direction: ltr;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
    .method-btn {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .method-btn i {
        font-size: 14px;
    }
}
/* --- Responsive Design --- */
@media (max-width: 992px) {
    body {
        align-items: flex-start; /* Align to top on smaller screens */
    }
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        min-height: auto;
    }
    /* --- FIX: Hide the image wrapper completely on tablet/mobile --- */
    .login-image-wrapper {
        display: none;
    }
    .login-form-wrapper {
        flex-basis: 100%;
        padding: 40px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 0;
    }
    .login-container {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh; /* Take full viewport height */
    }
    .login-form-wrapper {
        padding: 30px 20px;
    }
    .form-header h2 {
        font-size: 1.8rem;
    }
}