/* Veva Support theme: form fields, choices and forms. Ported from the design system's class contract
   (components/bundle.css: TextField, Choice, Form), followed by the built-in markup of Veva's Form components
   mapped onto the same design, so editors pick no classes for a Generic Form, a Login form or their fields. */

/* ---------- Form fields (vs-field) ---------- */
.vs-field { display: grid; gap: var(--space-2); }
.vs-label { font-size: 14px; line-height: 20px; font-weight: 600; }
.vs-label .vs-opt { font-weight: 400; color: var(--grey-600); }
.vs-hint { font-size: 14px; line-height: 22px; color: var(--grey-600); margin: 0; }
.vs-error { display: flex; gap: var(--space-2); align-items: baseline; font-size: 14px; line-height: 22px; margin: 0; color: var(--grey-black); }
.vs-error svg, .vs-error i { color: var(--alert-error); flex: none; }
.vs-input { width: 100%; height: 48px; padding: 0 var(--space-4); border: 1px solid var(--grey-400); border-radius: var(--radius-sm); background: var(--white); color: var(--grey-black); font: 400 16px/24px var(--font-grotesk); transition: border-color .15s ease-out; }
.vs-input::placeholder { color: var(--grey-600); opacity: 1; }
.vs-input:hover { border-color: var(--grey-600); }
.vs-input:focus { outline: 2px solid var(--indigo-base); outline-offset: 2px; border-color: var(--indigo-base); }
.vs-input[aria-invalid="true"], .vs-input.is-invalid { border-color: var(--alert-error); box-shadow: inset 0 0 0 1px var(--alert-error); }
.vs-input:disabled { background: var(--grey-50); border-color: var(--grey-200); color: var(--grey-600); cursor: not-allowed; }
.vs-input[readonly] { background: var(--grey-50); border-style: dashed; }
textarea.vs-input { height: auto; min-height: 128px; padding: var(--space-3) var(--space-4); resize: vertical; }
.vs-input--sm { height: 40px; font-size: 15px; }
.vs-control { position: relative; display: flex; align-items: center; }
.vs-control > .vs-input { flex: 1; }
.vs-control__lead { position: absolute; left: var(--space-4); color: var(--grey-600); pointer-events: none; font-size: 15px; }
.vs-control__lead ~ .vs-input { padding-left: 44px; }
.vs-control__end { position: absolute; right: 6px; }
.vs-control__end ~ .vs-input, .vs-control:has(.vs-control__end) .vs-input { padding-right: 52px; }
.vs-select { position: relative; }
.vs-select select { appearance: none; padding-right: 44px; cursor: pointer; }
.vs-select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--grey-black); border-bottom: 2px solid var(--grey-black); transform: rotate(45deg); pointer-events: none; }
.vs-count { justify-self: end; font: 500 12px/16px var(--font-mono); color: var(--grey-600); }

/* ---------- Checkbox, radio, switch ---------- */
.vs-check { display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; font-size: 16px; line-height: 24px; }
.vs-check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; border: 1px solid var(--grey-400); border-radius: var(--radius-sm); background: var(--white); display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out; }
.vs-check input:hover { border-color: var(--grey-600); }
.vs-check input[type="radio"] { border-radius: 50%; }
.vs-check input:checked { background: var(--purple-base); border-color: var(--purple-base); }
.vs-check input[type="checkbox"]:checked::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg); }
.vs-check input[type="checkbox"]:indeterminate { background: var(--purple-base); border-color: var(--purple-base); }
.vs-check input[type="checkbox"]:indeterminate::after { content: ""; width: 10px; height: 2px; background: var(--white); }
.vs-check input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--white); }
.vs-check input:disabled { background: var(--grey-100); border-color: var(--grey-200); cursor: not-allowed; }
.vs-check:has(input:disabled) { color: var(--grey-600); cursor: not-allowed; }
.vs-check small { display: block; font-size: 14px; line-height: 22px; color: var(--grey-600); }
.vs-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: 16px; line-height: 24px; }
.vs-switch input { appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: var(--radius-pill); background: var(--grey-400); cursor: pointer; transition: background-color .2s ease-out; }
.vs-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); transition: transform .2s ease-out; }
.vs-switch input:checked { background: var(--purple-base); }
.vs-switch input:checked::after { transform: translateX(16px); }
.vs-switch input:disabled { background: var(--grey-200); cursor: not-allowed; }
:is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-switch input { background: var(--grey-600); }
:is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-switch input:checked { background: var(--pink-base); }
.vs-choices { display: grid; gap: var(--space-3); border: 0; margin: 0; padding: 0; }
.vs-choices legend { padding: 0; margin-bottom: var(--space-2); }

