﻿/* Auth Page Variables */
:root {
    --purple-primary: #209aa2;
    --purple-dark: #205b5f;
    --purple-light: #86b7ba;
    --purple-lightest: #FFF1E3;
    --purple-gradient: linear-gradient(135deg, #209aa2 0%, #205b5f 100%);
    --text-primary: #205b5f;
    --text-secondary: #6d8d90;
    --border-color: #dce8e9;
    --success: #86b7ba;
    --error: #EF4444;
    --white: #FFFFFF;
    --shadow-lg: 0 25px 50px -12px rgba(32, 154, 162, 0.25);
}

/* ============================================
   LOGIN PAGE - Split Layout Design
   ============================================ */

.login-page {
    min-height: 100vh;
    background: #f5f9f9;
    display: flex;
    align-items: stretch;
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Side - Branding Section */
.login-branding {
    flex: 1;
    background: var(--purple-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -300px;
    right: -300px;
    animation: float 20s ease-in-out infinite;
}

.login-branding::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.branding-content {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    max-width: 400px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-logo svg {
    width: 50px;
    height: 50px;
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.branding-illustration {
    margin-bottom: 40px;
}

.branding-illustration svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

.branding-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
}

.branding-subtitle {
    font-size: 1.15rem;
    opacity: 0.95;
    margin: 0 0 40px;
    line-height: 1.6;
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.5;
}

.feature-item svg {
    color: #86b7ba;
    flex-shrink: 0;
}

/* Right Side - Form Section */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: white;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-header {
    margin-bottom: 36px;
    text-align: center;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Login Form */
.login-form {
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-row .form-label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 0.9rem;
    color: var(--purple-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--purple-dark);
    text-decoration: underline;
}

.login-form .input-wrapper {
    position: relative;
}

.login-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.login-form .form-input {
    width: 100%;
    padding: 16px 50px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

/* Password field - ensure proper bullet display */
.login-form .form-input[type="password"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.15em;
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(32, 154, 162, 0.1);
}

.login-form .form-input:focus ~ .input-icon,
.login-form .input-wrapper:focus-within .input-icon {
    color: var(--purple-primary);
}

.login-form .form-input::placeholder {
    color: #9cb5b8;
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--purple-primary);
}

/* Custom Checkbox */
.form-options {
    margin-bottom: 28px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-checkbox .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--purple-gradient);
    border-color: var(--purple-primary);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px 28px;
    background: var(--purple-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(32, 154, 162, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-login::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.5s ease;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(32, 154, 162, 0.45);
}

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

.btn-login:hover svg {
    transform: translateX(4px);
}

.btn-login svg {
    transition: transform 0.3s ease;
}

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

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

/* Social Divider */
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    gap: 12px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-divider span {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

/* Google Sign-in Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 24px;
    background: #fff;
    color: #3c4043;
    border: 1.5px solid #dadce0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-google:active {
    background: #f1f3f4;
}

.register-link span {
    color: var(--text-secondary);
    font-size: 15px;
}

.register-link a {
    color: var(--purple-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: var(--purple-dark);
    text-decoration: underline;
}

/* Test Credentials */
.test-credentials {
    background: linear-gradient(135deg, #FFF1E3 0%, #f0f5f5 100%);
    border: 2px solid var(--purple-lightest);
    border-radius: 12px;
    padding: 20px;
}

.credentials-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--purple-dark);
    font-size: 14px;
    margin-bottom: 12px;
}

.credentials-header svg {
    color: var(--purple-primary);
}

.credentials-content p {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Validation */
.validation-summary {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.validation-error {
    display: block;
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 6px;
    font-weight: 500;
}

.validation-error:empty {
    display: none;
}

/* ============================================
   RTL Support for Login Page
   ============================================ */

body.rtl .login-container {
    flex-direction: row-reverse;
}

body.rtl .login-header,
body.rtl .register-link {
    text-align: center;
}

body.rtl .login-form .form-label,
body.rtl .label-row {
    text-align: right;
}

body.rtl .label-row {
    flex-direction: row-reverse;
}

body.rtl .login-form .input-icon {
    left: auto;
    right: 16px;
}

body.rtl .login-form .form-input {
    padding: 16px 48px 16px 50px;
    text-align: right;
}

body.rtl .toggle-password {
    right: auto;
    left: 16px;
}

body.rtl .custom-checkbox {
    flex-direction: row-reverse;
}

body.rtl .btn-login {
    flex-direction: row-reverse;
}

body.rtl .btn-login svg {
    transform: scaleX(-1);
}

body.rtl .btn-login:hover svg {
    transform: scaleX(-1) translateX(4px);
}

body.rtl .register-link a {
    margin-left: 0;
    margin-right: 6px;
}

body.rtl .branding-features {
    text-align: right;
}

body.rtl .feature-item {
    flex-direction: row-reverse;
}

body.rtl .credentials-header {
    flex-direction: row-reverse;
}

body.rtl .credentials-content {
    text-align: right;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .login-branding {
        display: none;
    }
    
    .login-form-section {
        padding: 40px 20px;
    }
    
    .login-page {
        background: var(--purple-gradient);
    }
    
    .login-form-section {
        margin: 20px;
        border-radius: 24px;
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 576px) {
    .login-form-section {
        margin: 15px;
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 26px;
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .login-form .form-input {
        padding: 14px 45px 14px 45px;
    }
}

/* ============================================
   Legacy Auth Page Styles (for other pages)
   ============================================ */

.auth-page {
    min-height: 100vh;
    background: var(--purple-gradient);
    position: relative;
    overflow: hidden;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: float 20s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -175px;
    left: -175px;
    animation: float 15s ease-in-out infinite reverse;
}

.auth-container {
    max-width: 480px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    background: var(--purple-gradient);
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-title {
    color: var(--white);
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.auth-body {
    padding: 40px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.link-purple {
    color: var(--purple-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link-purple:hover {
    color: var(--purple-dark);
    text-decoration: underline;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

[data-theme="dark"] {
    --text-primary: #dce8e9;
    --text-secondary: #9cb5b8;
    --border-color: #5a7a7e;
    --white: #1a2e35;
}

/* Login Page Dark Mode */
[data-theme="dark"] .login-page {
    background: #0f2224;
}

[data-theme="dark"] .login-form-section {
    background: #205b5f;
}

[data-theme="dark"] .login-title {
    color: #dce8e9;
}

[data-theme="dark"] .login-subtitle {
    color: #9cb5b8;
}

[data-theme="dark"] .login-form .form-label {
    color: #dce8e9;
}

[data-theme="dark"] .login-form .form-input {
    background: #1a3a3d;
    border-color: #5a7a7e;
    color: #dce8e9;
}

[data-theme="dark"] .login-form .form-input::placeholder {
    color: #6d8d90;
}

[data-theme="dark"] .login-form .form-input:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(32, 154, 162, 0.2);
}

[data-theme="dark"] .login-form .input-icon {
    color: #6d8d90;
}

[data-theme="dark"] .toggle-password {
    color: #6d8d90;
}

[data-theme="dark"] .toggle-password:hover {
    color: var(--purple-light);
}

[data-theme="dark"] .custom-checkbox .checkmark {
    border-color: #5a7a7e;
    background: #1a3a3d;
}

[data-theme="dark"] .checkbox-label {
    color: #9cb5b8;
}

[data-theme="dark"] .register-link span {
    color: #9cb5b8;
}

[data-theme="dark"] .register-link a {
    color: var(--purple-light);
}

[data-theme="dark"] .test-credentials {
    background: #1a3a3d;
    border-color: #5a7a7e;
}

[data-theme="dark"] .credentials-header {
    color: #9cb5b8;
}

[data-theme="dark"] .credential-item strong {
    color: #dce8e9;
}

[data-theme="dark"] .credential-item code {
    background: #205b5f;
    color: var(--purple-light);
}

[data-theme="dark"] .validation-summary {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

[data-theme="dark"] .validation-error {
    color: #FCA5A5;
}

/* Register Page Dark Mode */
[data-theme="dark"] .register-page {
    background: #0f2224;
}

[data-theme="dark"] .register-form-section {
    background: #205b5f;
}

[data-theme="dark"] .register-title {
    color: #dce8e9;
}

[data-theme="dark"] .register-subtitle {
    color: #9cb5b8;
}

[data-theme="dark"] .step-label {
    color: #9cb5b8;
}

[data-theme="dark"] .step-indicator {
    background: #1a3a3d;
    border-color: #5a7a7e;
    color: #9cb5b8;
}

[data-theme="dark"] .step.active .step-indicator {
    background: var(--purple-gradient);
    border-color: var(--purple-primary);
    color: white;
}

[data-theme="dark"] .step.completed .step-indicator {
    background: var(--success);
    border-color: var(--success);
}

[data-theme="dark"] .form-section .form-label {
    color: #dce8e9;
}

[data-theme="dark"] .form-section .form-input,
[data-theme="dark"] .form-section .form-select,
[data-theme="dark"] .form-section .form-textarea {
    background: #1a3a3d;
    border-color: #5a7a7e;
    color: #dce8e9;
}

[data-theme="dark"] .form-section .form-input::placeholder,
[data-theme="dark"] .form-section .form-textarea::placeholder {
    color: #6d8d90;
}

[data-theme="dark"] .form-section .form-input:focus,
[data-theme="dark"] .form-section .form-select:focus,
[data-theme="dark"] .form-section .form-textarea:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(32, 154, 162, 0.2);
}

[data-theme="dark"] .form-section .input-icon {
    color: #6d8d90;
}

[data-theme="dark"] .form-footer span,
[data-theme="dark"] .form-footer p {
    color: #9cb5b8;
}

[data-theme="dark"] .form-footer a {
    color: var(--purple-light);
}

/* Auth Card Dark Mode (Fallback styles) */
[data-theme="dark"] .auth-page {
    background: #0f2224;
}

[data-theme="dark"] .auth-card {
    background: #205b5f;
}

[data-theme="dark"] .auth-body {
    background: #205b5f;
}

[data-theme="dark"] .auth-body .form-label {
    color: #dce8e9;
}

[data-theme="dark"] .auth-body .form-input {
    background: #1a3a3d;
    border-color: #5a7a7e;
    color: #dce8e9;
}

[data-theme="dark"] .auth-body .form-input::placeholder {
    color: #6d8d90;
}

[data-theme="dark"] .auth-body .form-input:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px rgba(32, 154, 162, 0.2);
}
