/* The lawyers' join page (page-templates/lawyer-join.php, 11.2026; direction "the card that fills in", phase 1 option A).
   The form on the reading side; beside it the lawyer's own card from the lawyer pages (lawyer-page.css: .lwp-card,
   the rosette drawn from the name), sticky on a desktop, filling in as they type. On a phone the card opens the page
   and comes back, full, just before the send. Loaded on this template only, after main.css and lawyer-page.css.
   Prefix "lj-": the index owns "lw-", the lawyer page "lwp-". Rules kept: nothing visible under 16px; one accent;
   6px corners (the card keeps its own); hairlines; motion only for a change of state. */

.lj.page { padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem); }
.lj-grid { display: grid; gap: 1rem; grid-template-areas: "head" "side" "form"; }
.lj-head { grid-area: head; max-width: none; margin-bottom: 0; }
.lj-side { grid-area: side; min-width: 0; }
.lj-join { grid-area: form; max-width: none; margin-top: 0; min-width: 0; }
.lj-head h1 { max-width: 15ch; margin-bottom: .8rem; font-size: clamp(2.15rem, 1.45rem + 2.4vw, 3.25rem); line-height: 1.12; letter-spacing: -.01em; }
.lj-lede { max-width: 38rem; }
.lj-lede > * + * { margin-top: .6em; }
.lj-sub { max-width: 38rem; margin-top: .75rem; color: var(--muted); font-size: 17px; line-height: 1.6; }

@media (min-width: 960px) {
  .lj-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
    grid-template-areas: "head side" "form side";
    grid-template-rows: auto 1fr;
    column-gap: clamp(3rem, 5.5vw, 5.5rem); row-gap: 2.5rem; align-items: start;
  }
  .lj-head h1 { margin-bottom: 1.1rem; }
  /* the card rides along while the form scrolls; the rule's line waits at the bottom, beside the send */
  .lj-side { align-self: stretch; display: flex; flex-direction: column; padding-top: 2.75rem; }
  .lj-track { flex: 1; }
  .lj-sticky { position: sticky; top: calc(var(--head-h) + 1.5rem); }
  /* a window too short for the whole column (lawyer-join.js sets is-tall): it scrolls inside itself, and the line that
     just changed is brought into view, so nothing the lawyer types is ever out of sight or cut off */
  .lj-sticky.is-tall {
    --fade-top: 0px; --fade-end: 40px;
    max-height: calc(100vh - var(--head-h) - 2.5rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-inline-end: 6px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-end)), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-end)), transparent 100%);
  }
  /* the edge that has more behind it fades, so the column reads as one that scrolls, never as a cut line */
  .lj-sticky.is-tall.is-down { --fade-top: 28px; }
  .lj-sticky.is-tall.is-end { --fade-end: 0px; }
  .lj-sticky:focus { outline: none; }
  .lj-side .lj-cap-rule { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
  .lj-review, .lj-narrow { display: none; }
}
@media (max-width: 959px) {
  /* phone: the card alone, so "מי אתם" and the name field still fit the first screen; the full look comes before the send */
  .lj-side .lj-pv-more, .lj-side .lj-cap-rule, .lj-side .lj-cap-top, .lj-wide { display: none; }
}
/* a laptop's short window (1366x768): the same column, set a little tighter, so every detail still fits beside the form
   (reader test 10.11.2026: at 768px the details did not show) */
@media (min-width: 960px) and (max-height: 860px) {
  .lj-side .lj-preview { max-width: 22rem; }
  .lj-side .lj-preview .lwp-tags { margin-top: .75rem; }
  .lj-side .lj-pv-where, .lj-side .lj-pv-text { margin-top: .5rem; }
  .lj-side .lj-pv-text { font-size: 16px; line-height: 1.55; }
  .lj-side .lj-pv-facts { margin-top: .6rem; }
  .lj-side .lj-pv-facts > div { padding-block: .3rem; }
  .lj-side .lj-preview .stamp { margin-top: .6rem; }
  .lj-side .lj-cap-top { margin-top: .5rem; }
}

