/*
 * V9 PROVENANCE (WRITER-V9, merge of version 9; documentation only, no logic changed)
 * Patch: V8C3 P1b. What changed: the field of the styled list is bold while the row is being edited.
 *   Serves: owner decision 2026-12-01 12:30. Used with: css/f2513/selectbox.css and js/f2513/form/selectbox.js.
 */
/*
 * states.css - the four field states of the 2513 form (C20).
 * What it does: colours the field wrapper (div.input-row) by the class that states.js (C10) sets on it:
 *   is-empty, is-editing, is-valid or is-invalid; shows a valid or invalid icon at the end of the text.
 * Input: the class on div.input-row and the class f2513-ltr on Latin fields (set in the cf7/parts templates).
 * Output: background, border, icon and message colour of the field; goes to the user's browser.
 * Business purpose: the four states the owner defined look the same in every field, and the icon
 *   (left in Hebrew fields, right in Latin fields) never covers the text.
 * Loaded after base.css (C19), which defines --f2513-white (one definition; #fff is the fallback here); no switch.
 */

:root {
  /* What: background of the field being edited; type: colour; source: owner instruction; used by: is-editing. */
  --f2513-editing-bg: #fffe7a;
  /* What: background of a valid field; type: colour; source: site css rule form .valid and owner;
     used by: is-valid; purpose: a green confirmation. */
  --f2513-valid-bg: #d3f8d3;
  /* What: border of a valid field; type: colour; source: site css (currengeformsSecond.css); used by: is-valid. */
  --f2513-valid-border: #008a00;
  /* What: border of an invalid field; type: colour; source: site css (currengeformsSecond.css);
     used by: is-invalid. */
  --f2513-invalid-border: #f25165;
  /* What: text colour of the message under an invalid field; type: colour; source: architect proposal;
     used by: is-invalid .f2513-msg; purpose: contrast against white is about 6.5 to 1 (WCAG luminance),
     above 4.5; the border colour #f25165 gives only about 3.4 to 1. */
  --f2513-invalid-text: #b3261e;
  /* What: side padding that keeps room for the icon; type: length; source: the site rule .wpcf7-not-valid
     (style-main.css line 5066, padding-right 28px with the icon at 8px from the right edge; V7 topic 8);
     used by: all controls, on the right side; purpose: the text does not move when the icon appears, and a field
     marked by the server (wpcf7-not-valid) has the same padding as a field marked by the browser. */
  --f2513-icon-pad: 28px;
  /* What: the valid icon, a green circle with a white check mark (16 by 16, the owner file valid_icon.svg, md5
     c96047d182703551c18b116109fa0206, without the editor metadata; V9B_10, owner orders 17:45 and 18:20); type: css url
     (data uri, no file and no relative path; # is written as %23); source: q91/hot/OWNER_SVG/valid_icon.svg; used by:
     is-valid; purpose: the green confirmation icon, the same as in the registration form. */
  --f2513-valid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg transform='scale(1.0810811)'%3E%3Ccircle cx='7.4' cy='7.4' r='7.4' fill='%2360be7b'/%3E%3Cpolyline points='3.7,7.5 6,9.9 11.1,4.8' fill='none' stroke='%23fff' stroke-miterlimit='10'/%3E%3C/g%3E%3C/svg%3E");
  /* What: the invalid icon, a red circle with a white X (16 by 16, the owner file invalid_icon.svg, md5
     add1021c158e07130f26c9caa87718e3, without the editor metadata; V9B_10); type: css url (data uri); source:
     q91/hot/OWNER_SVG/invalid_icon.svg; used by: is-invalid; purpose: the red error icon, the same as in the
     registration form. */
  --f2513-invalid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg transform='matrix(0.99324323,0,0,0.99324323,0.64999956,0.64999956)'%3E%3Ccircle cx='7.4' cy='7.4' r='8.0544214' fill='%23ec2127'/%3E%3Cline x1='4.3523808' y1='4.3523808' x2='10.338776' y2='10.338776' stroke='%23fff' stroke-width='1.08843541'/%3E%3Cline x1='10.338776' y1='4.3523808' x2='4.3523808' y2='10.338776' stroke='%23fff' stroke-width='1.08843541'/%3E%3C/g%3E%3C/svg%3E");
  /* What: side padding of a control on the side without the icon; type: length; source: architect;
     used by: all controls, on the left side; purpose: the text keeps a normal margin where there is no icon. */
  --f2513-text-pad: 0.75em;
  /* What: focus outline of the field being edited; type: colour; source: architect; used by: is-editing. */
  --f2513-focus-outline: #5a5a00;
  /* What: width of the arrow box of the msDropdown country list; type: length; source: measured on shot_07 of V10B
     (48 screen pixels at scale 2); used by: the state icon and the text padding of .dd.ddcommon; purpose: the icon
     sits left of the arrow and the country name starts left of the icon. To be confirmed by measuring on STAGING. */
  --f2513-dd-arrow: 24px;
}

