/**
 * HR Portal Login Page Styles
 * 
 * This file provides the split-panel login page design with feature highlights
 * and modern form styling.
 * 
 * Requirements: 1.1, 1.4, 1.5, 1.6
 */

/* ============================================
   Login Page Container
   ============================================ */
.login-page-wrapper {
    min-height: 100vh;
    background-color: var(--hr-bg-page, #F5F7FA);
    display: flex;
    flex-direction: column;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 60px);
}

/* ============================================
   Split Panel Layout
   ============================================ */
.login-left-panel {
    flex: 1;
    background-image: url('/images/banner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

/* Dark overlay for better text readability */
.login-left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(16, 57, 128, 0.87);
    pointer-events: none;
    z-index: 0;
}

/* Decorative polka dots overlay */
.login-left-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 15%, transparent 30%),
        radial-gradient(circle at 5% 85%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 12%, transparent 25%),
        radial-gradient(circle at 95% 75%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 10%, transparent 22%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 8%, transparent 18%);
    pointer-events: none;
    z-index: 1;
}

.login-right-panel {
    flex: 1;
    background-color: var(--hr-bg-page, #F5F7FA);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ============================================
   Left Panel - Branding Section
   ============================================ */
.login-branding {
    position: relative;
    z-index: 1;
    margin-bottom: 2.5rem;
    text-align: center;
}

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

.login-logo img {
    width: 60px;
    height: auto;
}

.login-logo img.hr-portal-logo {
    width: 140px;
    height: auto;
    max-width: 100%;
}

.login-logo-text {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.3;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    text-align: center;
}

.login-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    color: #E8F4FD;
    text-align: center;
}

.login-tagline {
    font-size: 1.25rem;
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.95;
    color: #FFFFFF;
    line-height: 1.6;
    text-align: center;
}

.login-tagline-ml {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.9;
    color: #E8F4FD;
    line-height: 1.7;
    text-align: center;
}

/* ============================================
   Feature Highlight Cards
   ============================================ */
.feature-cards {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.feature-icon i,
.feature-icon .material-icons-outlined {
    color: #FFFFFF !important;
    font-size: 24px;
}

.feature-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #FFFFFF;
}

.feature-content p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.85;
    color: #E8F4FD;
    line-height: 1.4;
}

/* ============================================
   Right Panel - Login Form
   ============================================ */
.login-form-wrapper {
    width: 100%;
    max-width: 475px;
}

.login-form-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.login-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hr-text-primary, #1F2937);
    margin-bottom: 0.5rem;
}

.login-form-header p {
    font-size: 0.9375rem;
    color: var(--hr-text-secondary, #6B7280);
    margin: 0;
}

/* ============================================
   Form Elements
   ============================================ */
.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hr-text-primary, #1F2937);
    margin-bottom: 0.5rem;
    display: block;
}

