/* Zynch login, version 4 (28 September 2026, after the live QA). Replaces zynch-3.css; the new name busts the one-hour browser cache.
   Version 4 adds: 44 px language link on phones, the no-reset helper line under the password field, nothing else.

   What changed from version 2, and why:
   1. PatternFly is no longer loaded (theme.properties stylesCommon is empty and template.ftl no longer renders it).
      This file therefore starts with a small reset and styles every Keycloak class name the Zynch pages actually
      emit: the keycloak.v2 macros (.pf-v5-c-form-control is a wrapper span) and the base templates (where the same
      class sits on the input itself). Pages Zynch does not use (one-time codes, security keys, recovery codes,
      authenticator choice) fall back to readable browser defaults.
   2. Colours are the token file's and nothing else. Status tints and the error text colour are mixed from two
      tokens with color-mix(); links move from accent.700 (3.98:1 on white, fails AA) to accent.800 (6.38:1);
      field borders move from neutral.300 (1.8:1, fails the 3:1 rule for a field's edge) to neutral.500 (4.68:1).
   3. Every size is on the token scale (12 13 14 16 18 22 28 36) and every gap on the 8-pixel rhythm.
   4. The hero's raster Z (55 KB, 16 percent opacity, cut mid-letter) is replaced by the brand's circuit-line
      "swarm Z", drawn inline in template.ftl in the blue-to-teal brand gradient, which DESIGN.md allows only here.
   5. Buttons are all Outfit 600 at 16 px, as DESIGN.md says. The provider button is a three-column grid so its
      label is centred like the primary button's, whatever the icon.
   6. The page follows the system's dark preference (DESIGN.md rule 6: both themes or none). The hero stays navy.
   7. Logical properties throughout, so a right-to-left page mirrors without extra rules. */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/outfit-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/heebo-hebrew.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }

/* ---------- Tokens (brand/design-tokens.json) ---------- */
:root {
  --z-navy: #0B1F44;        /* neutral.950, brand navy */
  --z-blue: #2F7CF6;        /* brand.blue, gradient companion; hero only */
  --z-teal: #00B3A4;        /* accent.500 */
  --z-teal-300: #5ED6CB;
  --z-teal-400: #2AC4B7;
  --z-teal-600: #009C90;
  --z-teal-800: #006B65;
  --z-white: #FFFFFF;       /* neutral.0 */
  --z-n50: #F7F8FA;
  --z-n100: #EEF1F5;
  --z-n200: #D9DEE7;
  --z-n300: #B7C2D3;
  --z-n400: #8A99B0;
  --z-n500: #647590;
  --z-n600: #4B5A73;
  --z-n700: #2A3A55;
  --z-n800: #1C2A44;
  --z-n850: #162238;
  --z-n900: #0F1A2E;
  --z-on-dark: #F2F5F9;     /* zynch-dark text */
  --z-success: #1F9D6B;
  --z-warning: #D48A0C;
  --z-error: #EF4444;
  --z-info: #2F5AA8;

  --z-display: "Outfit", "Heebo", system-ui, sans-serif;
  --z-text: "Inter", "Heebo", system-ui, sans-serif;
  --z-ease: cubic-bezier(0.2, 0, 0, 1);
  --z-fast: 120ms;

  /* zynch-light roles */
  --bg: var(--z-white);
  --surface: var(--z-white);
  --surface-hover: var(--z-n50);
  --surface-quiet: var(--z-n50);
  --text: var(--z-navy);
  --text-2: var(--z-n700);
  --muted: var(--z-n500);
  --line: var(--z-n200);
  --line-strong: var(--z-n300);
  --field-line: var(--z-n500);
  --accent: var(--z-teal);
  --accent-hover: var(--z-teal-600);
  --on-accent: var(--z-navy);
  --link: var(--z-teal-800);
  --ring: var(--z-teal);
  --ring-soft: color-mix(in srgb, var(--z-teal) 30%, transparent);
  --error-line: var(--z-error);
  --error-text: color-mix(in srgb, var(--z-error) 70%, var(--z-navy));   /* 6.2:1 on white */
  --tint: 8%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--z-n900);
    --surface: var(--z-n850);
    --surface-hover: var(--z-n800);
    --surface-quiet: var(--z-n850);
    --text: var(--z-on-dark);
    --text-2: var(--z-n300);
    --muted: var(--z-n400);
    --line: var(--z-n700);
    --line-strong: var(--z-n600);
    --field-line: var(--z-n400);
    --accent-hover: var(--z-teal-400);
    --link: var(--z-teal-300);
    --ring: var(--z-teal-400);
    --error-text: color-mix(in srgb, var(--z-error) 75%, var(--z-white)); /* 5.8:1 on neutral.900 */
    --tint: 14%;
  }
}