/* Padding for the icon, fixed in every state (V7 topic 8, owner defect V7-8): the icon is on the right side of every
   control, Hebrew or Latin, so every control keeps the room of the icon on the right and a normal margin on the left.
   !important: the site gives padding-right 28px !important to a field that CF7 marks wpcf7-not-valid
   (style-main.css line 5066); the value is the same, and this rule is the one that holds in every state.
   Check boxes, radios and hidden fields are not touched. */
.f2513-form .input-row :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"]) {
  padding-left: var(--f2513-text-pad);
  padding-right: var(--f2513-icon-pad) !important;
}

/* The icon: a pseudo element on the control wrapper, so it works the same for input, select and textarea. */
.f2513-form .input-row .wpcf7-form-control-wrap {
  position: relative;
  display: block;
}

.f2513-form .input-row .wpcf7-form-control-wrap::after {
  content: "";
  display: none;
  position: absolute;
  top: 50%;
  right: 8px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: no-repeat center / 16px 16px;
  pointer-events: none;
}

/* UI4 item C-U4-2: with the telephone drawn as two boxes (base.css, separateDialCode), the state icon stays on the right edge
   of the field (the number box); under 450px wide the boxes are stacked and the number box is the lower one, so the icon is
   moved to the lower row (bottom 7px = half of the 30px box minus half of the 16px icon; not verified in the live theme).
   The country box (flag-container) is not coloured by the states of the number: it keeps the gray of the text boxes. */
/* UI5 F1: the same at every width (the wrapper now holds the label row too, so top 50% was about 15px too high on a wide screen). */
.f2513-form .input-row .wpcf7-form-control-wrap:has(.intl-tel-input)::after {
  top: auto;
  bottom: 7px;
  margin-top: 0;
}

.f2513-form .input-row :is(.is-valid, .is-invalid, .is-editing) .intl-tel-input .flag-container,
.f2513-form .input-row:is(.is-valid, .is-invalid, .is-editing) .intl-tel-input .flag-container {
  background-color: var(--f2513-field-bg);
  border-color: var(--f2513-field-border);
}

/* UI2 item C3, changed in V7 topic 8: a plain drop-down list (select) has an arrow of its own, now always on the left
   (base.css), and the icon is on the right at 8px like every other control; the text of the list gets 28px on the
   left for the arrow and the icon padding on the right. msDropdown country lists (select.f2513-country is hidden by
   the script) are not verified in a browser: no certainty about the place of the icon there. */
.f2513-form .input-row .wpcf7-form-control-wrap:has(> select)::after {
  right: 8px;
}

.f2513-form .input-row .wpcf7-form-control-wrap:has(> select.f2513-ltr)::after {
  left: auto;
  right: 8px;
}

/* V10B_05 (owner request V10B): msDropdown country lists. What: the icon of the wrapper is not drawn for these lists;
   the same icon is drawn on the widget box itself, left of its arrow box, centred in its height; the chosen name
   starts left of the icon. Input: the state class of the row and div.dd.ddcommon made by msDropdown. Output: look only.
   Other lists of the site are not touched (the selectors start with .f2513-form .input-row). */
