/* ============================================
   Professional Split-Screen Login Design
   Realtor Antalya CRM
   ============================================ */

:root {
    --primary-blue: #da0021;
    --primary-blue-dark: #b00019;
    --primary-blue-light: #ff0029;
    --success-green: #10b981;
    --error-red: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   Split Screen Layout
   ============================================ */

.login-split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   Left Panel - Branding
   ============================================ */

.login-left-panel {
    flex: 1;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.login-branding {
    max-width: 500px;
    color: var(--white);
}

.login-brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.login-brand-logo i {
    font-size: 40px;
    color: var(--white);
}

.login-brand-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.login-brand-subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 48px;
    font-weight: 400;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    opacity: 0.95;
}

.login-feature-item i {
    font-size: 24px;
    color: var(--white);
    flex-shrink: 0;
}

/* ============================================
   Right Panel - Form
   ============================================ */

.login-right-panel {
    flex: 1;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow-y: auto;
    position: relative; /* Required for absolute positioning of language selector */
}

.login-form-container {
    width: 100%;
    max-width: 440px;
}

.login-form-header {
    margin-bottom: 40px;
}

.login-form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-form-subtitle {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 400;
}

/* ============================================
   Form Elements
   ============================================ */

.login-form {
    width: 100%;
}

.login-form-group {
    margin-bottom: 24px;
}

.login-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.login-input-wrapper {
    position: relative;
}

.login-form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-900);
    font-family: inherit;
    transition: all 0.2s;
}

.login-form-control:focus {
    outline: none;
    border-color: rgba(218, 0, 33, 0.6);
    box-shadow: 0 0 0 3px rgba(218, 0, 33, 0.1);
}

.login-form-control::placeholder {
    color: var(--gray-400);
}

.login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 18px;
    pointer-events: none;
}

.login-input-wrapper:focus-within .login-input-icon {
    color: var(--primary-blue);
}

.login-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-password-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.login-password-toggle:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ============================================
   Checkbox & Options
   ============================================ */

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.login-checkbox-wrapper {
    display: flex;
    align-items: center;
}

.login-checkbox {
    display: none;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
    user-select: none;
}

.login-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.login-checkbox:checked + .login-checkbox-label .login-checkbox-custom {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.login-checkbox:checked + .login-checkbox-label .login-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

.login-forgot-link {
    font-size: 14px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-forgot-link:hover {
    text-decoration: underline;
}

/* ============================================
   Submit Button
   ============================================ */

.login-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--primary-blue-dark);
}

.login-btn:active {
    transform: translateY(1px);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn-text {
    flex: 1;
    text-align: center;
}

.login-btn-icon {
    font-size: 18px;
}

.login-spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.login-btn.loading .login-spinner {
    display: block;
}

.login-btn.loading .login-btn-text,
.login-btn.loading .login-btn-icon {
    opacity: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Alerts & Validation
   ============================================ */

.login-alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 3px solid;
}

.login-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-red);
    color: var(--error-red);
}

.login-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-green);
    color: var(--success-green);
}

.login-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.login-alert-content {
    flex: 1;
}

.login-alert-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
}

.login-alert-content p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.login-validation-error {
    color: var(--error-red);
    font-size: 13px;
    margin-top: 6px;
    display: none; /* Hidden by default, shown via JavaScript */
}

.login-form-control.is-invalid {
    border-color: var(--error-red);
    background: rgba(239, 68, 68, 0.05);
}

.login-form-control.is-invalid:focus {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.login-validation-summary {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-red);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    border-left: 3px solid var(--error-red);
}

/* ============================================
   Footer
   ============================================ */

.login-form-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-form-footer p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .login-left-panel,
    .login-right-panel {
        padding: 40px;
    }
    
    .login-brand-title {
        font-size: 40px;
    }
    
    .login-brand-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .login-split-screen {
        flex-direction: column;
    }
    
    .login-left-panel {
        padding: 40px 24px;
        min-height: auto;
    }
    
    .login-branding {
        max-width: 100%;
        text-align: center;
    }
    
    .login-brand-logo {
        margin-left: auto;
        margin-right: auto;
    }
    
    .login-brand-title {
        font-size: 36px;
    }
    
    .login-brand-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .login-features {
        display: none;
    }
    
    .login-right-panel {
        padding: 40px 24px;
    }
    
    .login-form-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .login-left-panel {
        padding: 32px 20px;
    }
    
    .login-brand-logo {
        width: 64px;
        height: 64px;
    }
    
    .login-brand-logo i {
        font-size: 32px;
    }
    
    .login-brand-title {
        font-size: 28px;
    }
    
    .login-brand-subtitle {
        font-size: 14px;
    }
    
    .login-right-panel {
        padding: 32px 20px;
    }
    
    .login-form-title {
        font-size: 24px;
    }
    
    .login-form-subtitle {
        font-size: 14px;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Language Selector - Top Right
   ============================================ */

.login-language-selector {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
}

.login-language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-language-btn:hover {
    border-color: var(--primary-blue);
    background: var(--gray-50);
    color: var(--primary-blue);
}

.login-language-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.login-language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-language-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-language-icon {
    font-size: 12px;
    transition: transform 0.2s;
    color: var(--gray-500);
}

.login-language-btn.open .login-language-icon {
    transform: rotate(180deg);
}

.login-language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.login-language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.login-language-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.login-language-item:hover {
    background: var(--gray-50);
    color: var(--primary-blue);
}

.login-language-item.active {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-blue);
    font-weight: 600;
}

.login-language-item .login-language-flag {
    width: 20px;
    height: 15px;
}

.login-language-name {
    flex: 1;
    font-size: 14px;
}

.login-language-check {
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: bold;
}

/* ============================================
   Focus States & Accessibility
   ============================================ */

.login-btn:focus-visible,
.login-forgot-link:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ============================================
   Loading State
   ============================================ */

.login-form.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================
   Responsive - Language Selector
   ============================================ */

@media (max-width: 768px) {
    .login-language-selector {
        top: 16px;
        right: 16px;
    }
    
    .login-language-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .login-language-flag {
        width: 18px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .login-language-selector {
        top: 12px;
        right: 12px;
    }
    
    .login-language-btn {
        padding: 6px 10px;
    }
    
    .login-language-text {
        display: none;
    }
    
    .login-language-dropdown {
        min-width: 160px;
    }
}
