/* =====================================
   FORM ENHANCEMENTS
   Estilos melhorados para formulários
   ===================================== */

/* Input wrapper with icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    padding-left: 45px;
}

/* Input states */
input,
textarea,
select {
    font-family: var(--font-family);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

input.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(255, 77, 106, 0.1) !important;
}

input.input-success:not(:focus) {
    border-color: var(--success) !important;
}

input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(255, 77, 106, 0.2) !important;
}

input.input-success ~ .input-icon {
    color: var(--success);
}

input.input-error ~ .input-icon {
    color: var(--error);
}

/* Error message */
.error-message {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--error);
    font-size: var(--text-sm);
    margin-top: 6px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message i {
    font-size: var(--text-xs);
}

/* Input hint */
.input-hint {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Required indicator */
.required {
    color: var(--error);
    margin-left: 2px;
}

/* Form group improvements */
.form-group label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Select styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A8AA7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Checkbox and Radio custom */
.custom-checkbox,
.custom-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 12px;
    border-radius: var(--border-radius-md);
    transition: background var(--transition-fast);
}

.custom-checkbox:hover,
.custom-radio:hover {
    background: rgba(255, 255, 255, 0.03);
}

.custom-checkbox input[type="checkbox"],
.custom-radio input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.custom-radio input[type="radio"] {
    border-radius: 50%;
}

.custom-checkbox input[type="checkbox"]:checked,
.custom-radio input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.custom-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* File input custom */
.custom-file-input {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.custom-file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 2px dashed var(--text-secondary);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.file-label:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.file-label i {
    color: var(--primary);
}

/* Textarea auto-resize */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* Form section divider */
.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-divider::before {
    margin-right: 1rem;
}

.form-divider::after {
    margin-left: 1rem;
}

/* Input with button */
.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

.input-with-button button {
    flex-shrink: 0;
}

/* Floating labels */
.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea {
    padding-top: 24px;
    padding-bottom: 8px;
}

.floating-label label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition-fast);
    background: transparent;
    padding: 0 4px;
}

.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label,
.floating-label textarea:focus ~ label,
.floating-label textarea:not(:placeholder-shown) ~ label {
    top: 8px;
    font-size: var(--text-xs);
    color: var(--primary);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Form progress */
.form-progress {
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-with-button {
        flex-direction: column;
    }
    
    .input-with-button button {
        width: 100%;
    }
}