.f2513-form .input-row .wpcf7-form-control-wrap:has(select.f2513-country)::after {
  display: none !important;
}

.f2513-form .input-row .dd.ddcommon {
  position: relative;
}

.f2513-form .input-row:is(.is-valid, .is-invalid) .dd.ddcommon::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--f2513-dd-arrow) + 4px);
  z-index: 2;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: no-repeat center / 16px 16px;
  pointer-events: none;
}

.f2513-form .input-row.is-valid .dd.ddcommon::after {
  background-image: var(--f2513-valid-icon);
}

.f2513-form .input-row.is-invalid .dd.ddcommon::after {
  background-image: var(--f2513-invalid-icon);
}

.f2513-form .input-row .dd.ddcommon .ddTitle .ddTitleText {
  padding-right: calc(var(--f2513-dd-arrow) + 24px) !important;
}

/* V11B_02 (owner items 2 and 5, 2026-12-02 14:20 and 14:25): the open msDropdown country list (step 4
   f18_residence_country, step 6 f23_bank_country). What: the list is at most --f2513-sb-list-h (240px, selectbox.css;
   240px when the variable is missing) high and scrolls inside. Why: the site rule .ddcommon .ddChild { height: auto
   !important } (style-main.css line 5869) overrides the inline height that msDropdown sets, so the list was as high as
   all its rows (3393px measured) and made the page longer: a page scroll bar appeared, the page moved and the lower
   part of the list was off the screen. Input: div.ddChild that msDropdown builds inside div.dd.ddcommon of a form row.
   Output: look only. Other lists of the site and the selectbox.js lists are not reached (the selector starts with
   .f2513-form .input-row .dd.ddcommon). */
.f2513-form .input-row .dd.ddcommon .ddChild {
  max-height: var(--f2513-sb-list-h, 240px) !important;
  overflow-y: auto !important;
}

/* V31 (owner report, zoom of step 6: the white triangle of the dark arrow button of the country list is cut at its left edge, as if something grey
   lies over the left part of the button). What: the arrow box is always the full width (--f2513-dd-arrow) and the full height of the field, above the
   title text and the state icon (z-index 3). Input: span.ddArrow of msDropdown. Output: look only. Not reproduced here (the same markup with the site css
   draws the button whole), so the cause on the live page is not known: uncertain. */
.f2513-form .input-row .dd.ddcommon .ddArrow {
  width: var(--f2513-dd-arrow) !important;
  min-width: var(--f2513-dd-arrow);
  z-index: 3;
}
.f2513-form .input-row .dd.ddcommon .ddArrow::before {
  left: 50% !important;
  margin-left: -5px !important;
}

/* V30 (owner report, screenshot of step 6): the scroll bar of the open country list was drawn over the list (a wide track with an arrow button
   and a thumb hanging outside the list box). What: a thin bar in its own gutter inside the list, no arrow buttons, a rounded thumb. Input: the
   same div.ddChild as the rule above. Output: look only. Not verified against the site style-main.css (not in the package): uncertain. */
.f2513-form .input-row .dd.ddcommon .ddChild {
  box-sizing: border-box;
  scrollbar-width: thin !important;
  scrollbar-gutter: stable;
  scrollbar-color: #8a8a8a #f4f4f4;
}
.f2513-form .input-row .dd.ddcommon .ddChild::-webkit-scrollbar {
  width: 10px !important;
  background: #f4f4f4 !important;
}
.f2513-form .input-row .dd.ddcommon .ddChild::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.f2513-form .input-row .dd.ddcommon .ddChild::-webkit-scrollbar-track {
  background: #f4f4f4 !important;
}
.f2513-form .input-row .dd.ddcommon .ddChild::-webkit-scrollbar-thumb {
  background: #8a8a8a !important;
  border-radius: 5px !important;
}

