/* ===== LOGIN PAGE STYLES ===== */

:root {
    --primary-blue: #3662e3; /* Slightly softer blue */
    --primary-light: #6a8ee6;
    --primary-dark: #2a4baa;
    --text-dark: #2a3541; /* Slightly darker for better contrast */
    --text-light: #6b7280;
    --border-light: #e0e2e7; /* Softer border color */
    --background-light: #f8f9fa; /* Lighter background */
    --success-green: #28a745;
    --error-red: #dc3545;
    --warning-orange: #ffc107;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background-light);
}

/* ===== LOGIN PAGE LAYOUT ===== */

.login-page {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 100vh;
    overflow: hidden;
}

/* Left Panel - Branding */
.login-left {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    color: white;
    padding: 4.5rem 3.5rem; /* Slightly more padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Establishes a new stacking context */
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/images/logo/logo-removebg-preview.png') center/cover no-repeat;
    opacity: 0.05; /* Even more subtle background image */
    /* mix-blend-mode: luminosity; Removed for better text visibility */
    z-index: -1; /* Place behind content */
}

.login-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

.login-brand {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.brand-logo {
    width: 70px; /* Slightly smaller */
    height: 70px;
    background: rgba(255, 255, 255, 0.1); /* More subtle background */
    border-radius: var(--border-radius-md); /* Use new variable */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem; /* Reduced margin */
    backdrop-filter: blur(8px); /* Slightly less blur */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Softer border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Add subtle shadow */
}

.brand-logo svg {
    color: white;
}

.login-brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.login-brand p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-features {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    opacity: 0.95;
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white background */
    padding: 0.75rem 1rem; /* Added padding */
    border-radius: var(--border-radius-sm); /* Rounded corners */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Light border */
    backdrop-filter: blur(5px); /* Slightly blur background behind item */
}

.feature-item svg {
    flex-shrink: 0;
}

/* Right Panel - Forms */
.login-right {
    background: white;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-y: auto;
}

.login-form-container {
    width: 100%;
    max-width: 480px;
    padding: 2.5rem; /* Consistent padding */
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Softer, more spread out shadow */
    background: white; /* Explicitly set background */
}

/* Login Type Selector */
.login-type-selector {
    display: flex;
    gap: 0.75rem; /* Slightly reduced gap */
    margin-bottom: 2rem; /* Reduced margin */
    background: var(--background-light);
    padding: 0.4rem; /* Slightly less padding */
    border-radius: var(--border-radius-md); /* Use new variable */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle inner shadow */
}

.login-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem; /* Adjusted padding */
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm); /* Use new variable */
    font-size: 0.9rem; /* Slightly smaller font */
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
}

.login-type-btn:hover {
    color: var(--primary-blue);
    /* Had to manually convert to RGBA as original was invalid for var() */
    background: rgba(54, 98, 227, 0.05); /* Using rgba for hover effect */
}

.login-type-btn.active {
    background: white;
    color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Softer, larger shadow */
    font-weight: 700; /* Bolder for active state */
}

/* Forms */
.login-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.login-form.active {
    display: block;
}

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

.form-header {
    margin-bottom: 1.8rem; /* Adjusted margin */
    text-align: left;
}

.form-header h2 {
    font-size: 1.6rem; /* Slightly smaller */
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem; /* Adjusted margin */
}

.form-header p {
    color: var(--text-light);
    font-size: 0.9rem; /* Slightly smaller */
}

/* Form Groups */
.form-group {
    margin-bottom: 1.3rem; /* Adjusted margin */
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Adjusted gap */
    font-size: 0.85rem; /* Slightly smaller */
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem; /* Adjusted margin */
}

.form-group label svg {
    color: var(--primary-blue);
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem; /* Adjusted padding */
    border: 1px solid var(--border-light); /* Thinner border */
    border-radius: var(--border-radius-sm); /* Use new variable */
    font-size: 0.9rem; /* Slightly smaller font */
    transition: all 0.2s ease; /* Faster transition */
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04); /* Subtle inner shadow */
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    /* Had to manually convert to RGBA as original was invalid for var() */
    box-shadow: 0 0 0 3px rgba(54, 98, 227, 0.2); /* Softer focus shadow */
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 2.8rem; /* Adjusted padding */
}

.toggle-password {
    position: absolute;
    right: 0.6rem; /* Adjusted position */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.2rem; /* Adjusted padding */
    display: flex;
    align-items: center;
    transition: color 0.2s ease; /* Faster transition */
}