/* ---------- Reset (PatternFly is gone) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.zy {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--z-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.zy :where(h1, h2, h3, p, ul, ol, figure) { margin: 0; } /* :where keeps these at class weight, so later rules win */
.zy :where(button, input, select, textarea) { font: inherit; color: inherit; }
.zy :where(img, svg) { display: block; max-width: 100%; }
.zy [hidden] { display: none !important; }
.zy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Split: hero and panel ---------- */
.zy-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 100vh; min-height: 100dvh; }

.zy-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 48px;
  background: var(--z-navy); color: var(--z-on-dark);
}
.zy-brand img { height: 40px; width: auto; }

/* The one bold element: the circuit-line Z. It fills whatever height is left between the logo and the words, and
   its open strands run off both edges of the panel. Colours come from CSS so the SVG carries no hex values. */
.zy-swarm { position: relative; flex: 1 1 0; min-height: 160px; margin-inline: -48px; }
.zy-swarm svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.zy-swarm path, .zy-swarm circle { fill: none; stroke: url(#zy-swarm-g); stroke-width: 2; stroke-linecap: round; }
.zy-swarm circle { fill: var(--z-navy); }
.zy-swarm .zy-swarm-from { stop-color: var(--z-blue); }
.zy-swarm .zy-swarm-to { stop-color: var(--z-teal); }

.zy-hero-copy { max-width: 26rem; }
.zy-hero-title {
  font-family: var(--z-display); font-weight: 600; font-size: 36px; line-height: 1.1; letter-spacing: -0.015em;
  color: var(--z-white); text-wrap: balance;
}
.zy-hero-text { margin-block-start: 16px; font-size: 18px; line-height: 1.5; color: var(--z-n300); }

/* ---------- Panel ---------- */
.zy-panel {
  display: grid; grid-template-rows: 1fr auto; justify-items: center; row-gap: 48px;
  padding: 48px 32px 32px;
}
.zy-form { align-self: center; width: 100%; max-width: 400px; }
.zy-head { margin-block-end: 32px; }
.zy-title { font-family: var(--z-display); font-weight: 600; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
.zy-lead { margin-block-start: 8px; font-size: 16px; line-height: 1.5; color: var(--muted); }
/* Language switch: one link to the other language, at the end of the title row. Hidden until messages_he.properties
   ships (the Hebrew session removes the display:none line together with that file). */
.zy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.zy-head .zy-lead { flex-basis: 100%; }
.zy-locale a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); white-space: nowrap; }
.zy-locale a:hover { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.zy-no-reset { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
[dir="rtl"] .zy-title, [dir="rtl"] .zy-hero-title { letter-spacing: 0; }
[dir="rtl"] .zy-hero-title { font-size: 32px; }
.zy-required { margin-block-end: 16px; font-size: 13px; color: var(--muted); }

/* Footer: the record note, then help and privacy when theme.properties names them. */
.zy-foot {
  width: 100%; max-width: 400px;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.zy-foot-links { display: flex; gap: 16px; }
.zy-panel .zy-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.zy-panel .zy-foot a:hover { color: var(--text); }

/* Signed-in-as row on the password page (replaces Keycloak's read-only field and restart icon). */
.zy-who {
  display: flex; align-items: center; gap: 16px; margin-block-end: 24px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-quiet);
}
.zy-who-text { flex: 1; min-width: 0; display: grid; }
.zy-who-label { font-size: 13px; color: var(--muted); }
.zy-who-email { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zy-who a { flex: none; font-size: 14px; font-weight: 500; }

/* ---------- Form parts (keycloak.v2 macros and base templates) ---------- */
.zy-panel form { margin: 0; }
.zy-panel .pf-v5-c-form { display: grid; gap: 24px; }
.zy-panel .pf-v5-c-form__group { display: grid; gap: 8px; min-width: 0; }
.zy-panel .pf-v5-c-form__group:not(:has(*)) { display: none; } /* Keycloak's empty "remember me" slot */
.zy-panel :is(.pf-v5-c-form__label, label) { display: inline; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text-2); }
.zy-panel .pf-v5-c-form__label-text { font: inherit; }
.zy-panel :is(.pf-v5-c-form__label-required, .required) { margin-inline-start: 4px; color: var(--muted); }

/* A field: the wrapper span (v2 macros) or the input itself (base templates). */
.zy-panel .pf-v5-c-form-control,
.zy-panel :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select, textarea):not(.pf-v5-c-form-control *) {
  display: flex; align-items: center; width: 100%; min-height: 48px; margin: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--field-line); border-radius: 6px;
  transition: border-color var(--z-fast) var(--z-ease), box-shadow var(--z-fast) var(--z-ease);
}
.zy-panel input.pf-v5-c-form-control,
.zy-panel :is(input, select, textarea):not(.pf-v5-c-form-control *):not([type="checkbox"], [type="radio"], [type="submit"], [type="hidden"]) { padding: 0 16px; font-size: 16px; }
.zy-panel textarea { padding-block: 12px; min-height: 96px; }
.zy-panel .pf-v5-c-form-control > :is(input, select, textarea) {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 0; outline: 0; background: transparent;
  font-size: 16px; line-height: 1.4; color: var(--text); border-radius: 6px;
}
.zy-panel .pf-v5-c-form-control:hover { border-color: var(--text-2); }
.zy-panel .pf-v5-c-form-control:focus-within,
.zy-panel input.pf-v5-c-form-control:focus { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); outline: 2px solid var(--text); outline-offset: 2px; }
.zy-panel .pf-v5-c-form-control.pf-m-error,
.zy-panel [aria-invalid="true"].pf-v5-c-form-control { border-color: var(--error-line); }
.zy-panel .pf-v5-c-form-control.pf-m-error:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-error) 25%, transparent); }
.zy-panel .pf-m-readonly, .zy-panel .pf-v5-c-form-control > input:read-only { color: var(--muted); background: var(--surface-quiet); }
.zy-panel ::placeholder { color: var(--muted); opacity: 1; }
.zy-panel .pf-v5-c-form-control__utilities { display: flex; padding-inline-end: 12px; color: var(--error-line); }