.f2513-form .input-row select:not(.f2513-ltr) {
  padding-left: 28px;
}

.f2513-form .input-row select.f2513-ltr:not([type="checkbox"]) {
  padding-left: 28px;
  padding-right: var(--f2513-icon-pad);
}

/* A browser without :has() cannot know the side, and an icon on the wrong side would cover the text,
   so the icon is not drawn there; the colours and borders of the states still show. */
@supports not selector(:has(*)) {
  .f2513-form .input-row .wpcf7-form-control-wrap::after {
    display: none !important;
  }
}

/* Autofill of the browser (V7 topic 24; site rule 4.9 of UI2_PLAN.md: style-main.css line 5124 gives
   input:-webkit-autofill the background #e2e2dc with !important, and the browser draws its own autofill colour that
   a background-color does not replace). What: in the three states with a colour, an inset shadow of the size of the
   field paints the colour of the state over the autofill colour, so a name, phone or email that the browser filled
   shows the same colour as a typed one. Input: the state class of the row and the autofill of the browser.
   Output: look only. Business purpose: the visitor sees the true state of a filled field. */
.f2513-form .input-row.is-valid input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--f2513-valid-bg) inset;
  box-shadow: 0 0 0 1000px var(--f2513-valid-bg) inset;
}

.f2513-form .input-row.is-invalid input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--f2513-field-bg) inset;
  box-shadow: 0 0 0 1000px var(--f2513-field-bg) inset;
}

.f2513-form .input-row.is-editing input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--f2513-editing-bg) inset;
  box-shadow: 0 0 0 1000px var(--f2513-editing-bg) inset;
}

/* V7 topic 24 follow-up (T24C): a field that the browser filled while the row is still is-empty (no input event
   reached states.js yet) gets the plain white look of is-empty, not the grey #e2e2dc of the site autofill rule.
   Input: the class is-empty of the row and the autofill of the browser. Output: look only.
   Business purpose: a filled field that was not checked yet looks like the other unchecked fields. */
.f2513-form .input-row.is-empty input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--f2513-field-bg) inset;
  box-shadow: 0 0 0 1000px var(--f2513-field-bg) inset;
}

/* State is-empty: the light grey of the country-code box (V18, owner order 2026-12-03: the grey that the fields have at load must
   stay; before V18 this rule turned an empty field white at once). */
.f2513-form .input-row.is-empty :is(input, select, textarea):not([type="checkbox"], [type="radio"]) {
  background-color: var(--f2513-field-bg) !important;
}

/* State is-editing: yellow background and a dark focus outline. */
.f2513-form .input-row.is-editing :is(input, select, textarea):not([type="checkbox"], [type="radio"]),
.f2513-form .input-row.is-editing .dd.ddcommon {
  background-color: var(--f2513-editing-bg) !important;
  outline: 2px solid var(--f2513-focus-outline);
}

/* State is-editing, field of the styled list (task 3.9 of PLAN4, owner decision of 2026-12-01 12:30): the yellow comes from
   the rule above (the field is an input of the row); the text is bold. The field has a fixed width with an ellipsis
   (selectbox.css), so the bold moves nothing. Input: the input .f2513-sb-input of selectbox.js. Output: look only. */
.f2513-form .input-row.is-editing .f2513-sb-input {
  font-weight: 700;
}

/* V10B_02 (owner request V10B): a date is one field with three lists; while it is edited only the list in focus is
   yellow and bold, the other two keep the plain look. Input: the controls inside div.f2513-triple of a row in the state
   is-editing (the input of selectbox.js and the hidden native select). Output: look only. Specificity (0,6,1) is above
   the yellow rules of this file and of selectbox.css, both !important. */
