/* Base Styles */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e5e7eb;
    --background-color: #f0f2f5;
    --white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    padding: 0;
}

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

.login-left {
    width: 40%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-left-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    text-align: center;
}

.quote-container {
    max-width: 400px;
    margin: 0 auto;
}

.quote {
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.login-right {
    width: 60%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-form-container {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    padding: 1.75rem;
}

/* Logo and Header */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container img {
    max-width: 140px;
    height: auto;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    font-size: 16px;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .fas {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 1.25rem;
    z-index: 1;
    pointer-events: none;
    transition: color 0.2s ease-in-out;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: #1a1a1a;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.input-wrapper input[type="password"] {
    padding-right: 3rem;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-wrapper input:focus ~ .fas,
.input-wrapper input:focus ~ .password-toggle {
    color: var(--primary-color);
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: color 0.2s ease-in-out;
    z-index: 2;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--primary-color);
    outline: none;
}

/* Password Header */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.forgot-password {
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

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

/* Remember Me */
.remember-me {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

/* Login Page Specific */
.login-body {
    margin-top: 0.5rem;
}

.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

.text-center.mt-3 {
    margin-top: 1rem !important;
}

.text-center.mt-3 small {
    font-size: 13px;
    color: var(--text-muted);
}

.text-center.mt-3 i {
    margin-right: 0.375rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    background: white;
    padding: 0;
    transition: all 0.2s ease-in-out;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check-input:hover {
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease-in-out;
}

.form-check-label:hover {
    color: var(--text-color);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* Error States */
.is-invalid {
    border-color: #dc2626 !important;
}

.invalid-feedback {
    color: #dc2626;
    font-size: 12px;
    margin-top: 0.25rem;
}

/* Responsive Styles */
@media (max-width: 1280px) {
    .login-left {
        width: 35%;
    }
    
    .login-right {
        width: 65%;
    }
}

@media (max-width: 1024px) {
    .login-split {
        flex-direction: column;
    }

    .login-left, .login-right {
        width: 100%;
    }

    .login-left {
        min-height: 120px;
        max-height: 15vh;
    }

    .login-right {
        flex: 1;
        padding: 0.75rem;
    }

    .login-form-container {
        padding: 1rem;
        max-width: 100%;
        margin: 0 auto;
    }

    /* Login specific mobile adjustments */
    .password-header {
        margin-bottom: 0.375rem;
    }

    .remember-me {
        margin: 0.75rem 0;
    }

    .form-check-label {
        font-size: 13px;
    }

    .text-center.mt-3 {
        margin-top: 0.75rem !important;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }

    .input-wrapper input {
        font-size: 16px;
        padding: 0.625rem 1rem 0.625rem 2.5rem;
    }

    .login-header h1 {
        font-size: 20px;
        margin-bottom: 0.25rem;
    }

    .login-subtitle {
        font-size: 14px;
        margin-bottom: 1rem;
    }

    .logo-container {
        margin-bottom: 0.75rem;
    }

    .logo-container img {
        max-width: 110px;
    }

    .quote-container {
        display: none;
    }

    .btn-login {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-left {
        min-height: 100px;
        max-height: 12vh;
    }

    .login-right {
        padding: 0.5rem;
    }

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

    /* Login specific small screen adjustments */
    .password-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .forgot-password {
        font-size: 12px;
    }

    .remember-me {
        margin: 0.5rem 0;
    }

    .text-center.mt-3 small {
        font-size: 12px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 0.375rem;
    }

    .input-wrapper input {
        padding: 0.5rem 1rem 0.5rem 2.25rem;
    }

    .login-header h1 {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 13px;
        margin-bottom: 0.875rem;
    }

    .logo-container img {
        max-width: 100px;
    }
}

/* Face Enrollment Mobile Styles */
@media (max-width: 768px) {
    .face-enrollment-split {
        flex-direction: column;
    }

    .face-enrollment-left,
    .face-enrollment-right {
        width: 100%;
        max-height: none;
    }

    .face-enrollment-left {
        display: none;
    }

    .face-enrollment-form-container {
        margin: 1rem;
        padding: 1.25rem;
    }

    .steps-container {
        flex-direction: column;
    }

    .step {
        margin-bottom: 1.25rem;
    }
}

/* Face Enrollment Styles */
.face-enrollment-container {
    min-height: 100vh;
    background-color: var(--background-color);
}

.face-enrollment-split {
    display: flex;
    min-height: 100vh;
}

.face-enrollment-left {
    width: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.face-enrollment-right {
    width: 50%;
    background: var(--white);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.face-enrollment-left-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.face-enrollment-instructions {
    max-width: 600px;
    margin: 0 auto;
}

.face-enrollment-instructions h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.steps-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.step {
    text-align: center;
    flex: 1;
}

.step i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.benefits {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
}

.benefits h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.benefits ul {
    list-style: none;
    padding: 0;
}

.benefits li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.benefits li i {
    margin-right: 1rem;
}

.face-enrollment-form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* QR Code Section */
.qr-container {
    text-align: center;
    padding: 2rem;
}

.qr-code {
    max-width: 256px;
    margin: 2rem auto;
}

.qr-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--background-color);
}

/* Webcam Section */
.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

.video-container video,
.video-container canvas {
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.video-container canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.face-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: var(--white);
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
}