/* Common Styles for BOSSWeb Application */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: var(--font-weight-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container Styles */
.login-container {
    background: white;
    padding: 1.8rem;
    border-radius: 9px;
    box-shadow: 0 13.5px 31.5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 360px;
    margin: 18px;
}

/* Header Styles */
.login-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-header h2 {
    color: #1e293b;
    font-size: 1.875rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.5rem;
    letter-spacing: var(--letter-spacing-tight);
}

.login-header p {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: var(--font-weight-normal);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: #374151;
    font-weight: var(--font-weight-medium);
    font-size: 0.7875rem;
    letter-spacing: var(--letter-spacing-wide);
}

.form-control,
input.form-control,
select.form-control {
    width: 100% !important;
    padding: 0.7875rem 0.9rem !important;
    border: 1.8px solid #e2e8f0 !important;
    border-radius: 7.2px !important;
    font-size: 0.7875rem !important;
    font-weight: 400 !important;
    font-family: var(--font-primary) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

.form-control::placeholder,
input.form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
}

.form-control:focus,
input.form-control:focus,
select.form-control:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-1px) !important;
}

.form-control:hover:not(:focus),
input.form-control:hover:not(:focus),
select.form-control:hover:not(:focus) {
    border-color: #94a3b8 !important;
}

/* Ensure select dropdown styling matches inputs */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Force consistent styling for all input types */
input[type="text"].form-control,
input[type="password"].form-control,
select.form-control,
input.form-control,
#fLoginID,
#fLoginPwd,
#filterCompany {
    width: 100% !important;
    padding: 0.7875rem 0.9rem !important;
    border: 1.8px solid #e2e8f0 !important;
    border-radius: 7.2px !important;
    font-size: 0.7875rem !important;
    font-weight: 400 !important;
    font-family: var(--font-primary) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

#fLoginID::placeholder,
#fLoginPwd::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
}

#fLoginID:focus,
#fLoginPwd:focus,
#filterCompany:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-1px) !important;
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 0.675rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5.4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.9rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-login.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message Styles */
.error-message {
    background-color: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #c33;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
}