/**
 * LQ-FORMS - Authentication Pages Styles
 * Styles for login, register, password reset pages
 */

:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --text-dark: #1a202c; /* Darkened from #2d3748 for better visibility */
    --text-medium: #4a5568; /* Added medium darkness for labels */
    --text-light: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --input-bg: #ffffff;
    --input-text: #2d3748; /* Darker text for input fields */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4285f4, #34a853);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

.auth-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.auth-header h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    font-size: 1.75rem;
}

.auth-header p {
    margin: 0;
    color: var(--text-medium); /* Changed from text-light to medium for better visibility */
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600; /* Increased from 500 to 600 for better visibility */
    color: var(--text-dark); /* Changed from text-dark to darker color */
    font-size: 0.95rem; /* Slightly larger for better readability */
    letter-spacing: 0.02em;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    width: 100%;
    color: var(--input-text); /* Added explicit text color */
    font-weight: 500; /* Make input text more visible */
}

.form-group input::placeholder {
    color: #a0aec0; /* Slightly darker placeholder */
    font-weight: 400;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
    background-color: var(--input-bg);
    color: var(--input-text); /* Ensure text remains visible on focus */
}

.form-group input:hover {
    border-color: #cbd5e0;
    background-color: var(--input-bg);
}

/* Specific styles for password fields to ensure visibility */
.form-group input[type="password"] {
    color: var(--input-text);
    font-weight: 500;
    letter-spacing: 0.05em; /* Slight spacing for password dots */
}

.form-group input[type="email"],
.form-group input[type="text"] {
    color: var(--input-text);
    font-weight: 500;
}

.btn {
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0;
    color: var(--text-medium); /* Changed from text-light to medium for better visibility */
    font-weight: 500;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600; /* Increased from 500 for better visibility */
}

.text-link:hover {
    text-decoration: underline;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark); /* Darkened for better visibility */
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

/* Features Section */
.auth-features {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-features h2 {
    margin: 0 0 2rem 0;
    font-size: 1.75rem;
    text-align: center;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.feature-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-error a {
    color: #721c24;
    text-decoration: underline;
}

.alert-success a {
    color: #155724;
    font-weight: 600;
    text-decoration: underline;
}

/* Password strength indicator */
.password-strength {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-medium); /* Changed from text-light to medium */
    font-weight: 500;
}

/* Loading state */
.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Form validation styles */
.form-group input.invalid {
    border-color: var(--danger-color);
}

.form-group input.valid {
    border-color: var(--success-color);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: flex-start;
        background: #f7fafc;
        min-height: 100vh;
    }

    .auth-container {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: auto;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .auth-features {
        display: none;
    }
    
    .auth-card {
        padding: 2rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        color: var(--input-text); /* Ensure mobile visibility */
        font-weight: 500;
    }

    .btn {
        padding: 16px 20px;
    }

    .form-group label {
        font-weight: 600;
        color: var(--text-dark);
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-logo {
        margin-bottom: 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .auth-header h1 {
        font-size: 1.375rem;
    }

    .auth-form {
        gap: 1.25rem;
    }

    .form-group label {
        font-size: 0.92rem; /* Slightly larger on mobile */
    }
}

@media (max-width: 320px) {
    .auth-card {
        padding: 1.25rem;
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
    }
    
    .auth-header p {
        font-size: 0.85rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }
}

/* Extra small devices and landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 10px;
    }

    .auth-container {
        min-height: auto;
        margin: 10px 0;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-container {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: #2d3748;
        color: #e2e8f0;
    }

    .auth-header h1,
    .logo-text,
    .form-group label,
    .checkbox-label {
        color: #f7fafc; /* Lighter color for dark mode */
    }

    .auth-header p,
    .auth-footer p {
        color: #e2e8f0; /* Lighter for better contrast */
    }

    .form-group input {
        background-color: #4a5568;
        border-color: #718096;
        color: #f7fafc; /* Light text on dark background */
        font-weight: 500;
    }

    .form-group input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
        color: #f7fafc;
    }

    .form-group input::placeholder {
        color: #cbd5e0; /* Lighter placeholder for dark mode */
    }

    :root {
        --input-text: #f7fafc; /* Light text for dark mode inputs */
    }
}

/* Footer Top Responsive Styles */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #0099ff;
    color: white;
    padding: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-top > div {
        padding: 4px !important;
    }
    
    #footer-clock {
        order: -1; /* Put clock at top on mobile */
        width: 100%;
    }
}

@media (max-width: 480px) {
    .footer-top {
        font-size: 12px !important;
    }
    
    #footer-clock {
        font-size: 11px !important;
    }
}