/* ---------- the card preview (the card itself is the lawyer page's .lwp-card) ---------- */
.lj-side .lj-preview { max-width: 30rem; margin-inline: auto; }
.lj-preview .lwp-card { width: 100%; }
.lj-preview .lwp-front { container-type: inline-size; }
.lj-preview .lwp-card-name { font-size: clamp(24px, 7.2cqi, 32px); overflow-wrap: anywhere; }
.lj-preview .lwp-card-lines bdi { unicode-bidi: isolate; }
.lj-preview .is-ph { opacity: .5; }
.lj-preview .lwp-tags { margin-top: 1.1rem; }
.lj-preview .lwp-tags li.is-ph { opacity: 1; border: 1px dashed var(--line-strong); background: none; color: var(--muted); }
.lj-pv-where { margin-top: .6rem; color: var(--muted); font-size: 16px; line-height: 1.55; }
.lj-pv-text { margin-top: .9rem; color: var(--body); font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; } /* the whole text, as typed (the lawyer page shows it whole too) */
.lj-pv-facts { display: grid; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.lj-pv-facts:not(:has(> div:not([hidden]))) { display: none; }
.lj-pv-facts > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; padding-block: .55rem; border-bottom: 1px solid var(--line); }
.lj-pv-facts dt { color: var(--muted); font: 500 16px/1.45 var(--f-body); }
.lj-pv-facts dd { margin: 0; color: var(--ink); font: 400 17px/1.45 var(--f-body); overflow-wrap: anywhere; }
.lj-preview .stamp { margin-top: 1rem; }
.stamp.lj-pending { color: var(--muted); border-style: dashed; transform: none; white-space: normal; }
.lj-cap { margin-top: .9rem; color: var(--muted); font-size: 16px; line-height: 1.6; }

