/* Login Popup Styles */
.vh-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 30, 33, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: vh-fadeIn 0.5s ease-out;
}

.vh-login-popup {
    background: linear-gradient(135deg, #edf6f9 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 20px 40px rgba(0, 109, 119, 0.15),
        0 0 0 1px rgba(131, 197, 190, 0.2);
    animation: vh-slideUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.vh-login-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #006d77, #83c5be);
}

.vh-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.vh-login-title {
    font-family: 'Cinzel Decorative', serif;
    color: #006d77;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.vh-login-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

.vh-form-group {
    margin-bottom: 24px;
}

.vh-label {
    display: block;
    color: #1c1e21;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.vh-input-wrapper {
    position: relative;
}

.vh-input {
    width: 100%;
    padding: 14px 45px 14px 45px; /* Fixed padding to accommodate icons */
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    color: #1c1e21;
    box-sizing: border-box;
    /* Ensure text doesn't overlap icons */
    text-indent: 0;
}

/* Placeholder styling */
.vh-input::placeholder {
    color: #a0a0a0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.vh-input:focus::placeholder {
    opacity: 0.7;
}

.vh-input:focus {
    outline: none;
    border-color: #83c5be;
    box-shadow: 0 0 0 3px rgba(131, 197, 190, 0.1);
    /* Ensure focus state maintains proper spacing */
    padding: 14px 45px 14px 45px;
}

.vh-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #83c5be;
    z-index: 2; /* Ensure icon stays above input */
    pointer-events: none; /* Prevent icon from blocking input */
}

/* Specific styling for password field to accommodate toggle button */
#vh-password {
    padding-right: 45px; /* Extra space for toggle button */
}

.vh-password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #83c5be;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
    z-index: 3; /* Ensure toggle button stays above everything */
}

.vh-password-toggle:hover {
    color: #006d77;
    background: rgba(131, 197, 190, 0.1);
}

/* Ensure input text starts after the icon */
.vh-input-wrapper::after {
    content: '';
    position: absolute;
    left: 45px; /* Match the left padding */
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0;
    background: transparent;
    pointer-events: none;
}

/* Fix for Webkit browsers (Chrome, Safari) */
.vh-input {
    /* Prevent text from going under icons in Webkit browsers */
    -webkit-padding-start: 45px !important;
    padding-inline-start: 45px !important;
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    .vh-input {
        text-indent: 0;
    }
}

/* Ensure the input field has proper text alignment */
.vh-input {
    text-align: left;
    direction: ltr;
}

/* Style for when input has value */
.vh-input:not(:placeholder-shown) {
    /* Additional styles for filled inputs if needed */
    border-color: #83c5be;
}

.vh-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.vh-remember {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
}

.vh-remember input {
    display: none;
}

.vh-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.vh-remember input:checked + .vh-checkbox {
    background: #006d77;
    border-color: #006d77;
}

.vh-remember input:checked + .vh-checkbox::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.vh-forgot-password {
    color: #006d77;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.vh-forgot-password:hover {
    color: #83c5be;
    text-decoration: underline;
}

.vh-login-button {
    width: 100%;
    background: linear-gradient(135deg, #006d77 0%, #83c5be 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vh-login-button:hover:not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 109, 119, 0.3);
}

.vh-login-button:active {
    transform: translateY(0);
}

.vh-button-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vh-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: vh-spin 0.8s linear infinite;
}

.vh-login-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
    animation: vh-slideDown 0.3s ease-out;
}

.vh-login-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vh-login-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vh-login-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.vh-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

/* Close button */
.vh-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.vh-close-popup:hover {
    background: rgba(0, 109, 119, 0.1);
    color: #006d77;
    transform: rotate(90deg);
}

/* Animations */
@keyframes vh-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vh-slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes vh-slideDown {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes vh-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .vh-login-popup {
        padding: 30px 24px;
        margin: 20px;
    }
    
    .vh-login-title {
        font-size: 24px;
    }
    
    .vh-form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    /* Adjust padding for mobile */
    .vh-input {
        padding: 12px 40px 12px 40px;
    }
    
    #vh-password {
        padding-right: 40px;
    }
    
    .vh-input-icon {
        left: 12px;
    }
    
    .vh-password-toggle {
        right: 12px;
    }
}

/* Loading state */
.vh-login-button.loading .vh-button-text {
    opacity: 0;
}

.vh-login-button.loading .vh-button-loader {
    display: block;
}

/* Error states for inputs */
.vh-input.error {
    border-color: #e74c3c;
    animation: vh-shake 0.4s ease-in-out;
}

@keyframes vh-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success state for inputs */
.vh-input.success {
    border-color: #83c5be;
}

/* Ensure proper z-index stacking */
.vh-input-wrapper {
    z-index: 1;
}

.vh-input {
    z-index: 1;
    position: relative;
}

/* Fix for specific browser issues */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .vh-input {
        /* Webkit specific fixes */
        -webkit-appearance: none;
        border-radius: 12px;
    }
}