/* Password field and its show/hide button, joined into one control. */
.zy-panel .pf-v5-c-input-group { display: flex; }
.zy-panel .pf-v5-c-input-group__item { display: flex; }
.zy-panel .pf-v5-c-input-group__item.pf-m-fill { flex: 1; min-width: 0; }
.zy-panel .pf-v5-c-input-group__item.pf-m-fill .pf-v5-c-form-control { border-start-end-radius: 0; border-end-end-radius: 0; }
.zy-panel .pf-v5-c-input-group .pf-v5-c-button.pf-m-control {
  width: 48px; min-height: 48px; padding: 0; border: 1px solid var(--field-line); border-inline-start: 0;
  border-radius: 0 6px 6px 0; background: var(--surface); color: var(--muted);
}
[dir="rtl"] .zy-panel .pf-v5-c-input-group .pf-v5-c-button.pf-m-control { border-radius: 6px 0 0 6px; }
.zy-panel .pf-v5-c-input-group .pf-v5-c-button.pf-m-control:hover { color: var(--text); background: var(--surface-hover); }

/* Helper and error text under a field. */
.zy-panel .pf-v5-c-form__helper-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.zy-panel .pf-v5-c-helper-text { display: contents; }
.zy-panel :is(.pf-v5-c-helper-text__item-text, .kc-feedback-text) { font-size: 14px; line-height: 1.45; }
.zy-panel :is(.pf-v5-c-helper-text__item.pf-m-error .pf-v5-c-helper-text__item-text, .kc-feedback-text.pf-m-error) { color: var(--error-text); }

.zy-panel .pf-v5-c-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.zy-panel .pf-v5-c-check__input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.zy-panel .pf-v5-c-check__label { font-size: 14px; color: var(--text-2); }

.zy-panel .pf-v5-c-form__actions, .zy-panel #kc-form-buttons, .zy-actions { display: grid; gap: 12px; margin: 0; }
.zy-panel #kc-form-buttons { margin-block-start: 24px; }
.zy-panel #kc-form-options { margin-block-start: 16px; font-size: 14px; }

/* ---------- Buttons ---------- */
.zy-panel .pf-v5-c-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 20px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-family: var(--z-display); font-weight: 600; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: background-color var(--z-fast) var(--z-ease), border-color var(--z-fast) var(--z-ease);
}
.zy-panel .pf-v5-c-button:hover { background: var(--surface-hover); border-color: var(--muted); text-decoration: none; }
.zy-panel .pf-v5-c-button.pf-m-block { display: flex; width: 100%; }
.zy-panel .pf-v5-c-button.pf-m-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.zy-panel .pf-v5-c-button.pf-m-primary:is(:hover, :active) { background: var(--accent-hover); border-color: var(--accent-hover); }
.zy-panel .pf-v5-c-button.pf-m-primary:active { box-shadow: inset 0 2px 0 color-mix(in srgb, var(--z-navy) 20%, transparent); }
.zy-panel .pf-v5-c-button.pf-m-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--link); font-family: var(--z-text); font-weight: 500; font-size: 14px; }
.zy-panel .pf-v5-c-button:disabled, .zy-panel .pf-m-aria-disabled { opacity: 0.6; cursor: progress; pointer-events: none; }