/* ---------- the form: the one long box goes; groups with hairlines, more air above a heading than under it ---------- */
.join-form.lj-form { padding: 0; border: 0; background: none; }
.lj-form .field > label, .lj-form legend { color: var(--ink); font: 600 18px/1.35 var(--f-body); }
.lj-form .hint { font-size: 16px; }
.lj-form input[type="text"], .lj-form input[type="tel"], .lj-form input[type="email"], .lj-form input[type="url"], .lj-form textarea {
  width: 100%; min-height: 52px; padding: .6rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: #fff; color: var(--ink); font: 400 18px/1.4 var(--f-body);
  transition: border-color .15s var(--ease-out);
}
.lj-form textarea { min-height: 8.5rem; line-height: 1.6; resize: vertical; }
.lj-form input::placeholder, .lj-form textarea::placeholder { color: var(--muted); }
@media (hover: hover) { .lj-form input:hover, .lj-form textarea:hover { border-color: var(--ink); } }
.lj-form input:focus-visible, .lj-form textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.lj-form input[aria-invalid="true"], .lj-form textarea[aria-invalid="true"] { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.lj-form input[name="license"], .lj-form input[name="year"] { font-variant-numeric: tabular-nums; }

.lj-h { color: var(--ink); font: 500 clamp(23px, 1.1rem + .5vw, 26px)/1.3 var(--f-display); }
.lj-opt { color: var(--muted); font: 400 18px/1.3 var(--f-body); white-space: nowrap; }
.lj-lead { margin-top: .35rem; color: var(--muted); font-size: 17px; line-height: 1.55; }
.lj-form > .lj-group + .lj-group { margin-top: clamp(2.25rem, 4vw, 3rem); padding-top: clamp(1.75rem, 3vw, 2.25rem); border-top: 1px solid var(--line); }
.lj-form > .lj-group > .lj-h, .lj-form > fieldset.lj-group > legend { margin-bottom: .15rem; }
.lj-form .lj-group .row, .lj-form .lj-group > .field { margin-top: 1.1rem; }
.lj-form fieldset.lj-group { padding-top: clamp(1.75rem, 3vw, 2.25rem); }
.lj-form fieldset.lj-group > legend { float: inline-start; width: 100%; padding: 0; }
.lj-form fieldset.lj-group > legend + * { clear: both; }
.lj-form .field-err { margin-top: .4rem; font-weight: 500; }
.lj-optional .field > label, .lj-optional .lj-gender-l { color: var(--body); font-weight: 500; }

/* the six fields as large toggles (checkboxes underneath: the same name="fields[]" values) */
.lj-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; margin-top: .9rem; }
@media (min-width: 680px) { .lj-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lj-chip { position: relative; display: flex; }
.lj-chip input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lj-chip-in {
  flex: 1; display: flex; align-items: center; gap: .7rem; min-height: 60px; padding: .7rem .9rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff;
  color: var(--ink); font: 500 18px/1.3 var(--f-body);
  transition: background-color .14s var(--ease-out), border-color .14s var(--ease-out), transform .14s var(--ease-out);
}
.lj-box {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px;
  border: 1.5px solid var(--ink); border-radius: var(--r); background: #fff; color: var(--hl);
  transition: background-color .14s var(--ease-out);
}
.lj-box .i { width: 16px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .14s var(--ease-out), transform .18s var(--ease-out); }
.lj-chip input:checked + .lj-chip-in { background: var(--hl); border-color: var(--hl-edge); font-weight: 600; }
.lj-chip input:checked + .lj-chip-in .lj-box { background: var(--ink); }
.lj-chip input:checked + .lj-chip-in .lj-box .i { opacity: 1; transform: none; }
.lj-chip input:focus-visible + .lj-chip-in { outline: 3px solid var(--ink); outline-offset: 2px; }
.lj-chip input:active + .lj-chip-in { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .lj-chip input:hover + .lj-chip-in { border-color: var(--ink); } }
.lj-chips.is-bad .lj-chip-in { border-color: var(--warn); }

/* "בכרטיס ייכתב": the site's own two-way toggle (.seg), beside the name, as tall as the name field */
.lj-gender { display: grid; gap: .35rem; align-content: start; }
.lj-gender-l { color: var(--ink); font: 600 18px/1.35 var(--f-body); }
.lj-gender .seg { margin-top: 0; grid-template-columns: repeat(2, max-content); }
.lj-gender .seg span { min-height: 52px; padding-inline: 1.1rem; }

/* the text box: its limit, a live count, and a word when a paste was cut (lessons-log 29.10.2026) */
.lj-nw { white-space: nowrap; } /* "כלל 3(ב)(14)" stays on one line (short: checked at 360 and 390) */
.lj-count { margin-top: .35rem; color: var(--muted); font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.lj-count.is-zero { color: var(--warn); font-weight: 600; }

/* the phone's last look before sending */
.lj-review { margin-top: clamp(2.25rem, 4vw, 3rem); padding-top: 1.75rem; border-top: 1px solid var(--line); }
.lj-review > .lj-h { margin-bottom: 1rem; }

/* the privacy notice (Privacy Protection Law s.11): the full text, readable */
.lj-privacy { margin-bottom: 1.5rem; padding: 1.15rem 1.35rem 1.25rem; border-radius: var(--r); background: var(--tint); color: var(--body); font-size: 17px; line-height: 1.7; }
.lj-privacy h3 { margin-bottom: .45rem; color: var(--ink); font: 500 20px/1.3 var(--f-display); }
.lj-privacy p { max-width: 62ch; }
.lj-privacy p + p { margin-top: .65rem; }

/* the consent and the send */
.lj-form label.lj-agree { display: flex; gap: .8rem; align-items: flex-start; color: var(--ink); font: 500 18px/1.5 var(--f-body); cursor: pointer; }
.lj-agree input { flex: none; width: 24px; height: 24px; margin: .12em 0 0; accent-color: var(--ink); cursor: pointer; }
.lj-finish .field-err { margin-inline-start: calc(24px + .8rem); }
.lj-send { display: grid; gap: 1rem; margin-top: 1.5rem; align-items: center; }
@media (min-width: 600px) { .lj-send { grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; } }
.lj-send .btn { min-height: 56px; padding-inline: 2rem; font-size: 19px; }
@media (max-width: 599px) { .lj-send .btn { width: 100%; } }
.lj-next { color: var(--body); font-size: 17px; line-height: 1.6; }

/* the messages: the server's words; the list at the top links to the fields and takes the focus */
.lawyers-join .join-ok { font-size: 18px; }
.lawyers-join .join-err { border-width: 2px; }
.lawyers-join .join-err:focus { outline: none; } /* focused by the script so a screen reader reads it; the 2px frame marks it */
.lawyers-join .join-err > p { font-weight: 600; }
.lawyers-join .join-err a { color: var(--warn); font-weight: 600; }

/* "תעריפים ותאריכים לעורכי דין": three full-width rows (no third item left alone, no row of three feature tiles); the
   icon is drawn in a line, so no yellow square competes with the yellow send above it */
.lj-numbers { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.lj-numbers .tool-cards { grid-template-columns: 1fr; max-width: 46rem; }
.lj-numbers .tool-ic { background: none; border: 1px solid var(--line-strong); }

@media (prefers-reduced-motion: reduce) {
  .lj-chip-in, .lj-box, .lj-box .i { transition: none; }
}
