/* =============================================================================
 * FORMS CREATOR — AI ASSIST (includes/forms-ai.php, assets/forms-ai/)
 * The builder's AI Assist panel and Field Settings › Help & Rules, and on the
 * form itself: help text, why it's required, the description, Voice entry.
 * ========================================================================== */

/* ---------- the panel (inside the Forms Creator's left panel) ---------- */
.wh-fv-fai { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.wh-fv-fai textarea, .wh-fv-fai input[type="text"], .wh-fv-fai select { width: 100%; box-sizing: border-box; font: inherit; }
.wh-fv-fai textarea { resize: vertical; min-height: 54px; }
.wh-fv-fai-sec { border: 1px solid rgba(127, 127, 127, .25); border-radius: 8px; padding: 0 10px; }
.wh-fv-fai-sec[open] { padding-bottom: 10px; }
.wh-fv-fai-sec > summary { cursor: pointer; font-weight: 600; padding: 9px 0; list-style: none; }
.wh-fv-fai-sec > summary::-webkit-details-marker { display: none; }
.wh-fv-fai-sec > summary::after { content: "\203A"; float: right; transition: transform .15s; opacity: .6; }
.wh-fv-fai-sec[open] > summary::after { transform: rotate(90deg); }
.wh-fv-fai-with { display: flex; gap: 6px; align-items: flex-start; }
.wh-fv-fai-with > textarea, .wh-fv-fai-with > input, .wh-fv-fai-with > select { flex: 1; min-width: 0; }
.wh-fv-fai-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.wh-fv-fai .fcs-btn-main, .wh-fv-fai-float .fcs-btn-main { background: var(--a1, #2271b1); color: #fff; border-color: var(--a1, #2271b1); }
.wh-fv-fai .fcs-btn[disabled] { opacity: .5; cursor: default; }
.wh-fv-fai-check { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.wh-fv-fai-lab { display: block; margin: 6px 0 2px; font-weight: 600; }
.wh-fv-fai-lab > input, .wh-fv-fai-lab > textarea { margin-top: 3px; font-weight: 400; }
.wh-fv-fai-foot { opacity: .65; font-size: 11px; margin: 4px 0 0; }

.wh-fv-fai-mic { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .4); background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.wh-fv-fai-mic:hover { border-color: var(--a1, #2271b1); color: var(--a1, #2271b1); }
.wh-fv-fai-mic.is-rec { background: #d63638; border-color: #d63638; color: #fff; animation: whFvFaiPulse 1.2s infinite; }
@keyframes whFvFaiPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 54, 56, .45); } 50% { box-shadow: 0 0 0 7px rgba(214, 54, 56, 0); } }

.wh-fv-fai-drop { display: block; border: 2px dashed rgba(127, 127, 127, .45); border-radius: 8px; padding: 16px 10px; text-align: center; cursor: pointer; }
.wh-fv-fai-drop.is-over, .wh-fv-fai-drop:hover { border-color: var(--a1, #2271b1); }

.wh-fv-fai-status { border-radius: 6px; padding: 8px 10px; background: rgba(34, 113, 177, .1); border-left: 3px solid var(--a1, #2271b1); }
.wh-fv-fai-status.is-done { background: rgba(0, 163, 42, .1); border-color: #00a32a; }
.wh-fv-fai-status.is-error { background: rgba(214, 54, 56, .1); border-color: #d63638; }
.wh-fv-fai-status.is-note { background: rgba(219, 166, 23, .12); border-color: #dba617; }
.wh-fv-fai-bar { height: 4px; border-radius: 2px; background: rgba(127, 127, 127, .25); margin-top: 6px; overflow: hidden; }
.wh-fv-fai-bar > i { display: block; height: 100%; width: 0; background: var(--a1, #2271b1); transition: width .2s; }

.wh-fv-fai-draft { border: 1px solid var(--a1, #2271b1); border-radius: 8px; padding: 10px; }
.wh-fv-fai-draft-head { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.wh-fv-fai-draft-head small { opacity: .65; }
.wh-fv-fai-d-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.wh-fv-fai-d { display: flex; gap: 6px; align-items: flex-start; padding: 6px; border-radius: 6px; background: rgba(127, 127, 127, .08); }
.wh-fv-fai-d.is-off { opacity: .45; }
.wh-fv-fai-d-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wh-fv-fai-d-sub { display: flex; gap: 6px; align-items: center; }
.wh-fv-fai-d-sub select { flex: 1; }
.wh-fv-fai-d-sub label { white-space: nowrap; display: flex; gap: 3px; align-items: center; }
.wh-fv-fai-d-on { padding-top: 6px; }
.wh-fv-fai-d-move { display: flex; flex-direction: column; gap: 2px; }
.wh-fv-fai-d-move button { border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6; padding: 2px 4px; }
.wh-fv-fai-d-move button:hover { opacity: 1; }

/* ---------- Field Settings › Help & Rules ---------- */
.wh-fv-fai-box { background: rgba(34, 113, 177, .06); border: 1px solid rgba(34, 113, 177, .25); border-radius: 6px; padding: 10px 12px; margin-top: 8px; }
.wh-fv-fai-box-title { font-weight: 600; margin: 0 0 8px; }
.wh-fv-fai-box-title span { font-weight: 400; font-size: 11px; opacity: .7; margin-left: 4px; }
.wh-fv-fai-row { margin: 0 0 8px; }
.wh-fv-fai-row > label { font-weight: 600; display: block; }
.wh-fv-fai-row > label > input, .wh-fv-fai-row > label > .wh-fv-fai-with { margin-top: 4px; width: 100%; }
.wh-fv-fai-pair { display: flex; gap: 8px; margin: 0 0 8px; }
.wh-fv-fai-pair label { flex: 1; font-weight: 600; }
.wh-fv-fai-pair input { width: 100%; margin-top: 4px; }
.wh-fv-fai-gen { flex: none; width: 30px; height: 30px; border-radius: 4px; border: 1px solid rgba(127, 127, 127, .4); background: transparent; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.wh-fv-fai-gen:hover { border-color: var(--a1, #2271b1); }
.wh-fv-fai-gen.is-busy, .wh-fv-fai-box .button.is-busy { opacity: .5; cursor: progress; }
.wh-fv-fai-note { margin: 4px 0 0; font-size: 12px; }
.wh-fv-fai-note.is-error { color: #d63638; }
.wh-fv-fai-note.is-done { color: #00a32a; }

/* Outside the studio layout (the Glisting Portal's editor): a drawer */
.wh-fv-fai-float-btn { position: fixed; right: 18px; bottom: 18px; z-index: 100020; border: 0; border-radius: 22px; padding: 10px 16px; background: #2271b1; color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.wh-fv-fai-float { position: fixed; right: 18px; bottom: 66px; width: 380px; max-width: calc(100vw - 36px); max-height: calc(100vh - 100px); overflow: auto; z-index: 100020; background: #fff; color: #1d2327; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); padding: 12px; }

/* ---------- on the form ---------- */
.wh-fv-fai-help { font-size: 12.5px; opacity: .75; margin-top: 3px; line-height: 1.4; }
.wh-fv-fai-why { font-size: 12px; margin-top: 2px; opacity: .8; }
.wh-fv-fai-why span { color: #b32d2e; }
.wh-fv-fai-desc { margin: 0 0 14px; }
.wh-fv-fai-desc p { margin: 0 0 8px; }
.wh-fv-fai-voicebar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 14px; }
.wh-fv-fai-voice-go { border: 1px solid #2271b1; background: #2271b1; color: #fff; border-radius: 20px; padding: 7px 14px; font-weight: 600; cursor: pointer; }
.wh-fv-fai-voice-note { font-size: 12px; opacity: .7; }
.wh-fv-fai-has-mic { position: relative; }
.wh-fv-custom-field-wrap .wh-fv-fai-mic { width: 28px; height: 28px; margin: 4px 0 0 4px; vertical-align: top; }
.wh-fv-fai-asking { outline: 2px solid #2271b1; outline-offset: 4px; border-radius: 4px; transition: outline-color .2s; }
.wh-fv-fai-vbar { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%); z-index: 100050; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 30px); padding: 10px 14px; border-radius: 24px; background: #1d2327; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); font-size: 14px; transition: transform .2s; }
.wh-fv-fai-vbar.is-on { transform: translate(-50%, 0); }
.wh-fv-fai-vbar-dot { width: 10px; height: 10px; border-radius: 50%; background: #8c8f94; flex: none; }
.wh-fv-fai-vbar.is-listen .wh-fv-fai-vbar-dot { background: #d63638; animation: whFvFaiPulse 1.2s infinite; }
.wh-fv-fai-vbar.is-busy .wh-fv-fai-vbar-dot { background: #72aee6; }
.wh-fv-fai-vbar.is-done .wh-fv-fai-vbar-dot { background: #00a32a; }
.wh-fv-fai-vbar.is-error .wh-fv-fai-vbar-dot { background: #d63638; }
.wh-fv-fai-vbar-btns { display: flex; gap: 6px; }
.wh-fv-fai-vbar-btns button { border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: #fff; border-radius: 14px; padding: 3px 10px; cursor: pointer; }

/* Dark mode (the Forms Creator's switch) */
html.wh-fv-img-dark .wh-fv-fai-float { background: #1e1e1e; color: #e6e6e6; }