/* ---------- Segmented control ---------- */
.vs-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--radius-pill); background: var(--grey-100); }
.vs-seg button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--grey-600); font: 600 14px/1 var(--font-grotesk); cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
.vs-seg button:hover { color: var(--grey-black); }
.vs-seg button[aria-pressed="true"], .vs-seg button[aria-selected="true"] { background: var(--white); color: var(--grey-black); box-shadow: 0 1px 2px rgba(29, 28, 27, .12); }
:is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-seg { background: var(--grey-900); }
:is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-seg button { color: var(--grey-200); }
:is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-seg button[aria-pressed="true"], :is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .vs-seg button[aria-selected="true"] { background: var(--grey-black); color: var(--white); box-shadow: none; }

/* ---------- Forms (vs-form, field sets, steps, validation summary) ---------- */
.vs-form { display: grid; gap: var(--space-5); }
.vs-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.vs-form__actions { display: flex; align-items: center; gap: var(--space-4); padding-top: var(--space-2); }
.vs-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.vs-fieldset > legend { padding: 0; margin-bottom: var(--space-2); font-weight: 700; font-size: 21px; line-height: 26px; letter-spacing: -0.4px; }
.vs-steps { display: flex; gap: var(--space-2); list-style: none; margin: 0; padding: 0; counter-reset: vs-step; }
.vs-steps li { flex: 1; display: grid; gap: var(--space-2); counter-increment: vs-step; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--grey-600); }
.vs-steps li::before { content: ""; height: 4px; border-radius: var(--radius-pill); background: var(--grey-200); }
.vs-steps li span::before { content: counter(vs-step, decimal-leading-zero) "  "; font: 500 12px/1 var(--font-mono); white-space: pre; }
.vs-steps li[aria-current], .vs-steps li.is-done { color: var(--grey-black); }
.vs-steps li[aria-current]::before { background: var(--pink-base); }
.vs-steps li.is-done::before { background: var(--grey-black); }
.vs-summary { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); background: var(--secondary-orange-light); }
.vs-summary > svg, .vs-summary > i { color: var(--alert-error); margin-top: 4px; }
.vs-summary ul { margin: var(--space-1) 0 0; padding-left: 18px; }
.vs-summary a { color: var(--grey-black); font-weight: 600; }
@media (max-width: 568px) { .vs-form__row { grid-template-columns: 1fr; } }


/* ==========================================================================
   Built-in markup of the Form components
   ========================================================================== */

/* ---------- Generic Form and Field set: one column, space-5 apart; buttons next to each other ----------
   Zero-specificity layout, so a form or field set the editor gave a class of their own keeps its own. */
:where(.vs) :where(form:not([class*="vs-"]), fieldset:not([class*="vs-"])) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5) var(--space-4); min-width: 0; margin: 0; padding: 0; border: 0; }
:where(.vs) :where(form:not([class*="vs-"]), fieldset:not([class*="vs-"])) > * { flex: 1 0 100%; min-width: 0; }
:where(.vs) :where(form:not([class*="vs-"]), fieldset:not([class*="vs-"])) > :is(button, input[type="submit"], input[type="reset"], input[type="button"], a.text-link) { flex: 0 0 auto; }
.vs fieldset:not([class*="vs-"]) > legend { float: none; width: auto; margin: 0 0 var(--space-2); padding: 0; font-weight: 700; font-size: 21px; line-height: 26px; letter-spacing: -0.4px; }
:where(.vs) :where(.form-steps, .form-steps-header, .form-steps-footer) { display: grid; gap: var(--space-5); }
:where(.vs) :where(.form-steps-body > div) > * + * { margin-top: var(--space-5); }

