/* =====================================================
   Formulários Responsivos - ClubeMix
   =====================================================
   Descrição: Estilos para formulários otimizados para mobile
   Data: 2025-11-09
   ===================================================== */

/* Formulários Responsivos */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #FFD700;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    background: rgba(30, 30, 30, 0.5);
    color: white;
    font-size: 16px; /* Previne zoom automático no iOS */
    line-height: 1.5;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background: rgba(30, 30, 30, 0.7);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Textarea */
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    background: rgba(30, 30, 30, 0.5);
    color: white;
    font-size: 16px;
    line-height: 1.5;
    min-height: 120px;
    resize: vertical;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background: rgba(30, 30, 30, 0.7);
}

/* Select */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    background: rgba(30, 30, 30, 0.5);
    color: white;
    font-size: 16px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23FFD700' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background-color: rgba(30, 30, 30, 0.7);
}

/* Checkbox e Radio */
.form-checkbox,
.form-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(30, 30, 30, 0.5);
    transition: all 0.2s;
}

.form-checkbox {
    border-radius: 0.25rem;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background: #FFD700;
    border-color: #FFD700;
}

.form-checkbox:checked::after {
    content: '✓';
    display: block;
    text-align: center;
    color: black;
    font-weight: bold;
    font-size: 14px;
    line-height: 16px;
}

.form-radio:checked::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: black;
    border-radius: 50%;
    margin: 4px auto;
}

/* Grid Responsivo para Formulários */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Campos Full Width */
.form-grid .form-group-full {
    grid-column: 1 / -1;
}

/* Mensagens de Erro */
.form-error {
    display: block;
    margin-top: 0.5rem;
    color: #ef4444;
    font-size: 0.875rem;
}

.form-input:invalid:not(:placeholder-shown) + .form-error {
    display: block;
}

/* Mensagens de Sucesso */
.form-success {
    display: block;
    margin-top: 0.5rem;
    color: #10b981;
    font-size: 0.875rem;
}

/* Help Text */
.form-help {
    display: block;
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Botões de Formulário */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions button,
.form-actions .btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions .btn {
        width: 100%;
    }
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .input-group {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .input-group .form-input {
        flex: 1;
    }
}

/* Máscaras de Input */
.form-input-masked {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* Melhorias para Mobile */
@media (max-width: 768px) {
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Previne zoom no iOS */
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
}

