/* Form and input styles for consistent use across the site */

/* Address form styles */
.address-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.remove-address-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#add-address-line {
    padding: 2px 10px;
    margin-top: 5px;
    font-size: 14px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
    min-height: auto;
}

.address-display {
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    background-color: var(--bg);
}

.address-display p {
    margin: 5px 0;
    padding: 0;
}

/* Enhanced Form Validation Styles */
.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group.has-error input {
    border-color: #e74c3c;
    background-color: #fdf2f2;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.form-group.has-success input {
    border-color: #27ae60;
    background-color: #f2f9f5;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

.form-group.has-warning input {
    border-color: #f39c12;
    background-color: #fef9f2;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.1);
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    display: block;
    opacity: 1;
}

.success-message {
    color: #27ae60;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-message.show {
    display: block;
    opacity: 1;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    display: none;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.password-strength.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

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

.strength-fill.weak {
    background-color: #e74c3c;
    width: 25%;
}

.strength-fill.fair {
    background-color: #f39c12;
    width: 50%;
}

.strength-fill.good {
    background-color: #3498db;
    width: 75%;
}

.strength-fill.strong {
    background-color: #27ae60;
    width: 100%;
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
}

.strength-text.weak {
    color: #e74c3c;
}

.strength-text.fair {
    color: #f39c12;
}

.strength-text.good {
    color: #3498db;
}

.strength-text.strong {
    color: #27ae60;
}

/* Input Icons for Validation */
.form-group.has-error::after {
    content: "⚠";
    position: absolute;
    right: 12px;
    top: 38px;
    color: #e74c3c;
    font-size: 16px;
    pointer-events: none;
}

.form-group.has-success::after {
    content: "✓";
    position: absolute;
    right: 12px;
    top: 38px;
    color: #27ae60;
    font-size: 16px;
    pointer-events: none;
}

/* Real-time validation pulse effect */
.form-group input:focus {
    animation: focusPulse 0.3s ease;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(42, 101, 146, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(42, 101, 146, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(42, 101, 146, 0);
    }
}

/* Enhanced button states */
.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: buttonSpin 1s linear infinite;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Inline logout/loading icon-only spinner helper */
.loading-inline {
    position: relative;
}
.loading-inline .fa-spinner {
    animation: buttonSpin 1s linear infinite;
}

/* Responsive styles for forms */
@media (max-width: 480px) {
    .form-control {
        font-size: 14px;
        padding: 8px;
    }
    
    .btn-small {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .address-display {
        padding: 8px;
    }
    
    .error-message,
    .success-message {
        font-size: 11px;
    }
    
    .form-group.has-error::after,
    .form-group.has-success::after {
        right: 8px;
        font-size: 14px;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .address-item {
        gap: 8px;
    }
} 