/* Dark theme for Gravity Forms */
html[data-bs-theme="dark"] .form-has-collapsible-sections {
    color: #e0e6ed;
}

/* Form body and container */
html[data-bs-theme="dark"] .gform_body {
    color: #e0e6ed;
}

/* Input fields - text, email, phone, number */
html[data-bs-theme="dark"] input[type="text"],
html[data-bs-theme="dark"] input[type="email"],
html[data-bs-theme="dark"] input[type="tel"],
html[data-bs-theme="dark"] input[type="number"],
html[data-bs-theme="dark"] select {
    background-color: #1e2841;
    border-color: #2a3650;
    color: #e0e6ed;
}

html[data-bs-theme="dark"] input[type="text"]:focus,
html[data-bs-theme="dark"] input[type="email"]:focus,
html[data-bs-theme="dark"] input[type="tel"]:focus,
html[data-bs-theme="dark"] input[type="number"]:focus,
html[data-bs-theme="dark"] select:focus {
    background-color: #232f42;
    border-color: #6b8aaa;
    color: #e0e6ed;
    outline: none;
}

html[data-bs-theme="dark"] input::placeholder {
    color: #6c7d95;
}

/* Labels and legends */
html[data-bs-theme="dark"] .gfield_label,
html[data-bs-theme="dark"] .gform-field-label,
html[data-bs-theme="dark"] legend {
    color: #e0e6ed;
}

html[data-bs-theme="dark"] .gform-field-label--type-sub {
    color: #a8b2c0;
}

/* Required indicator */
html[data-bs-theme="dark"] .gfield_required,
html[data-bs-theme="dark"] .gfield_required_text {
    color: #ff6b6b;
}

/* Section titles */
html[data-bs-theme="dark"] .gsection_title {
    color: #e0e6ed;
    border-bottom-color: #2a3650;
}

/* Section titles inside collapsible bodies - add accent color */
html[data-bs-theme="dark"] .collapsible-sections-collapsible-body .gsection_title {
    color: #b8d4a8;
    border-bottom-color: #4a5d3f;
    font-weight: 500;
}

/* Collapsible section headers */
html[data-bs-theme="dark"] .collapsible-sections-field,
html[data-bs-theme="dark"] .gsection.collapsible-sections-field {
    background-color: #1a2332 !important;
    border: 1px solid #3a4556 !important;
    border-radius: 6px !important;
}

html[data-bs-theme="dark"] .collapsible-sections-field .gsection_title {
    color: #b8c5d6 !important;
}

html[data-bs-theme="dark"] .collapsible-sections-field:hover,
html[data-bs-theme="dark"] .gsection.collapsible-sections-field:hover {
    background-color: #1f2841 !important;
    border-color: #4a5870 !important;
}

html[data-bs-theme="dark"] .collapsible-sections-field:hover .gsection_title {
    color: #e8f0f7 !important;
}

html[data-bs-theme="dark"] .collapsible-sections-field.collapsible-sections-open,
html[data-bs-theme="dark"] .gsection.collapsible-sections-field.collapsible-sections-open {
    background-color: #1f2841 !important;
    border-color: #7da3c6 !important;
    border-width: 1px !important;
}

html[data-bs-theme="dark"] .collapsible-sections-field.collapsible-sections-open .gsection_title {
    color: #a8d5ff !important;
}

/* Collapsible body */
html[data-bs-theme="dark"] .collapsible-sections-collapsible-body {
    background-color: transparent;
    border: none !important;
}

/* Add subtle background to open sections for better visual separation */
html[data-bs-theme="dark"] .collapsible-sections-field.collapsible-sections-open + .collapsible-sections-collapsible-body {
    background-color: rgba(26, 35, 50, 0.4);
    padding: 1.5rem;
    border-radius: 0 0 6px 6px;
    margin-top: -6px;
    border: 1px solid #3a4556 !important;
    border-top: none !important;
}

/* Checkboxes and radio buttons */
html[data-bs-theme="dark"] .gchoice label {
    color: #d0dae5;
}

html[data-bs-theme="dark"] input[type="checkbox"],
html[data-bs-theme="dark"] input[type="radio"] {
    accent-color: #8fb3d5;
}

html[data-bs-theme="dark"] .gchoice:hover label {
    color: #e0e6ed;
}

html[data-bs-theme="dark"] input[type="checkbox"]:checked,
html[data-bs-theme="dark"] input[type="radio"]:checked {
    accent-color: #7ea8d1;
}

/* Select dropdowns */
html[data-bs-theme="dark"] select option {
    background-color: #1e2841;
    color: #e0e6ed;
}

/* Validation container (honeypot) */
html[data-bs-theme="dark"] .gform_validation_container {
    opacity: 0.5;
}

html[data-bs-theme="dark"] .gfield_description {
    color: #a8b2c0;
}

/* Admin hidden markup */
html[data-bs-theme="dark"] .admin-hidden-markup {
    color: #6c7d95;
    background-color: #1a2332;
    border-color: #2a3650;
}

/* Form footer */
html[data-bs-theme="dark"] .gform_footer {
    border-top-color: #2a3650;
}

/* Buttons - preserve existing styles but ensure visibility */
html[data-bs-theme="dark"] #gform_submit_button_6 {
    background-color: #5a6b8a;
    border-color: #5a6b8a;
    color: #ffffff;
}

html[data-bs-theme="dark"] #gform_submit_button_6:hover {
    background-color: #6a7b9a;
    border-color: #6a7b9a;
}

/* Save & Continue button - keep green from byb.css but ensure dark mode compatibility */
html[data-bs-theme="dark"] #gform_save_6_footer_link {
    background-color: #2d8a5f !important;
    border-color: #2d8a5f !important;
}

html[data-bs-theme="dark"] #gform_save_6_footer_link:hover {
    background-color: #3a9b6f !important;
    border-color: #3a9b6f !important;
}

/* Error states */
html[data-bs-theme="dark"] .gfield_error {
    background-color: #2a1616;
    border-color: #ff6b6b;
}

html[data-bs-theme="dark"] .gfield_error input,
html[data-bs-theme="dark"] .gfield_error select {
    border-color: #ff6b6b;
}

html[data-bs-theme="dark"] .validation_message {
    color: #ff8787;
}

/* Grid layout */
html[data-bs-theme="dark"] .gform-grid-row {
    color: #e0e6ed;
}