/**
 * iFood Logistics - Form Styles
 * Estilos base para os formularios de conversao
 *
 * @package IfoodLogistics
 */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
    --ifood-primary: #EA0033;
    --ifood-primary-dark: #C5002B;
    --ifood-success: #28a745;
    --ifood-error: #dc3545;
    --ifood-gray-100: #f8f9fa;
    --ifood-gray-200: #e9ecef;
    --ifood-gray-300: #dee2e6;
    --ifood-gray-500: #adb5bd;
    --ifood-gray-700: #495057;
    --ifood-gray-900: #212529;
    --ifood-border-radius: 8px;
    --ifood-transition: 0.2s ease;
}

/* ==========================================================================
   Form Container
   ========================================================================== */

.ifood-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.ifood-form *,
.ifood-form *::before,
.ifood-form *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.ifood-form__field {
    margin-bottom: 1rem;
}

.ifood-form__field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--ifood-gray-700);
    font-size: 0.875rem;
}

/* ==========================================================================
   Inputs & Selects
   ========================================================================== */

.ifood-form__input,
.ifood-form__select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ifood-gray-900);
    background-color: #fff;
    border: 1px solid var(--ifood-gray-300);
    border-radius: var(--ifood-border-radius);
    transition: border-color var(--ifood-transition), box-shadow var(--ifood-transition);
    appearance: none;
    -webkit-appearance: none;
}

.ifood-form__input:focus,
.ifood-form__select:focus {
    outline: none;
    border-color: var(--ifood-primary);
    box-shadow: 0 0 0 3px rgba(234, 0, 51, 0.15);
}

.ifood-form__input::placeholder {
    color: var(--ifood-gray-500);
}

/* Select arrow */
.ifood-form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ==========================================================================
   Checkboxes
   ========================================================================== */

.ifood-form__field--checkbox {
    margin-top: 1.5rem;
}

.ifood-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ifood-gray-700);
}

.ifood-form__checkbox {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--ifood-gray-300);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--ifood-transition);
    appearance: none;
    -webkit-appearance: none;
}

.ifood-form__checkbox:checked {
    background-color: var(--ifood-primary);
    border-color: var(--ifood-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M10.28 2.28L4.5 8.06 1.72 5.28a1 1 0 00-1.44 1.44l3.5 3.5a1 1 0 001.44 0l6.5-6.5a1 1 0 00-1.44-1.44z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.ifood-form__checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(234, 0, 51, 0.15);
}

/* ==========================================================================
   Radio Buttons
   ========================================================================== */

.ifood-form__radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ifood-form__radio-label {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.ifood-form__radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.ifood-form__radio-label span {
    display: block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ifood-gray-700);
    background-color: var(--ifood-gray-100);
    border: 1px solid var(--ifood-gray-300);
    border-radius: var(--ifood-border-radius);
    transition: all var(--ifood-transition);
}

.ifood-form__radio:checked + span {
    color: var(--ifood-primary);
    background-color: #fff;
    border-color: var(--ifood-primary);
    font-weight: 600;
}

.ifood-form__radio:focus + span {
    box-shadow: 0 0 0 3px rgba(234, 0, 51, 0.15);
}

.ifood-form__radio-label:hover span {
    border-color: var(--ifood-gray-500);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.ifood-form__submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--ifood-primary);
    border: none;
    border-radius: var(--ifood-border-radius);
    cursor: pointer;
    transition: background-color var(--ifood-transition), transform var(--ifood-transition);
    margin-top: 1rem;
}

.ifood-form__submit:hover:not(:disabled) {
    background-color: var(--ifood-primary-dark);
}

.ifood-form__submit:active:not(:disabled) {
    transform: scale(0.98);
}

.ifood-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ifood-form__submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(234, 0, 51, 0.3);
}

/* ==========================================================================
   Messages
   ========================================================================== */

.ifood-form__message {
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-radius: var(--ifood-border-radius);
    text-align: center;
}

.ifood-form__message--success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.ifood-form__message--error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .ifood-form__radio-group {
        gap: 0.5rem;
    }

    .ifood-form__radio-label span {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .ifood-form__checkbox-label {
        font-size: 0.8125rem;
    }

    .ifood-form__input,
    .ifood-form__select {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }
}

/* ==========================================================================
   Elementor Compatibility
   ========================================================================== */

.elementor-widget-shortcode .ifood-form {
    max-width: 100%;
}

/* Remove estilos conflitantes do Elementor */
.elementor-widget-shortcode .ifood-form__input,
.elementor-widget-shortcode .ifood-form__select {
    min-height: auto;
    height: auto;
}