/* ---------- A field: div.form-group > label, div.input-container, div.form-group-actions, messages, hint ---------- */
.vs .form-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) 0; margin: 0; }
.vs .form-group > * { grid-column: 1 / -1; min-width: 0; }
.vs .form-group > label { grid-row: 1; margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--grey-black); }
.vs .form-group > .input-container { grid-row: 2; }
.vs .form-group > .form-group-actions { grid-row: 2; grid-column: 2; align-self: center; display: flex; align-items: center; gap: var(--space-1); padding-right: 6px; }
.vs .form-group:not(:has(> label)) > :is(.input-container, .form-group-actions) { grid-row: 1; }
.vs .form-group > .form-group-actions:empty { display: none; }
.vs .form-group:has(> .form-group-actions:not(:empty)) .form-control { padding-right: 52px; }
.vs .form-group-clear-button { width: 32px; height: 32px; display: inline-grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--grey-600); font-size: 13px; cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
.vs .form-group-clear-button:hover { background: var(--grey-100); color: var(--grey-black); }

/* The control: input.form-control, select.form-control, textarea.form-control (vs-input) */
.vs .form-control { display: block; width: 100%; height: 48px; margin: 0; padding: 0 var(--space-4); border: 1px solid var(--grey-400); border-radius: var(--radius-sm); background-color: var(--white); background-clip: padding-box; box-shadow: none; color: var(--grey-black); font: 400 16px/24px var(--font-grotesk); transition: border-color .15s ease-out; }
.vs .form-control::placeholder { color: var(--grey-600); opacity: 1; }
.vs .form-control:hover { border-color: var(--grey-600); }
.vs .form-control:focus { outline: 2px solid var(--indigo-base); outline-offset: 2px; border-color: var(--indigo-base); box-shadow: none; }
.vs .form-control:is([aria-invalid="true"], .is-invalid), .vs .form-group--invalid .form-control { border-color: var(--alert-error); box-shadow: inset 0 0 0 1px var(--alert-error); }
.vs .form-control:disabled { background-color: var(--grey-50); border-color: var(--grey-200); color: var(--grey-600); cursor: not-allowed; }
.vs .form-control[readonly] { background-color: var(--grey-50); border-style: dashed; }
.vs textarea.form-control { height: auto; min-height: 128px; padding: var(--space-3) var(--space-4); resize: vertical; }
.vs select.form-control { -webkit-appearance: none; appearance: none; padding-right: 44px; cursor: pointer; }
.vs select.form-control:is([multiple], [size]:not([size="1"])) { height: auto; padding: var(--space-2); }
.vs .select-container:has(> select.form-control:not([multiple])) { position: relative; }
.vs .select-container:has(> select.form-control:not([multiple]))::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--grey-black); border-bottom: 2px solid var(--grey-black); transform: rotate(45deg); pointer-events: none; }
.vs input.form-control[type="range"] { height: 24px; padding: 0; border: 0; background: none; box-shadow: none; outline-offset: 4px; accent-color: var(--purple-base); cursor: pointer; }

/* Hint and inline validation message (vs-hint, vs-error) */
.vs .form-text { display: block; margin: 0; font-size: 14px; line-height: 22px; color: var(--grey-600); }
.vs .form-group-validation-messages { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: 14px; line-height: 22px; color: var(--grey-black); }
.vs .form-group-validation-messages::before, .vs .validation-summary::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 4px; background: var(--alert-error); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-.95 3.75h1.9l-.25 5.5h-1.4l-.25-5.5ZM8 12.5a1.05 1.05 0 1 1 0-2.1 1.05 1.05 0 0 1 0 2.1Z'/%3E%3C/svg%3E") no-repeat 50% 50% / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-.95 3.75h1.9l-.25 5.5h-1.4l-.25-5.5ZM8 12.5a1.05 1.05 0 1 1 0-2.1 1.05 1.05 0 0 1 0 2.1Z'/%3E%3C/svg%3E") no-repeat 50% 50% / contain; }

