/* Shared Auth Modal CSS - MyGlobalWeb */
/* ======================================== */
/* Login and Registration Modal Styling */

/* Modal Base Styles */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-modal-overlay.show {
    display: flex;
}

/* Login Card - Staff Style */
.auth-modal-login {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    max-width: 550px;
    width: 90%;
    animation: slideDown 0.3s ease;
    position: relative;
}

/* Registration Card - Customer Style */
.auth-modal-register {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    position: relative;
}

/* Modal Header */
.auth-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-modal-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
    display: inline-block;
}

.auth-modal-header h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.8rem;
}

.auth-modal-header p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

/* Store Info Badge (for staff login) */
.auth-modal-store-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.auth-modal-store-info.show {
    display: block;
}

.auth-modal-store-info small {
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.auth-modal-store-info h5 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

/* Form Styles */
.auth-modal-form {
    margin: 0;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-right: none;
    padding: 10px 12px;
    border-radius: 6px 0 0 6px;
    color: #666;
    display: flex;
    align-items: center;
}

.auth-form-control {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.auth-input-group .auth-form-control {
    border-left: none;
    padding-right: 50px; /* Make room for password toggle button */
}

.auth-form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.auth-input-group:focus-within .auth-input-icon {
    border-color: #667eea;
    background: #f0f2ff;
}

/* Password Toggle Button */
.auth-password-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    background: white;
    border: none;
    border-left: 1px solid #ced4da;
    border-radius: 0 5px 5px 0;
    padding: 0 14px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    min-width: 45px;
}

.auth-password-toggle:hover {
    background: #f8f9fa;
    color: #667eea;
}

.auth-password-toggle:active {
    background: #e9ecef;
}

.auth-password-toggle i {
    font-size: 16px;
}

/* Checkbox Styles */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.auth-checkbox {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auth-checkbox-label {
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* Custom Checkbox for Terms */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 30px;
    line-height: 1.5;
    color: #666;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-label:hover input ~ .checkmark {
    border-color: #667eea;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-bar-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-bar-fill.weak {
    width: 33%;
    background: #dc3545;
}

.strength-bar-fill.medium {
    width: 66%;
    background: #ffc107;
}

.strength-bar-fill.strong {
    width: 100%;
    background: #28a745;
}

/* Form Hint Text */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

.form-hint.error {
    color: #dc3545;
}

.form-hint.success {
    color: #28a745;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.auth-error-message {
    display: none;
    padding: 12px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    color: #842029;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.auth-error-message.show {
    display: block;
    animation: shake 0.3s ease;
}

.auth-error-message i {
    margin-right: 8px;
}

/* Success Message */
.auth-success-message {
    display: none;
    padding: 12px;
    background: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 6px;
    color: #0f5132;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.auth-success-message.show {
    display: block;
}

/* Footer Links */
.auth-modal-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.auth-modal-footer p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.auth-modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-modal-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-modal-login,
    .auth-modal-register {
        padding: 30px 20px;
        margin: 20px;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .auth-modal-icon {
        font-size: 3rem;
    }
    
    .auth-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-form-group {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .auth-modal-login,
    .auth-modal-register {
        width: 95%;
        padding: 25px 15px;
    }
    
    .auth-submit-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}