/* Provider buttons: icon, centred label, and an empty third column that balances the icon. */
.zy-providers { list-style: none; padding: 0; display: grid; gap: 12px; }
.zy-panel .pf-v5-c-button.pf-m-block.zy-provider { display: grid; grid-template-columns: 20px 1fr 20px; gap: 12px; padding-inline: 16px; }
.zy-provider svg, .zy-provider-initial { width: 20px; height: 20px; }
.zy-provider-initial { display: grid; place-items: center; border-radius: 6px; background: var(--z-navy); color: var(--z-white); font-size: 12px; }

/* "or" between the e-mail route and the providers. */
.zy-after { margin-block-start: 24px; }
.zy-after:not(:has(*)) { display: none; }
.zy-panel .pf-v5-c-login__main-footer-band { display: flex; align-items: center; gap: 16px; margin-block-end: 24px; font-size: 13px; color: var(--muted); }
.zy-panel .pf-v5-c-login__main-footer-band::before,
.zy-panel .pf-v5-c-login__main-footer-band::after { content: ""; flex: 1; border-block-start: 1px solid var(--line); }
.zy-info { margin-block-start: 24px; font-size: 14px; color: var(--muted); }
.zy-footer:empty { display: none; }

/* ---------- Links and focus ---------- */
.zy-panel a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.zy-panel a:hover { text-decoration-thickness: 2px; }
/* Focus: a 2 px ring in the text colour, offset 2 px so it sits on the page background, not on the control. Teal alone
   is 2.6:1 on white and 1:1 on the teal button (WCAG 2.4.11/1.4.11); navy is 16:1 on white, near-white 15:1 on the dark surface. */
.zy :is(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.zy-alert:focus:not(:focus-visible) { outline: none; }
.zy-panel .pf-v5-c-form-control > :is(input, select, textarea):focus-visible { outline: none; } /* the wrapper shows the ring */

/* ---------- Messages ---------- */
.zy-alert {
  --status: var(--z-info);
  margin-block-end: 24px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--status) 45%, transparent);
  background: color-mix(in srgb, var(--status) var(--tint), var(--bg));
  font-size: 14px; line-height: 1.45; color: var(--text);
}
.zy-alert-error { --status: var(--z-error); }
.zy-alert-success { --status: var(--z-success); }
.zy-alert-warning { --status: var(--z-warning); }
.zy-alert .kc-feedback-text { font-size: inherit; color: inherit; }

/* Text pages: error, info, page expired, verify e-mail. */
.zy-panel .instruction { margin-block-end: 24px; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.zy-panel .instruction:last-child { margin-block-end: 0; }
.zy-trace { margin-block-start: 24px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Icons Keycloak names with Font Awesome classes, drawn as masks (Lucide shapes, ISC) since the icon font is gone. */
.zy .fa-eye, .zy .fa-eye-slash, .zy .fa-exclamation-circle {
  display: inline-block; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.zy .fa-eye { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.zy .fa-eye-slash { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.73 5.08a10.74 10.74 0 0 1 11.2 6.57 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-1.44 2.49'/%3E%3Cpath d='M14.08 14.16a3 3 0 0 1-4.24-4.24'/%3E%3Cpath d='M17.48 17.5a10.75 10.75 0 0 1-15.42-5.15 1 1 0 0 1 0-.7 10.75 10.75 0 0 1 4.45-5.14'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E"); }
.zy .fa-exclamation-circle { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: reduce) { .zy *, .zy *::before, .zy *::after { transition: none !important; } }

/* ---------- Narrow desktops and tablets ---------- */
@media (min-width: 861px) and (max-width: 1100px) {
  .zy-hero { padding: 40px; }
  .zy-swarm { margin-inline: -40px; }
  .zy-hero-title { font-size: 28px; }
  .zy-hero-text { font-size: 16px; }
}
@media (min-width: 861px) and (max-height: 600px) {
  .zy-swarm { display: none; }
}

/* ---------- Phones: the hero becomes a band with the wordmark ---------- */
@media (max-width: 860px) {
  .zy-locale a { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 14px; }
  .zy-split { grid-template-columns: 1fr; min-height: 0; }
  .zy-hero { padding: 16px 20px; flex-direction: row; align-items: center; gap: 0; }
  .zy-brand img { height: 32px; } /* brand minimum on login pages */
  .zy-swarm, .zy-hero-copy { display: none; }
  .zy-panel { grid-template-rows: auto auto; row-gap: 40px; padding: 32px 20px 32px; }
  .zy-form { align-self: start; }
  .zy-head { margin-block-end: 24px; }
  .zy-foot { flex-direction: column; }
  /* Stand-alone text links get a 44 px touch height (DESIGN.md rule 5). */
  .zy-panel :is(.zy-who a, .pf-v5-c-helper-text__item-text a, #kc-form-options a, .zy-foot a) { display: inline-flex; align-items: center; min-height: 44px; }
  .zy-foot { gap: 0 24px; }
}
