/* One checkbox for the whole system (Béci 7618, Ervin TG 5437): the look of the Új projekt client step's "Eltérő számlázási
 * adatok" box, a rounded square filled magenta with a white tick when on, its label in the CRM's label type. Every layout loads
 * this file (admin, auth, mprint-auth, guest, app), the CRM's pages, the kalkulator and the Ügyfelek page in the CRM's frame, the
 * login and the client-facing forms alike.
 *
 * The values: the magenta and its hover are the theme's --magenta / --magenta-hover (public/style.css, css/mprint-auth.css),
 * 16 px the size the kalkulator and the login gave their boxes, the line the theme's field line (--sk-field-line), the ring the
 * theme's keyboard focus ring (--sk-focus); the label is the sample's own rule (.sk-theme label: Lato 14px 600 #3c3f48).
 *
 * #mprint is the <html> of every layout: an id outweighs the class-based rules of Bootstrap, sb-admin, the MDB kit of the
 * client-facing forms and the kalkulator's stylesheet (public/style.css, narrowed to .kalk, kept byte for byte as the
 * kalkulator's), so no local rule has to be turned off one by one. Only the look is set here: margins, floats and alignment
 * stay with each layout. Radios and switches are not touched (Ervin decides). */

@font-face { font-family: "Lato"; src: url("/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/Lato-Bold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }

#mprint {
    --mp-check-size: 16px;
    --mp-check-radius: 4px;
    --mp-check-line: #8a93a8;
    --mp-check-on: #ec008c;
    --mp-check-on-hover: #c4007a;
    --mp-check-ring: 0 0 0 2px #fff, 0 0 0 4px #ec008c;
    --mp-check-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --mp-check-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8h7.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

#mprint input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    flex: none;
    width: var(--mp-check-size);
    height: var(--mp-check-size);
    min-width: 0;
    min-height: 0;
    max-width: none;
    padding: 0;
    border: 1.5px solid var(--mp-check-line);
    border-radius: var(--mp-check-radius);
    background: #fff none center / 14px 14px no-repeat;
    box-shadow: none;
    outline: 0;
    filter: none;
    opacity: 1;
    cursor: pointer;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    transition: background-color .12s, border-color .12s, box-shadow .12s;
}
/* the MDB kit of the client-facing forms draws its tick and ripple in pseudo-elements */
#mprint input[type=checkbox]::before,
#mprint input[type=checkbox]::after { content: none; display: none; }

#mprint input[type=checkbox]:hover { border-color: var(--mp-check-on); }
#mprint input[type=checkbox]:checked,
#mprint input[type=checkbox]:indeterminate { background-color: var(--mp-check-on); border-color: var(--mp-check-on); }
#mprint input[type=checkbox]:checked { background-image: var(--mp-check-tick); }
#mprint input[type=checkbox]:indeterminate { background-image: var(--mp-check-dash); }
#mprint input[type=checkbox]:checked:hover,
#mprint input[type=checkbox]:indeterminate:hover { background-color: var(--mp-check-on-hover); border-color: var(--mp-check-on-hover); }
/* the ring only for the keyboard, as every other field; a click leaves none */
#mprint input[type=checkbox]:focus { box-shadow: none; }
#mprint input[type=checkbox]:focus-visible { box-shadow: var(--mp-check-ring) !important; }
#mprint input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }
#mprint input[type=checkbox]:disabled:hover { border-color: var(--mp-check-line); }
#mprint input[type=checkbox]:disabled:checked:hover,
#mprint input[type=checkbox]:disabled:indeterminate:hover { background-color: var(--mp-check-on); border-color: var(--mp-check-on); }

/* the label: next to the box (Bootstrap's .form-check-label, a label after it) or around it (the kalkulator's label.chk, the
 * login's label.check); a label in a state colour (the kalkulator's mixed sizes) keeps its colour */
#mprint input[type=checkbox] ~ .form-check-label,
#mprint input[type=checkbox] + label,
#mprint label:has(> input[type=checkbox]) {
    font-family: Lato, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
#mprint input[type=checkbox] ~ .form-check-label,
#mprint input[type=checkbox] + label,
#mprint label:has(> input[type=checkbox]):not(.mixed) { color: #3c3f48; }

/* the box on its label's FIRST line, centred (Ervin TG 180, Béci 479): measured, the box sat 2.5 px high next to a plain label
 * (.form-check.ps-0, the client step's "Eltérő számlázási adatok"), 1.8 px low as Bootstrap's .form-check-input and 2.8 px low
 * in a switch. One line height for every checkbox label (20 px) and the 16 px box 2 px down from the line's top, whatever the
 * layout: beside the label (float or inline), or inside it (flex, now from the top so a label of two lines keeps the box on its
 * first). A box without a label (a table's row selector) is not moved. */
#mprint input[type=checkbox] ~ .form-check-label,
#mprint input[type=checkbox] + label,
#mprint label:has(> input[type=checkbox]) { line-height: 20px; }
#mprint label:has(> input[type=checkbox]) { align-items: flex-start; }
#mprint input[type=checkbox]:has(~ .form-check-label),
#mprint input[type=checkbox]:has(+ label),
#mprint label:has(> input[type=checkbox]) > input[type=checkbox] { margin-top: 2px; margin-bottom: 0; vertical-align: top; }
/* the kalkulator's 36 px label rows (NYOMDA, a line's Opcionális): the one line stays in the row's middle, as the fields beside it ((36 - 20) / 2) */
#mprint .nyline .nynum > label.chk, #mprint .nyshow label.chk, #mprint .lsum label.ochk { box-sizing: border-box; padding-top: 8px; }
/* the project's Ügyfél step's header checks ("Céges ügyfél", the billing's "Cégnévre"; .sk-head-check, an inline-flex row centred by
   the theme): from the top as well, or the 2 px above put the box 1.5 px under its label's middle (tester 561, Béci 585) */
#mprint .sk-head-check:has(> input[type=checkbox] + label) { align-items: flex-start; }
/* a plain box and its label side by side (no .form-check-input float): one row, from the top */
#mprint .form-check:has(> input[type=checkbox]:not(.form-check-input) + label) { display: flex; align-items: flex-start; gap: 8px; }
