/* Login Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--primary-font);
    background: linear-gradient(135deg, var(--login-gradient-start) 0%, var(--login-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

/* Login Container */
.login-container {
    background: var(--login-card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-strong);
    padding: 40px;
    height: auto;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* Logo */
.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    z-index: 10;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    place-items: center;
}

/* Login Header */
.login-header {
    text-align: right;
    margin-bottom: 30px;
}

.login-title {
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-small);
}

.spacer {
    height: 48px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    direction: rtl;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--login-step-inactive);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-small);
}

.step.active .step-number {
    background: var(--login-step-active);
}

.step.completed .step-number {
    background: var(--login-step-complete);
}

.step span:last-child {
    font-size: var(--font-size-small);
    color: var(--text-muted);
}

.step-divider {
    flex: 1;
    height: 2px;
    background: var(--login-step-inactive);
    margin: 0px 10px;
    align-self: flex-start;
    margin-top: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-small);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--login-input-border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
    font-family: var(--primary-font);
}

.form-input:focus {
    outline: none;
    border-color: var(--login-input-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Autocomplete Select Container */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--login-input-border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
    font-family: var(--primary-font);
    cursor: text;
}

.autocomplete-input:focus {
    outline: none;
    border-color: var(--login-input-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.autocomplete-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    pointer-events: none;
    opacity: 0.5;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--login-input-focus);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    direction: rtl;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: right;
}

.autocomplete-option:hover,
.autocomplete-option.highlighted {
    background: #f0f0f0;
}

.autocomplete-option.selected {
    background: #e6f0ff;
    font-weight: 600;
}

.autocomplete-no-results {
    padding: 12px 16px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--login-button-gradient-start) 0%, var(--login-button-gradient-end) 100%);
    color: var(--button-text-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.error-message {
    background: var(--login-error-bg);
    color: var(--login-error-text);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-right: 4px solid var(--login-error-border);
    font-size: var(--font-size-small);
    display: none;
    transition: all 0.3s ease;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Credentials Section */
.credentials-section {
    transition: all 0.4s ease;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.credentials-section.show {
    opacity: 1;
    max-height: 200px;
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: var(--font-size-small);
}

/* Animations */
@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        max-width: 100%;
        margin: 20px;
    }

    .login-title {
        font-size: var(--font-size-xl);
    }

    .step span:last-child {
        display: none;
    }

    .step-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

/* OTP Modal Styles - Uses same form-input styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    direction: rtl;
}

.otp-modal {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.otp-modal .modal-header {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.otp-modal .modal-header  {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: normal;  /* ✅ NOT bold */
    color: #2c3e50;
    text-align: center;   /* ✅ Centered */
}

.modal-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
    text-align: center;   /* ✅ Centered */
}

.otp-modal .modal-body {
    padding: 15px 10px;
}

.otp-input-container {
    text-align: center;
    margin-bottom: 16px;
}

/* OTP input uses .form-input class */
.otp-input-container .form-input {
    max-width: 100%;
    text-align: right;
}

.otp-input-container small {
    display: block;
    margin-top: 12px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

.otp-error {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin-top: 16px;
    color: #856404;
    font-size: 14px;
    text-align: center;
}

.otp-modal .modal-footer {
    padding: 16px 24px 24px 24px;  /* ✅ Added bottom padding */
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;  /* ✅ Centered */
    align-items: center;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--login-button-gradient-start) 0%, var(--login-button-gradient-end) 100%);
    color: var(--button-text-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}