.f2513-form .input-row.is-editing .f2513-triple :is(input, select, textarea):not([type="checkbox"], [type="radio"]):not(:focus) {
  background-color: var(--f2513-white, #fff) !important;
  outline: none;
  font-weight: 400;
}

/* State is-valid: green background and border, valid icon. */
.f2513-form .input-row.is-valid :is(input, select, textarea):not([type="checkbox"], [type="radio"]),
.f2513-form .input-row.is-valid .dd.ddcommon {
  background-color: var(--f2513-valid-bg) !important;
  border-color: var(--f2513-valid-border) !important;
}

.f2513-form .input-row.is-valid .wpcf7-form-control-wrap::after {
  display: block;
  background-image: var(--f2513-valid-icon);
}

/* State is-invalid: the grey field background of the registration form (V9B_10), red border, invalid icon and a dark red
   message. */
.f2513-form .input-row.is-invalid :is(input, select, textarea):not([type="checkbox"], [type="radio"]),
.f2513-form .input-row.is-invalid .dd.ddcommon {
  background-color: var(--f2513-field-bg) !important;
  border-color: var(--f2513-invalid-border) !important;
}

.f2513-form .input-row.is-invalid .wpcf7-form-control-wrap::after {
  display: block;
  background-image: var(--f2513-invalid-icon);
}

/* UI2 item C2: a group of radios or the three lists of a date (a fieldset in the row) gets no icon: the group has more
   than one control wrapper, and an icon on each one is a duplicate sign that is not "in the field". The state shows
   in the colour of the message and, for radios, in the circle (item C5). Specificity is above the two rules above. */
.f2513-form .input-row.is-valid > fieldset .wpcf7-form-control-wrap::after,
.f2513-form .input-row.is-invalid > fieldset .wpcf7-form-control-wrap::after {
  display: none;
}

/* UI2 item C5, radios: in the invalid state the empty circle of each choice gets the invalid border colour
   (the site shows a red label in an error, style-main.css line 7872). */
.f2513-form .input-row.is-invalid [type="radio"] + .wpcf7-list-item-label::before {
  border-color: var(--f2513-invalid-border);
}

.f2513-form .input-row.is-invalid fieldset.f2513-switch .wpcf7-radio {
  border-color: var(--f2513-invalid-border);
}

/* UI2 item C5, msDropdown: the site gives the title a gray background (style-main.css line 5970) that hid the colour
   of the state of .dd.ddcommon; in the three states with a colour the title is transparent, so the colour shows. */
.f2513-form .input-row.is-valid .dd .ddTitle,
.f2513-form .input-row.is-invalid .dd .ddTitle,
.f2513-form .input-row.is-editing .dd .ddTitle {
  background: transparent;
}

.f2513-form .input-row.is-invalid .f2513-msg {
  color: var(--f2513-invalid-text);
}

/* The site rules form .valid and form .error (jquery.validate) must not colour the form controls; only the
   input, select and textarea controls of a field row are reached, so the arrow of other components and
   the msDropdown backgrounds keep their images. */
.f2513-form .input-row :is(input, select, textarea).valid,
.f2513-form .input-row :is(input, select, textarea).error {
  background-color: var(--f2513-white, #fff) !important;
  border-color: inherit !important;
  background-image: none !important;
}

/* UI2 item C4: the site draws its own red X as a background image on a field that is marked aria-invalid="true" (that is set
   by states.js in the invalid state) or has the CF7 class wpcf7-not-valid (style-main.css lines 5057 to 5088). With our
   icon there would be two X signs, so the background image of these is removed; the red border is not touched (a separate
   rule on purpose: the rule above also resets the border). The plain list keeps its arrow (the last rule). */
.f2513-form .input-row :is(input, textarea)[aria-invalid="true"],
.f2513-form .input-row :is(input, select, textarea).wpcf7-not-valid {
  background-image: none !important;
}

/* The arrow of a plain list is a background image too, so it is given back after the neutralizing rules above
   (same specificity, this one is later). */
.f2513-form .input-row select:not(.f2513-country) {
  background-image: var(--f2513-select-arrow) !important;
}

/* V9B items 11 and 12: no message under a single field; every message is in the reserved area (.f2513-errsum). The text
   stays in the element for aria-describedby. */
.f2513-form .input-row .f2513-msg,
.f2513-form .wpcf7-not-valid-tip {
  display: none;
}

/* The CF7 response message (div.wpcf7-response-output) carries the form-chain answers of the server
   (chain_invalid, rate_limited, rate_limited_new, rev_mismatch, step_out_of_order, too_large, missing_step,
   no_draft, step_invalid, unknown_code; FIXC_C20 item 1). It must stay visible on every step of the chain,
   also when a site rule hides it; an empty message and the states init, submitting and resetting of CF7 keep
   the CF7 behaviour (hidden). */
.f2513-form form.wpcf7-form:not(.init):not(.submitting):not(.resetting) .wpcf7-response-output:not(:empty) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Check mark of a check box (UI5 item 4, owner decision 4). What: the "V" of a checked check box inside the form, the
   same rule as the site (currengeformsSecond.css lines ~891 and ~912, style-main.css line ~1015): ::after of the label
   after the input, font 'currenge' (!important), content '\0041', colour #305f1e, 12px, absolute, top 4px, left 2.5px,
   shown only when :checked (not checked: opacity 0 and scale 0, checked: opacity 1 and scale 1, 0.2s).
   Why here: the site rule works only inside .input-vertical or .input-horizontal; the templates of this form have no such
   wrapper (and today no check box at all), so without this rule the V would not show or would show wrong.
   Scope: only .f2513-form, so the css of the site is not changed. The label gets position relative so that the absolute
   V is placed in the label (the site gives it in the same wrappers). The box itself (::before) is not drawn here: it
   comes from the site rule when the wrapper is used.
   The font 'currenge' comes from the @font-face rule in base.css (moved there in DEV-UI5F; base.css loads before states.css on the same page, see manifest() in assets.php). */
.f2513-form [type="checkbox"] + .wpcf7-list-item-label {
  position: relative;
}

.f2513-form [type="checkbox"]:not(:checked) + .wpcf7-list-item-label::after,
.f2513-form [type="checkbox"]:checked + .wpcf7-list-item-label::after {
  display: inline-block;
  font-family: 'currenge' !important;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  content: '\0041';
  color: #305f1e;
  position: absolute;
  font-size: 12px;
  top: 4px;
  left: 2.5px;
  transition: all 0.2s;
}

.f2513-form [type="checkbox"]:not(:checked) + .wpcf7-list-item-label::after {
  opacity: 0;
  transform: scale(0);
}

.f2513-form [type="checkbox"]:checked + .wpcf7-list-item-label::after {
  opacity: 1;
  transform: scale(1);
}

/* V14 (owner order 2026-12-03, screen 1; REPORT_V13_DIAG item 12): the state icon of the phone field is drawn on the
   field itself (div.intl-tel-input, which is the box of the number), not on the wrapper of the whole row, so it can
   never sit on the label. Not checked in a browser: no certainty; check on screen 1 at a wide and a narrow width. */
.f2513-form .input-row .wpcf7-form-control-wrap:has(.intl-tel-input)::after {
  display: none !important;
}

.f2513-form .intl-tel-input {
  position: relative;
}

.f2513-form .input-row:is(.is-valid, .is-invalid) .intl-tel-input::after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  right: 8px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: no-repeat center / 16px 16px;
  pointer-events: none;
  /* v16 item 12: in the phone grid the icon is anchored to the number box (row 2, column 2), not to the whole grid */
  grid-column: 2;
  grid-row: 2;
  top: 50%;
}

@media (max-width: 450px) {
  .f2513-form .input-row:is(.is-valid, .is-invalid) .intl-tel-input::after {
    grid-column: 1;
    grid-row: 4;
  }
}

.f2513-form .input-row.is-valid .intl-tel-input::after {
  background-image: var(--f2513-valid-icon);
}

.f2513-form .input-row.is-invalid .intl-tel-input::after {
  background-image: var(--f2513-invalid-icon);
}
