/* Form block
 *
 * Fluent Forms' own stylesheet is written for themes and is not loaded in the
 * portal. These rules dress its markup (.ff-el-*) in Fluent Community's variables
 * instead, so an embedded form reads as part of the portal rather than as a
 * transplant from the site's theme.
 */
.wp-block-fca-blocks-form {
    margin-bottom: var(--fcom-block-spacing, 20px);
}

.wp-block-fca-blocks-form .fca-form-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
}

/* Layout ------------------------------------------------------------------ */
.wp-block-fca-blocks-form .frm-fluent-form fieldset {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wp-block-fca-blocks-form .ff-el-group {
    margin-bottom: 18px;
}

.wp-block-fca-blocks-form .ff-t-cell {
    padding-right: 12px;
}

.wp-block-fca-blocks-form .ff-el-input--label label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
}

.wp-block-fca-blocks-form .ff-el-input--label.ff-el-is-required.asterisk-right label::after {
    content: ' *';
    color: #ef4444;
}

.wp-block-fca-blocks-form .ff-el-help-message {
    margin-top: 6px;
    font-size: 12px;
    color: var(--fcom-secondary-text, #6b7280);
}

/* Controls ---------------------------------------------------------------- */
.wp-block-fca-blocks-form .ff-el-form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fcom-primary-text, #19283a);
    background: var(--fcom-primary-bg, #fff);
    border: 1px solid var(--fcom-primary-border, #e4e6eb);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-fca-blocks-form .ff-el-form-control::placeholder {
    color: var(--fcom-text-off, #9ca3af);
}

.wp-block-fca-blocks-form .ff-el-form-control:focus {
    outline: none;
    border-color: var(--fcom-primary-button, #1877F2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fcom-primary-button, #1877F2) 18%, transparent);
}

.wp-block-fca-blocks-form textarea.ff-el-form-control {
    min-height: 120px;
    resize: vertical;
}

.wp-block-fca-blocks-form select.ff-el-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

/* Checkboxes and radios --------------------------------------------------- */
.wp-block-fca-blocks-form .ff-el-form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.wp-block-fca-blocks-form .ff-el-form-check-label {
    font-size: 14px;
    color: var(--fcom-primary-text, #19283a);
    cursor: pointer;
}

.wp-block-fca-blocks-form input[type="checkbox"],
.wp-block-fca-blocks-form input[type="radio"] {
    accent-color: var(--fcom-primary-button, #1877F2);
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Submit ------------------------------------------------------------------ */
.wp-block-fca-blocks-form .ff-btn-submit,
.wp-block-fca-blocks-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fcom-primary-button-text, #fff);
    background: var(--fcom-primary-button, #1877F2);
    border: 1px solid var(--fcom-primary-button, #1877F2);
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.wp-block-fca-blocks-form .ff-btn-submit:hover,
.wp-block-fca-blocks-form button[type="submit"]:hover {
    filter: brightness(0.94);
}

.wp-block-fca-blocks-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wp-block-fca-blocks-form.fca-form .fca-form-submitting {
    opacity: 0.75;
}

/* Validation + response --------------------------------------------------- */
.wp-block-fca-blocks-form .fca-form-field-invalid .ff-el-form-control {
    border-color: #ef4444;
}

.wp-block-fca-blocks-form .fca-form-error {
    margin-top: 6px;
    font-size: 13px;
    color: #ef4444;
}

.wp-block-fca-blocks-form .fca-form-response {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fcom-primary-text, #19283a);
}

.wp-block-fca-blocks-form .fca-form-response.is-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.wp-block-fca-blocks-form .fca-form-response.is-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Editor / fallback notice ------------------------------------------------ */
.wp-block-fca-blocks-form .fca-form-notice,
.fca-form-notice {
    padding: 14px 16px;
    border: 1px dashed var(--fcom-primary-border, #e4e6eb);
    border-radius: 8px;
    font-size: 14px;
    color: var(--fcom-secondary-text, #6b7280);
    background: var(--fcom-secondary-bg, #f7f8fa);
}

/* Fluent Forms marks forms as loading until its own script boots; this plugin
   removes that class on init, but hide the flicker if CSS lands first. */
.wp-block-fca-blocks-form .ff-form-loading {
    opacity: 1;
}

@media (max-width: 768px) {
    .wp-block-fca-blocks-form .ff-t-cell {
        padding-right: 0;
    }
}