/* ---------- Checkbox and radio: div.form-check > input.form-check-input + label (vs-check) ---------- */
.vs .form-check { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-1) var(--space-3); min-height: 0; margin: 0; padding: 0; font-size: 16px; line-height: 24px; }
.vs .form-check > :is(.form-group-validation-messages, .form-text) { flex: 1 0 100%; padding-left: 32px; }
.vs .form-check > label, .vs .form-check-label { margin: 0; font-weight: 400; cursor: pointer; }
.vs .form-check:has(> input:disabled) { color: var(--grey-600); cursor: not-allowed; }
.vs .form-check:has(> input:disabled) > label { cursor: not-allowed; }
.vs input.form-check-input { -webkit-appearance: none; appearance: none; flex: none; float: none; display: grid; place-items: center; width: 20px; height: 20px; margin: 2px 0 0; border: 1px solid var(--grey-400); border-radius: var(--radius-sm); background: var(--white); box-shadow: none; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out; }
.vs input.form-check-input:hover { border-color: var(--grey-600); }
.vs input.form-check-input:focus { box-shadow: none; }
.vs input.form-check-input:focus-visible { outline: 2px solid var(--indigo-base); outline-offset: 2px; }
.vs input.form-check-input[type="radio"] { border-radius: 50%; }
.vs .form-check--invalid input.form-check-input, .vs input.form-check-input[aria-invalid="true"] { border-color: var(--alert-error); box-shadow: inset 0 0 0 1px var(--alert-error); }
.vs input.form-check-input:checked { background: var(--purple-base); border-color: var(--purple-base); box-shadow: none; }
.vs input.form-check-input[type="checkbox"]:checked::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg); }
.vs input.form-check-input[type="checkbox"]:indeterminate { background: var(--purple-base); border-color: var(--purple-base); }
.vs input.form-check-input[type="checkbox"]:indeterminate::after { content: ""; width: 10px; height: 2px; background: var(--white); }
.vs input.form-check-input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--white); }
.vs input.form-check-input:disabled { background: var(--grey-100); border-color: var(--grey-200); cursor: not-allowed; }

/* Checkbox list and Radio button list: the options under the field's label, space-3 apart (vs-choices) */
.vs .radio-checkbox-list > .input-container { display: grid; gap: var(--space-3); }

/* A Boolean field as a switch (vs-switch): the editor's class vs-switch, and every one on the sign-in page */
.vs .form-check.vs-switch, .vs .vs-signin .form-check { align-items: center; cursor: pointer; }
.vs .form-check.vs-switch input.form-check-input, .vs .vs-signin .form-check input.form-check-input { position: relative; display: block; width: 40px; height: 24px; margin: 0; border: 0; border-radius: var(--radius-pill); background: var(--grey-400); box-shadow: none; transition: background-color .2s ease-out; }
.vs .form-check.vs-switch input.form-check-input::after, .vs .vs-signin .form-check input.form-check-input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; margin: 0; border: 0; border-radius: 50%; background: var(--white); transform: none; transition: transform .2s ease-out; }
.vs .form-check.vs-switch input.form-check-input:checked, .vs .vs-signin .form-check input.form-check-input:checked { background: var(--purple-base); box-shadow: none; }
.vs .form-check.vs-switch input.form-check-input:checked::after, .vs .vs-signin .form-check input.form-check-input:checked::after { width: 18px; height: 18px; margin: 0; border: 0; transform: translateX(16px); }
.vs .form-check.vs-switch input.form-check-input:disabled, .vs .vs-signin .form-check input.form-check-input:disabled { background: var(--grey-200); }
.vs .form-check.vs-switch > :is(.form-group-validation-messages, .form-text), .vs .vs-signin .form-check > :is(.form-group-validation-messages, .form-text) { padding-left: 52px; }
.vs :is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .form-check.vs-switch input.form-check-input { background: var(--grey-600); }
.vs :is(.vs-dark, .vs-section--stage, .vs-panel--stage, .vs-card--stage, .vs-footer) .form-check.vs-switch input.form-check-input:checked { background: var(--pink-base); }

