/* =========================================
   FORCE FIX: Styles for Volunteer Form
   ========================================= */

/* 1. Основний контейнер */
.tfv-scope {
    font-family: 'Inter', sans-serif !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.tfv-scope * {
    box-sizing: border-box !important;
}

/* 2. Сітка (2 колонки) */
.tfv-scope .vb-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 25px !important;
}

/* 3. Поля вводу (Floating Labels) */
.tfv-scope .fl-field {
    position: relative !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    height: 60px !important; /* Фіксована висота */
    margin-bottom: 0 !important;
}

.tfv-scope .tfe-form-input, 
.tfv-scope .tfe-form-textarea {
    width: 100% !important;
    height: 100% !important;
    padding: 24px 16px 4px !important; /* Місце для тексту знизу */
    background: transparent !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    z-index: 2;
    position: relative;
}

/* Лейбл (Текст, що плаває) */
.tfv-scope .fl-label {
    position: absolute !important;
    left: 16px !important;
    top: 20px !important;
    font-size: 14px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    pointer-events: none !important;
    transition: 0.2s ease-out !important;
    z-index: 1;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Логіка підняття лейбла */
.tfv-scope .tfe-form-input:focus ~ .fl-label,
.tfv-scope .tfe-form-input:not(:placeholder-shown) ~ .fl-label,
.tfv-scope .has-value .fl-label {
    top: 8px !important;
    font-size: 10px !important;
    color: #3b82f6 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

/* 4. ВИПРАВЛЕННЯ ДРОПДАУНУ (Країни) */
.tfv-scope .vb-dd {
    cursor: pointer !important;
}

.tfv-scope .vb-dd-trigger {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 24px 16px 4px !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.tfv-scope .vb-dd-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

/* ПРИХОВУЄМО СПИСОК ЗА ЗАМОВЧУВАННЯМ - ЦЕ ГОЛОВНА ПРОБЛЕМА СКРІНУ */
.tfv-scope .vb-dd-panel {
    display: none !important; /* Приховано! */
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    z-index: 999 !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    margin-top: 5px !important;
}

/* Показуємо, коли активний */
.tfv-scope .vb-dd.open .vb-dd-panel {
    display: block !important;
}

.tfv-scope .vb-dd-option {
    padding: 12px 16px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
.tfv-scope .vb-dd-option:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

/* 5. ЧИПИ (Кнопки замість чекбоксів) */
.tfv-scope .tfe-chips-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 10px 0 25px !important;
}

.tfv-scope .tfe-chip-check {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ховаємо жахливий стандартний чекбокс */
.tfv-scope .tfe-chip-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Стилізуємо спан як кнопку */
.tfv-scope .tfe-chip-check span {
    display: inline-block !important;
    padding: 10px 20px !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: 0.2s !important;
}

/* Активний стан */
.tfv-scope .tfe-chip-check input:checked + span {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3) !important;
}

/* 6. Textareas */
.tfv-scope .fl-field:has(textarea) {
    height: auto !important;
}
.tfv-scope .tfe-form-textarea {
    min-height: 100px !important;
    padding-top: 30px !important;
    resize: vertical;
}

/* Мобільна версія */
@media (max-width: 768px) {
    .tfv-scope .vb-grid { grid-template-columns: 1fr !important; }
}

/* v6.1.3 native select fallback for volunteer form dropdowns */
.tfv-scope,
.tfv-scope .vb-form,
.tfv-scope .vb-grid {
    overflow: visible !important;
}
.tfv-scope .tfv-select-field {
    position: relative !important;
    overflow: visible !important;
}
.tfv-scope .tfv-native-select {
    cursor: pointer !important;
    padding-right: 44px !important;
    appearance: auto !important;
    -webkit-appearance: menulist !important;
}
.tfv-scope .tfv-native-select option {
    color: #0f172a !important;
    background: #fff !important;
}
.tfv-scope .tfv-native-select ~ .fl-label {
    top: 8px !important;
    font-size: 10px !important;
    color: #2563eb !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
}
.tfv-scope .vb-dd.open {
    z-index: 100000 !important;
}
.tfv-scope .vb-dd-panel {
    z-index: 100001 !important;
}