.toggle-password:hover {
    color: var(--primary-dark); /* Darker on hover */
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem; /* Adjusted margin */
    font-size: 0.85rem; /* Slightly smaller */
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Adjusted gap */
    cursor: pointer;
    color: var(--text-dark);
}

.remember-me input {
    width: auto;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease; /* Faster transition */
}

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

/* Login Button */
.login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem; /* Adjusted gap */
    padding: 0.9rem 1.4rem; /* Adjusted padding */
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%); /* Clearer gradient */
    color: white;
    border: none;
    border-radius: var(--border-radius-sm); /* Use new variable */
    font-size: 0.95rem; /* Adjusted font size */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    /* Had to manually convert to RGBA as original was invalid for var() */
    box-shadow: 0 6px 16px rgba(54, 98, 227, 0.25); /* Softer, larger shadow */
}

.login-btn:hover {
    transform: translateY(-1px); /* More subtle lift */
    /* Had to manually convert to RGBA as original was invalid for var() */
    box-shadow: 0 8px 20px rgba(54, 98, 227, 0.35); /* Increased shadow on hover */
}

.login-btn:active {
    transform: translateY(0);
    /* Had to manually convert to RGBA as original was invalid for var() */
    box-shadow: 0 4px 10px rgba(54, 98, 227, 0.2); /* Pressed state shadow */
}

.login-btn.admin-btn {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--text-dark) 100%); /* Admin button gradient */
    box-shadow: 0 6px 16px rgba(42, 53, 65, 0.25); /* Admin button shadow */
}

.login-btn.admin-btn:hover {
    box-shadow: 0 8px 20px rgba(42, 53, 65, 0.35);
}

/* Form Footer */
.form-footer {
    margin-top: 1.8rem; /* Adjusted margin */
    padding-top: 1.8rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 0.85rem; /* Adjusted font size */
}

.form-footer p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark); /* Darker on hover */
}

/* Back to Home */
.back-home {
    margin-top: 2rem;
    padding-top: 1.5rem; /* Add some padding to differentiate from footer */
    text-align: center;
}

.back-home a {
    display: inline-flex; /* Use inline-flex for better alignment */
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-home a:hover {
    color: var(--primary-blue);
    transform: translateX(-2px); /* Slightly less transform */
}

/* ===== MODALS ===== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--border-radius-lg); /* Use new variable */
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2); /* Softer, larger shadow */
    animation: slideUp 0.4s ease forwards; /* Added forwards to keep final state */
}

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

.modal-close {
    position: absolute;
    top: 0.8rem; /* Adjusted position */
    right: 0.8rem;
    background: var(--background-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease; /* Faster transition */
    color: var(--text-light);
}

.modal-close:hover {
    background: var(--border-light);
    transform: rotate(90deg) scale(1.1); /* More pronounced hover effect */
    color: var(--text-dark);
}

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

.modal-header svg {
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.modal-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Help Options */
.help-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.help-option:hover {
    background: var(--border-light);
    transform: translateX(5px);
}

.help-option svg {
    color: var(--primary-blue);
    flex-shrink: 0;
}

.help-option div {
    display: flex;
    flex-direction: column;
}

.help-option strong {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.help-option span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 3rem 1.5rem; /* Adjusted padding */
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1); /* Subtle shadow for visual separation */
        border-radius: var(--border-radius-lg); /* Match container border-radius */
        margin: 1.5rem; /* Add some margin around the container */
    }

    .login-form-container {
        max-width: 400px; /* Slightly smaller max-width on smaller screens */
        padding: 2rem;
        box-shadow: none; /* Remove inner shadow when right panel has shadow */
    }
}

@media (max-width: 640px) {
    .login-type-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }

    .login-right {
        margin: 0.75rem; /* Reduce margin further on mobile */
        padding: 2rem 1rem;
    }

    .login-form-container {
        padding: 1.5rem;
    }
}

/* ===== HOME BUTTON ===== */
.home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

.home-button:hover {
    background-color: var(--background-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: var(--primary-blue);
}

.home-button svg {
    color: var(--primary-blue);
}

@media (max-width: 1024px) {
    .home-button {
        top: 15px;
        left: 15px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .home-button {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .home-button span {
        display: none; /* Hide text on very small screens */
    }
}