/* ---------- Validation summary: div.validation-summary.alert.alert-danger[role=alert] > p + ul (vs-summary) ---------- */
.vs .validation-summary { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 0 var(--space-3); margin: 0; padding: var(--space-4) var(--space-5); border: 0; border-radius: var(--radius-md); background: var(--secondary-orange-light); color: var(--grey-black); font-size: 15px; line-height: 24px; }
.vs .validation-summary::before { grid-column: 1; grid-row: 1 / span 2; width: 18px; height: 18px; margin-top: 3px; }
.vs .validation-summary > * { grid-column: 2; }
.vs .validation-summary > p { margin: 0; font-weight: 700; }
.vs .validation-summary > ul { margin: var(--space-1) 0 0; padding-left: 18px; }
.vs .validation-summary a { color: var(--grey-black); font-weight: 600; }

/* The form's own message (p.form-message) */
.vs .form-message { margin: 0; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); background: var(--grey-100); color: var(--grey-black); font-size: 15px; line-height: 24px; }

/* ---------- Form steps navigator: ul.form-steps-list > li > button (+ span.form-step-caption), as numbered bars (vs-steps) ---------- */
.vs .form-steps-navigator .form-steps-list { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.vs .form-steps-list > li { margin: 0; }
.vs .form-steps-list > li:has(> .form-step-caption) { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--space-2) 6px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--grey-600); }
.vs .form-steps-list > li:has(> .form-step-caption)::before { content: ""; grid-column: 1 / -1; height: 4px; border-radius: var(--radius-pill); background: var(--grey-200); }
.vs .form-steps-list > li:has(> .form-step-complete) { color: var(--grey-black); }
.vs .form-steps-list > li:has(> .form-step-complete)::before { background: var(--grey-black); }
.vs .form-steps-list > li:has(> .form-step-active) { color: var(--grey-black); }
.vs .form-steps-list > li:has(> .form-step-active)::before { background: var(--pink-base); }
.vs .form-steps-list > li:has(> .form-step-caption) > button:not([class*="vs-"]) { margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: 500 12px/20px var(--font-mono); text-align: left; cursor: pointer; }
.vs .form-steps-list > li:has(> .form-step-caption) > button:not([class*="vs-"]):hover { text-decoration: underline; text-underline-offset: 3px; }
.vs .form-steps-list--showcaption > li:has(> .form-step-caption) > button:not([class*="vs-"]) { grid-column: 1 / -1; font: 600 14px/20px var(--font-grotesk); }
.vs .form-steps-list--showcaption .form-step-caption { display: none; }
.vs .form-steps-list > li:not(:has(> .form-step-caption)) { flex: none; align-self: center; }
.vs .form-steps-list > li:not(:has(> .form-step-caption)) > button:not([class*="vs-"]) { height: 44px; margin: 0; padding: 0 4px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--purple-base); font: 600 15px/1 var(--font-grotesk); cursor: pointer; }
.vs .form-steps-list > li:not(:has(> .form-step-caption)) > button:not([class*="vs-"]):hover { color: var(--purple-800); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Autocomplete of the String field ---------- */
.vs .input-container .auto-complete { top: calc(100% + 4px); padding: var(--space-2); border: 1px solid var(--grey-200); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-overlay); }
.vs .input-container .auto-complete-group-heading { padding: var(--space-2) var(--space-3) var(--space-1); background: none; font: 500 12px/16px var(--font-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--grey-600); }
.vs .input-container .auto-complete-items-item a { padding: 10px var(--space-3); border-radius: var(--radius-md); color: var(--grey-black); text-decoration: none; }
.vs .input-container .auto-complete-items-item a:hover, .vs .input-container .auto-complete-items-item--selected { background: var(--grey-100); color: var(--grey-black); border-radius: var(--radius-md); }
.vs .input-container .auto-complete-items-item-description { font-size: 14px; line-height: 20px; color: var(--grey-600); }
