.dcbdo_client_form_wrapper {
    max-width: 860px;
    margin: 0 auto;
}

.dcbdo_client_form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #d7dde8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(26, 38, 64, 0.08);
}

.dcbdo_form_legend {
    margin: 0;
    font-size: 0.85rem;
    color: #687386;
}

.dcbdo_form_section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #edf1f7;
}

.dcbdo_form_section:first-of-type {
    padding-top: 0;
    border-top: none;
}

.dcbdo_section_title {
    margin: 0;
    font-size: 1.1rem;
    color: #253450;
}

.dcbdo_form_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dcbdo_form_field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dcbdo_form_field_full {
    width: 100%;
}

.dcbdo_form_label {
    font-weight: 700;
    color: #1d2b44;
}

.dcbdo_form_hint {
    margin: 0;
    font-size: 0.8rem;
    font-style: italic;
    color: #8993a4;
}

.dcbdo_form_input,
.dcbdo_form_textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bec8d8;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    font: inherit;
    color: #152033;
    background: #fbfcff;
}

.dcbdo_form_input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dcbdo_form_textarea {
    resize: vertical;
}

.dcbdo_form_input:focus,
.dcbdo_form_textarea:focus {
    outline: 2px solid #2454d6;
    outline-offset: 2px;
    border-color: #2454d6;
}

/* CAE tag editor */

.dcbdo_tag_editor {
    position: relative;
}

.dcbdo_tag_chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dcbdo_tag_chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #e8f0ff;
    border: 1px solid #b7ccff;
    color: #253450;
    font-size: 0.85rem;
}

.dcbdo_tag_chip_note {
    flex-basis: 100%;
    font-size: 0.75rem;
    font-style: italic;
    color: #8993a4;
}

.dcbdo_tag_chip_remove {
    border: 0;
    background: none;
    color: #253450;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
}

.dcbdo_tag_input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bec8d8;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    font: inherit;
    color: #152033;
    background: #fbfcff;
}

.dcbdo_tag_input:focus {
    outline: 2px solid #2454d6;
    outline-offset: 2px;
    border-color: #2454d6;
}

.dcbdo_tag_suggestions {
    position: absolute;
    z-index: 10;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.35rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #d7dde8;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(26, 38, 64, 0.12);
}

.dcbdo_tag_suggestion {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: none;
    padding: 0.6rem 0.85rem;
    font: inherit;
    color: #152033;
    cursor: pointer;
}

.dcbdo_tag_suggestion:hover,
.dcbdo_tag_suggestion:focus {
    background: #f2f6ff;
}

/* Dimensão dropdown */

.dcbdo_dimensao_select {
    position: relative;
}

.dcbdo_dimensao_trigger {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid #bec8d8;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    font: inherit;
    text-align: left;
    color: #152033;
    background: #fbfcff;
    cursor: pointer;
}

.dcbdo_dimensao_trigger:focus {
    outline: 2px solid #2454d6;
    outline-offset: 2px;
    border-color: #2454d6;
}

.dcbdo_dimensao_trigger_caret {
    color: #687386;
}

.dcbdo_dimensao_definitions {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    border: 1px dashed #aeb8c8;
    border-radius: 10px;
    background: #fbfcfe;
    overflow: hidden;
}

.dcbdo_dimensao_option {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #edf1f7;
    background: none;
    text-align: left;
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 0.85rem;
    color: #1d2433;
    cursor: pointer;
}

.dcbdo_dimensao_option:last-child {
    border-bottom: none;
}

.dcbdo_dimensao_option:hover,
.dcbdo_dimensao_option:focus {
    background: #f2f6ff;
}

.dcbdo_dimensao_option_active {
    background: #e8f0ff;
    color: #253450;
}

/* Código postal */

.dcbdo_codigo_postal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Keep theme input[type="text"] rules from stretching the postal fields. */
.dcbdo_codigo_postal > input.dcbdo_codigo_postal_cp4,
.dcbdo_codigo_postal > input.dcbdo_codigo_postal_cp3 {
    width: 5rem;
    flex: 0 0 5rem;
    text-align: center;
}

.dcbdo_codigo_postal_sep {
    color: #687386;
}

/* Checkbox lists (tipo de projeto / investimentos) */

.dcbdo_checkbox_list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dcbdo_checkbox_item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: #1d2433;
}

.dcbdo_conditional_field {
    padding: 0.75rem;
    border-left: 3px solid #d7dde8;
    background: #fbfcff;
    border-radius: 0 10px 10px 0;
}

.dcbdo_form_actions {
    display: flex;
    justify-content: flex-end;
}

.dcbdo_form_submit {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    color: #ffffff;
    background: #2454d6;
    cursor: pointer;
}

.dcbdo_form_submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.dcbdo_form_message {
    min-height: 1.4em;
    font-weight: 600;
    white-space: pre-line;
}

.dcbdo_form_message_error {
    color: #b42318;
}

.dcbdo_form_message_success {
    color: #027a48;
}

.dcbdo_client_form_success {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #a6e9c9;
    border-radius: 14px;
    background: #ecfdf3;
    box-shadow: 0 14px 34px rgba(26, 38, 64, 0.08);
}

.dcbdo_client_form_success[hidden] {
    display: none;
}

.dcbdo_success_title {
    margin: 0;
    font-size: 1.1rem;
    color: #027a48;
}

.dcbdo_success_text {
    margin: 0;
    color: #1d2b44;
}

/* Invalid (missing required) fields, marked on failed submit */

.dcbdo_field_invalid {
    border-color: #b42318;
}

input[type=checkbox].dcbdo_field_invalid {
    outline: 2px solid #b42318;
    outline-offset: 2px;
}

.dcbdo_checkbox_list.dcbdo_field_invalid {
    border: 1px solid #b42318;
    border-radius: 10px;
    padding: 0.5rem;
}

.dcbdo_field_error {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b42318;
}

/* `.dcbdo_form_field`/`.dcbdo_dimensao_definitions`/`.dcbdo_client_form` set `display`
   unconditionally, which otherwise beats the browser's default `[hidden] { display: none }` rule. */
.dcbdo_dimensao_definitions[hidden],
.dcbdo_conditional_field[hidden],
.dcbdo_client_form[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .dcbdo_form_grid {
        grid-template-columns: 1fr;
    }

    .dcbdo_form_actions {
        justify-content: stretch;
    }

    .dcbdo_form_submit {
        width: 100%;
    }
}