.login-form .form-control {
    height: 48px;
    border-radius: 10px;
    border: 1.5px solid var(--hr-border, #E5E7EB);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background-color: #FFFFFF;
}

.login-form .form-control:focus {
    border-color: var(--hr-primary, #0066CC);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    outline: none;
}

.login-form .form-control::placeholder {
    color: var(--hr-text-muted, #9CA3AF) !important;
}

/* Input Group for Password */
.login-form .input-group {
    position: relative;
}

.login-form .input-group .form-control {
    padding-right: 48px;
}

.login-form .input-group .input-group-text,
.login-form .password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 48px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hr-text-secondary, #6B7280);
    z-index: 10;
}

.login-form .password-toggle:hover {
    color: var(--hr-primary, #0066CC);
}

/* ============================================
   CAPTCHA Section
   ============================================ */
.captcha-section {
    margin-bottom: 1.5rem;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.captcha-text {
    flex: 1;
    background-color: #F5F7FA;
    border: 1px dashed var(--hr-border, #E5E7EB);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    color: var(--hr-text-primary, #1F2937);
    user-select: none;
}

.captcha-char {
    display: inline-block;
    margin: 0 2px;
}

.refresh-captcha {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--hr-bg-page, #F5F7FA);
    border: 1px solid var(--hr-border, #E5E7EB);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hr-text-secondary, #6B7280);
    transition: all 0.2s ease;
}

.refresh-captcha:hover {
    background: var(--hr-primary-light, #E8F4FD);
    border-color: var(--hr-primary, #0066CC);
    color: var(--hr-primary, #0066CC);
}

.captcha-input {
    margin-top: 0.5rem;
}

/* ============================================
   Sign In Button
   ============================================ */
.btn-signin {
    width: 100%;
    height: 52px;
    background-color: var(--hr-primary, #0066CC);
    border: none;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.btn-signin:hover {
    background-color: var(--hr-primary-dark, #004C99);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
    color: #FFFFFF;
}

.btn-signin:active {
    background-color: #003366;
}

.btn-signin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-signin i,
.btn-signin .material-icons-outlined {
    color: #FFFFFF !important;
}

/* ============================================
   Error Messages
   ============================================ */
.login-form .text-danger,
.login-form .field-error {
    font-size: 0.8125rem;
    color: var(--hr-error, #EF4444) !important;
    margin-top: 0.375rem;
    display: block;
}

.login-form .is-invalid {
    border-color: var(--hr-error, #EF4444) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Alert Messages */
.login-form .alert {
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.login-form .alert-danger {
    background-color: #FEE2E2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.login-form .alert-success {
    background-color: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

/* ============================================
   Login Footer
   ============================================ */
.login-footer {
    background: var(--hr-bg-white, #FFFFFF);
    border-top: 1px solid var(--hr-border, #E5E7EB);
    padding: 1rem 2rem;
    text-align: center;
}

.login-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--hr-text-secondary, #6B7280);
}

.login-footer a {
    color: var(--hr-primary, #0066CC);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Responsive Design
   Requirements: 1.7, 6.3, 6.4, 6.5
   ============================================ */

/* Large Desktop (>1200px) - Full layout */
@media (min-width: 1200px) {
    .login-left-panel {
        padding: 4rem;
    }
    
    .login-form-card {
        padding: 3rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .login-left-panel {
        padding: 2rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .login-form-card {
        padding: 2rem;
    }
}

/* Mobile - Stack panels vertically with login form first */
@media (max-width: 768px) {
    .login-page-wrapper {
        min-height: 100vh;
    }
    
    .login-container {
        flex-direction: column-reverse;
        min-height: auto;
    }
    
    /* Login form appears first on mobile (order: 1 with column-reverse) */
    .login-right-panel {
        flex: none;
        padding: 1.5rem;
        order: 1;
    }
    
    /* Feature panel appears second on mobile */
    .login-left-panel {
        flex: none;
        padding: 2rem 1.5rem;
        order: 2;
    }
    
    .login-form-wrapper {
        max-width: 100%;
    }
    
    .login-form-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
    
    .login-tagline {
        font-size: 1.125rem;
        margin-top: 1.5rem;
    }
    
    .login-tagline-ml {
        font-size: 1rem;
    }
    
    .feature-cards {
        gap: 0.75rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .feature-content h4 {
        font-size: 0.9375rem;
    }
    
    .feature-content p {
        font-size: 0.8125rem;
    }
    
    /* Ensure touch targets are at least 44px for accessibility */
    .login-form .form-control,
    .btn-signin,
    .refresh-captcha,
    .password-toggle {
        min-height: 44px;
    }
    
    /* Adjust form label font size for mobile */
    .login-form .form-label {
        font-size: 0.8125rem;
    }
    
    /* Adjust form header for mobile */
    .login-form-header h2 {
        font-size: 1.5rem;
    }
    
    .login-form-header p {
        font-size: 0.875rem;
    }
    
    /* Login footer adjustments */
    .login-footer {
        padding: 0.75rem 1rem;
    }
    
    .login-footer p {
        font-size: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .login-right-panel {
        padding: 1rem;
    }
    
    .login-left-panel {
        padding: 1.5rem 1rem;
    }
    
    .login-form-card {
        padding: 1.25rem;
    }
    
    .login-form-header h2 {
        font-size: 1.375rem;
    }
    
    .login-branding {
        margin-bottom: 1.5rem;
    }
    
    .login-logo img {
        width: 48px;
    }
    
    .login-logo img.hr-portal-logo {
        width: 100px;
    }
    
    .login-logo-text {
        font-size: 12px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.9375rem;
    }
    
    .login-tagline {
        font-size: 1rem;
        margin-top: 1.25rem;
    }
    
    .login-tagline-ml {
        font-size: 0.9375rem;
    }
    
    .captcha-text {
        font-size: 1.25rem;
        letter-spacing: 2px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Stack captcha elements on very small screens */
    .captcha-display {
        flex-wrap: wrap;
    }
    
    .captcha-text {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    .refresh-captcha {
        margin-left: auto;
    }
}

/* ============================================
   Animation Effects
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-card {
    animation: fadeInUp 0.5s ease-out;
}

.feature-card {
    animation: fadeInUp 0.5s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================
   Legacy Support - Override existing styles
   ============================================ */
.backstage {
    background-color: var(--hr-bg-page, #F5F7FA) !important;
    background-image: none !important;
}

.login-label {
    color: var(--hr-text-primary, #1F2937) !important;
}

/* Override existing button styles for login - Flat Design */
.btn-grd-primary,
.btn-grd-kmeet {
    background-color: var(--hr-primary, #0066CC) !important;
    background-image: none !important;
    border: none !important;
    color: #FFFFFF !important;
}

.btn-grd-primary:hover,
.btn-grd-kmeet:hover {
    background-color: var(--hr-primary-dark, #004C99) !important;
}

/* Password toggle button styling */
.pswd-btun {
    background-color: transparent !important;
    border: none !important;
    color: var(--hr-text-secondary, #6B7280) !important;
}

.pswd-btun:hover {
    color: var(--hr-primary, #0066CC) !important;
}
