/*
 * sig.css - style of the signature pad in the 2513 form (G05).
 * What it does: sets the signature frame to full width and 150 pixels high, makes the canvas fill the frame,
 *   keeps the clear button reachable at 360 pixels, and marks an unsigned pad with the error border.
 * Input: markup made by the signature plugin inside the form wrapper: div.wpcf7-form-control-signature-wrap
 *   with a canvas, and div.wpcf7-form-control-clear-wrap with the clear button.
 *   The canvas sits inside div.wpcf7-form-control-signature-body (source: signature plugin file, line 189).
 * Output: layout and border rules; goes to the user's browser.
 * Business purpose: the pad looks like the one in the registration form, is easy to draw on in a phone,
 *   and does not cause sideways scrolling.
 * Scope: every rule starts with .f2513-form, so no other form or canvas on the page is affected.
 * Loaded after base.css (C19) and only on the form page (C22); no switch; no JS and no touchmove blocking.
 * Form-chain (FIXC_G05): the file is loaded by C22 on the signature step page only; every selector starts with
 *   .f2513-form, the class that every step form carries, so nothing outside the form is touched.
 * Width: the frame has no max-width here on purpose; the width of the column is capped by C19 (--f2513-max-w, 720
 *   pixels in base.css), and 720 times the pixel ratio 3 is below 4000, the widest bitmap that S01 accepts. The test
 *   test_sig_css.sh locks this arithmetic.
 */

/* Frame. Source: style-main.css lines 7833 to 7835 (width, height, border, background colour).
   !important is needed because the plugin writes width and height in the style attribute of the tag
   (class-wpcf7-signature-public.php line 188). The 150 pixel height is fixed, as in the registration form. */
.f2513-form .wpcf7-form-control-signature-wrap {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 150px !important;
  border: 1px solid #e7e6e5;
  background-color: #f4f3f3;
}

/* Canvas fills the frame, so that offsetWidth read by G01 is the frame width.
   touch-action none is only here: source style-main.css line 7884 and signature_pad.min.js line 1;
   it stops the page from scrolling while the finger draws, without blocking touchmove elsewhere. */
.f2513-form .wpcf7-form-control-signature-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Clear button: touch target of at least 24 pixels, inside the screen width at 360 pixels. */
.f2513-form .wpcf7-form-control-clear-wrap input {
  min-height: 24px;
  max-width: 100%;
}

/* V11B_12 (owner orders 2026-12-02 14:32 and 14:53): the clear button of the signature.
   Text: "נקה חתימה", set on the server by hooks/sig_clear_label.php (the plugin prints "Clear").
   Width: one COL-2 column of a row of two columns, on the right (the start of the row in right to left): above 590px
   the width of a field in .f2513-pair (half of the row minus half of --f2513-col-gap, base.css lines 442 to 516),
   at 590px and below the whole row, the same break point as the pairs.
   Colours: medium gray #6b6b6b with white text (contrast 5.33 to 1, above 4.5), and on hover or press dark gray #404040
   (contrast 10.37 to 1); the border has the colour of the background.
   Why the id and !important: the site gives this button a green background, white text and a yellow hover border
   (style-main.css lines 7846 to 7849), and the field states of states.css (is-empty line 202 white, is-valid line 231
   green, is-invalid line 244 gray with a red border, padding-right 28px at line 65) reach every input of the signature
   row, the button included, all with !important; an id selector with !important is above all of them. Only this one
   button is changed (id of the plugin markup, wpcf7_<tag>_clear). */
.f2513-form .wpcf7-form-control-clear-wrap {
  box-sizing: border-box;
  width: 100%;
}

@media not all and (max-width: 590px) {
  .f2513-form .wpcf7-form-control-clear-wrap {
    width: calc((100% - var(--f2513-col-gap, 20px)) / 2);
  }
}

.f2513-form .input-row .wpcf7-form-control-clear-wrap input#wpcf7_f2513_signature_clear {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 7px 20px !important;
  border: 1px solid #6b6b6b !important;
  background-color: #6b6b6b !important;
  background-image: none !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.f2513-form .input-row .wpcf7-form-control-clear-wrap input#wpcf7_f2513_signature_clear:hover,
.f2513-form .input-row .wpcf7-form-control-clear-wrap input#wpcf7_f2513_signature_clear:active {
  border-color: #404040 !important;
  background-color: #404040 !important;
}

/* Unsigned pad after a failed validation. Source: style-main.css line 7878, error border colour #f25165. */
.f2513-form canvas.error {
  border: 1px solid #f25165 !important;
}

/* V11B_14 (owner item 15, order 2026-12-02 14:49): the state icon of the signature field (the red X or the green V of
   states.css) is drawn inside the signature frame, 8 pixels from its top and right edges, the same 16 pixel icon and
   the same 8 pixel right margin as every other field; it is no longer drawn under the clear button.
   Why: states.css draws the icon as ::after of every .wpcf7-form-control-wrap in the row; in the signature row that
   wrapper is the span of the hidden input of the plugin (class-wpcf7-signature-public.php line 197), which comes after
   the clear button, so the icon stood under the button. The canvas of the plugin is transparent, so a background image
   of the frame is seen through it. The sentence of the error is written in div.f2513-errsum by minlen.js (G04).
   Specificity of the first rule is (0,4,1), the same as the rule of states.css; this file loads after states.css.
   No :is() with a comma here: test_sig_css.sh splits selectors at commas and checks the .f2513-form scope of each. */
.f2513-form .input-row.is-valid .wpcf7-form-control-signature-input-wrap::after,
.f2513-form .input-row.is-invalid .wpcf7-form-control-signature-input-wrap::after {
  display: none;
}

.f2513-form .input-row.is-valid .wpcf7-form-control-signature-wrap,
.f2513-form .input-row.is-invalid .wpcf7-form-control-signature-wrap {
  background-repeat: no-repeat;
  background-position: right 8px top 8px;
  background-size: 16px 16px;
}

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

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