/**
 * Form Validation Styles
 * Provides visual feedback for form validation
 */

/* Field States */
.form-control.input-error {
    border-color: #ff4444 !important;
    background-color: #fff5f5;
}

.form-control.input-success {
    border-color: #00C851 !important;
    background-color: #f0fff4;
}

/* Error Messages */
.field-error-message {
    color: #ff4444;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

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

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

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

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.strength-text {
    font-weight: 500;
}

.strength-requirements {
    color: #666;
}

/* Validation Icons */
.form-control.input-error ~ .validation-icon::after {
    content: "✕";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff4444;
    font-size: 18px;
}

.form-control.input-success ~ .validation-icon::after {
    content: "✓";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #00C851;
    font-size: 18px;
    font-weight: bold;
}

/* Form Group Spacing */
.form-group {
    margin-bottom: 20px;
}

.form-group.has-error {
    margin-bottom: 25px;
}

/* Input Focus States */
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-control.input-error:focus {
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.form-control.input-success:focus {
    box-shadow: 0 0 0 3px rgba(0, 200, 81, 0.1);
}

/* Loading State */
.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .field-error-message {
        font-size: 12px;
    }
    
    .password-strength-indicator {
        margin-top: 6px;
    }
    
    .strength-info {
        font-size: 11px;
    }
}

/* Form Row for Side-by-Side Fields */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group-half {
        margin-bottom: 20px;
    }
}

/* Terms Checkbox Error State */
.terms-check.has-error {
    color: #ff4444;
}

.terms-check.has-error input[type="checkbox"] {
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

/* Password Toggle Button */
.password-input-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: #000;
}

.password-toggle-btn:focus {
    outline: none;
}

/* Input Padding Adjustment for Password Fields */
.password-input-wrapper .form-control {
    padding-right: 45px;
}

