/* =========================================================================
   ZXVERA — shared inquiry-form system (Partnerships and Contact pages)
   Field, select, checkbox, chip, validation, status, loading and success states.
   ========================================================================= */

/* ---------- Form system (.pform) ---------- */
.pform { --field-h: 52px; color: var(--ink); }
.pform__required-note { margin-bottom: 20px; font-size: 0.84rem; color: var(--ink-2); }
.pform__required-note span[aria-hidden] { color: var(--blue); font-weight: 800; }

.pform__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.pform__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.pform__group + .pform__group { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line-light); }
.pform__group legend { display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 18px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); }
.pform__step {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  font-size: 0.78rem;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(23, 107, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 255, 0.25);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.pform__group.is-complete .pform__step { color: var(--white); background: var(--blue); box-shadow: none; }

.pform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pform__preselect[hidden] { display: none; }
.pform__preselect { display: flex; align-items: center; gap: 8px; margin: -6px 0 16px; padding: 10px 14px; font-size: 0.88rem; font-weight: 600; color: var(--ink); border-radius: var(--radius-sm); background: rgba(40, 216, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(40, 216, 255, 0.35); }

.field { position: relative; display: flex; flex-direction: column; margin-bottom: 18px; min-width: 0; }
.field > label { margin-bottom: 7px; font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.field__req { color: var(--blue); font-weight: 800; }
.field__opt { font-weight: 500; color: var(--ink-2); }

.field input:not([type="checkbox"]),
.field select,
.field textarea,
.chips {
  width: 100%;
  min-height: var(--field-h);
  padding: 13px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  border: 1.5px solid rgba(10, 22, 40, 0.16);
  border-radius: 12px;
  background: var(--off);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field input:not([type="checkbox"]):hover, .field select:hover, .field textarea:hover, .chips:hover { border-color: rgba(10, 22, 40, 0.3); }
.field input:not([type="checkbox"]):focus, .field select:focus, .field textarea:focus, .chips:focus-within {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(23, 107, 255, 0.15);
}
.field.is-filled input:not([type="checkbox"]), .field.is-filled select, .field.is-filled textarea, .field.is-filled .chips { background: var(--white); }

.field__select { position: relative; }
.field__select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); pointer-events: none; }
.field select { padding-right: 46px; cursor: pointer; }
.field select:invalid, .field select option[value=""] { color: var(--ink-2); }
.field select option { color: var(--ink); }

.field__hint { margin-top: 6px; font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }
.field__hint--split { display: flex; justify-content: space-between; gap: 12px; }
.field__count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.field__count.is-near { color: #B45309; font-weight: 700; }

/* Error state: colour plus icon plus text, never colour alone */
.field__error { display: flex; align-items: flex-start; gap: 8px; margin-top: 7px; font-size: 0.86rem; font-weight: 600; line-height: 1.4; color: #B42318; }
.field__error::before { content: "!"; flex-shrink: 0; display: grid; place-items: center; width: 17px; height: 17px; margin-top: 1px; font-size: 0.7rem; font-weight: 800; color: var(--white); border-radius: 50%; background: #D92D20; }
.field__error[hidden] { display: none; }
.field.is-invalid input:not([type="checkbox"]), .field.is-invalid select, .field.is-invalid textarea, .field.is-invalid .chips { border-color: #D92D20; background: #FFFBFA; }
.field.is-invalid input:not([type="checkbox"]):focus, .field.is-invalid select:focus, .field.is-invalid textarea:focus, .field.is-invalid .chips:focus-within { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.14); }
.field.is-valid:not(.field--check) > label::after { content: ""; display: inline-block; width: 10px; height: 5px; margin-left: 8px; border-left: 2px solid #12805C; border-bottom: 2px solid #12805C; transform: rotate(-45deg) translateY(-3px); }

/* Consent checkbox */
.field--check { display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; align-items: start; margin-top: 4px; }
.field--check input[type="checkbox"] {
  width: 24px; height: 24px; margin: 1px 0 0;
  border: 1.5px solid rgba(10, 22, 40, 0.3);
  border-radius: 7px;
  background: var(--white);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  display: grid; place-items: center;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field--check input[type="checkbox"]::after { content: ""; width: 10px; height: 5px; border-left: 2.5px solid var(--white); border-bottom: 2.5px solid var(--white); transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.2s var(--ease-out); }
.field--check input[type="checkbox"]:checked { background: var(--blue); border-color: var(--blue); }
.field--check input[type="checkbox"]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.field--check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(23, 107, 255, 0.25); }
.field--check.is-invalid input[type="checkbox"] { border-color: #D92D20; }
.field--check label { margin: 0; font-size: 0.92rem; font-weight: 500; line-height: 1.55; color: var(--ink-2); cursor: pointer; }
.field--check label a { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.field--check .field__error { grid-column: 2; }

/* Country chips (JS enhancement of the plain text input) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; cursor: text; }
.chips__list { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; font-size: 0.9rem; font-weight: 700; color: var(--ink); border-radius: 999px; background: rgba(23, 107, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(23, 107, 255, 0.25); }
.chip button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: var(--ink-2); background: transparent; cursor: pointer; }
.chip button:hover, .chip button:focus-visible { color: var(--white); background: var(--blue); outline: none; }
.chip button .icon { width: 14px; height: 14px; }
.field .chips input.chips__input,
.field .chips input.chips__input:hover,
.field .chips input.chips__input:focus { flex: 1 1 140px; width: auto; min-width: 120px; min-height: 34px; padding: 4px 6px; border: 0; background: transparent; box-shadow: none; outline: none; }

/* Status + submit */
.pform__status { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; padding: 16px 18px; border-radius: var(--radius-sm); font-size: 0.94rem; line-height: 1.5; color: #7A271A; background: #FEF3F2; box-shadow: inset 4px 0 0 #D92D20, inset 0 0 0 1px rgba(217, 45, 32, 0.25); }
.pform__status[hidden] { display: none; }
.pform__status:focus { outline: none; box-shadow: inset 4px 0 0 #D92D20, inset 0 0 0 1px rgba(217, 45, 32, 0.25), 0 0 0 4px rgba(217, 45, 32, 0.15); }
.pform__status .icon { flex-shrink: 0; margin-top: 2px; color: #D92D20; }
.pform__status strong { display: block; margin-bottom: 4px; }
.pform__status ul { margin-top: 6px; padding-left: 18px; list-style: disc; }
.pform__status a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.pform__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line-light); }
.pform__button { position: relative; min-width: 260px; }
.pform__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: var(--white); animation: spin 0.8s linear infinite; }
.pform__button[aria-disabled="true"] { cursor: progress; opacity: 0.9; }
.pform.is-submitting .pform__spinner { display: inline-block; }
.pform.is-submitting .pform__button .icon { display: none; }
.pform__fineprint { flex: 1 1 240px; font-size: 0.84rem; color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.pform-success { padding: clamp(12px, 3vw, 32px) 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pform-success[hidden] { display: none; }
.pform-success:focus { outline: none; }
.pform-success__icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 22px; border-radius: 50%; color: var(--white); background: var(--grad-brand); box-shadow: 0 0 0 10px rgba(23, 107, 255, 0.1), 0 20px 40px -16px rgba(23, 107, 255, 0.8); }
.pform-success__icon .icon { width: 34px; height: 34px; stroke-width: 2.4; }
.pform-success h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; margin-bottom: 12px; color: var(--ink); }
.pform-success__message { max-width: 52ch; color: var(--ink-2); font-size: 1.04rem; }
.pform-success__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn--ghost-dark { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px rgba(10, 22, 40, 0.2); }
.btn--ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--blue); color: var(--blue-deep); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pform-success:not([hidden]) .pform-success__icon { animation: pop 0.6s var(--ease-out) both; }
  .pform-success:not([hidden]) h3, .pform-success:not([hidden]) p, .pform-success:not([hidden]) .pform-success__actions { animation: fade-up 0.7s var(--ease-out) 0.15s both; }
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .pform__row { grid-template-columns: minmax(0, 1fr); }
  .pform__button { width: 100%; min-width: 0; }
  .field input:not([type="checkbox"]), .field select, .field textarea { font-size: 16px; } /* prevents iOS zoom on focus */
}
