/* ============================================================================
 * b4-special.css — page CSS of the "special" group: the public pages (registration forms, public
 * surveys and their thanks pages) and the screen chrome of the print documents.
 *
 * Two independent parts:
 *   1. PUBLIC PAGES  (body.pub)  — loaded AFTER /school/static/ds/app.css; uses its tokens/classes.
 *   2. PRINT PREVIEW (html.pv)   — loaded WITHOUT app.css and with media="screen", so nothing here
 *      (and nothing of the design system) can reach the printed sheet. It therefore carries its own
 *      copy of the few tokens it needs, scoped to html.pv — keep them equal to app.css §1.
 * RTL first: logical properties only.
 * ========================================================================== */

/* ============================================================================ 1. public pages */
body.pub { min-height: 100vh; height: auto; }
.pub-brand {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
.pub-brand img { max-height: 56px; max-width: 40%; object-fit: contain; }
.pub-brand-name { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.25; }
/* the staff-only quick link an app-wide helper appends to every /school page has no place on a public page */
body.pub > a[data-school-ac-quick] { display: none !important; }
.pub-wrap { max-width: 680px; margin: 0 auto; padding: 22px 16px 48px; }
.pub-wrap--narrow { max-width: 560px; }
.pub-wrap .card { margin-bottom: 16px; }
.pub-head { text-align: center; }
.pub-head h1, .pub-head h2 { font-size: var(--fs-xl); line-height: 1.25; }
.pub-head p { color: var(--text-2); line-height: 1.6; margin-top: 6px; }
.pub-note { font-size: var(--fs-sm); line-height: 1.7; color: var(--text-2); box-shadow: none; background: var(--surface-soft); border-color: var(--hair); }
.pub-note strong { display: block; color: var(--text); margin-bottom: 2px; }
.pub-note p + p { margin-top: 6px; }
.pub-foot { text-align: center; color: var(--text-3); font-size: var(--fs-sm); margin-top: 12px; }

/* form primitives the public forms were written with (kept: the form scripts walk this markup) */
.pub-wrap label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.pub-wrap label.required::after { content: " *"; color: var(--bad); }
.pub-wrap .req-star { color: var(--bad); }
.pub-wrap .input-field { font-size: 16px; }          /* 16px: no zoom-on-focus on a phone */
.pub-wrap .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.pub-wrap .hint { font-size: 12.5px; color: var(--text-3); margin-top: -6px; margin-bottom: 12px; }
.pub-wrap .disclaimer {
  background: var(--warn-bg); color: var(--text); border-radius: var(--r-in);
  padding: 12px 14px; font-size: var(--fs-sm); line-height: 1.6; margin-bottom: 10px;
}
.pub-wrap .check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.pub-wrap .check-row input[type=checkbox] { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.pub-wrap .check-row label, .pub-wrap label.opt { font-weight: 400; color: var(--text); font-size: var(--fs-base); margin: 0; }
.pub-wrap label.opt { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.pub-wrap label.opt input { width: 20px; height: 20px; flex: none; margin: 0; }
.pub-wrap .errors, .pub-wrap .reg-notice {
  border-radius: var(--r-in); padding: 12px 16px; margin-bottom: 16px; font-size: var(--fs-sm); line-height: 1.6;
}
.pub-wrap .errors { background: var(--bad-bg); color: var(--bad); }
.pub-wrap .errors ul { margin-inline-start: 18px; }
.pub-wrap .reg-notice { background: var(--accent-soft); color: var(--accent-text); }
.pub-wrap .reg-notice-clear, .pub-wrap .errors button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; min-height: 32px;
  background: var(--card); color: inherit; border: 1px solid currentColor; border-radius: var(--r-sm);
  padding: 3px 12px; margin-inline-start: 8px;
}
.pub-wrap input[type=tel], .pub-wrap input[name=father_id], .pub-wrap input[name=mother_id],
.pub-wrap input[name=student_id_number] { direction: ltr; text-align: right; }
.pub-submit { width: 100%; min-height: 48px; font-size: 16px; }
@media (max-width: 540px) {
  .pub-wrap .row2 { grid-template-columns: 1fr; }
  .pub-brand img { max-height: 44px; }
  .pub-brand-name { font-size: 15.5px; }
}

/* survey: one block per child, question groups */
.pub-wrap .child-block {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.pub-wrap .child-block h3 { font-size: 17px; margin-bottom: 12px; }
.pub-wrap .remove-child {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--bad-bg); color: var(--bad); font-size: 18px; line-height: 1; cursor: pointer;
}
.pub-wrap .q-block { margin-bottom: 20px; }
.pub-wrap .q-block:last-child { margin-bottom: 0; }
.pub-wrap .q-title { display: block; font-weight: 700; font-size: var(--fs-base); color: var(--text); margin-bottom: 8px; }
.pub-wrap .q-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; font-weight: 400; font-size: var(--fs-base); color: var(--text); cursor: pointer; }
.pub-wrap .q-opt input { width: 20px; height: 20px; flex: none; margin: 0; }
.pub-add-row { margin-bottom: 16px; }

/* a centred message page (thanks / closed) */
body.pub-center { display: flex; align-items: center; justify-content: center; padding: 20px; }
.pub-msg { max-width: 460px; width: 100%; text-align: center; padding: 36px 28px; }
.pub-msg h1 { font-size: var(--fs-xl); margin-bottom: 10px; }
.pub-msg p { color: var(--text-2); line-height: 1.7; margin-bottom: 8px; }
.pub-msg .pub-mark {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; line-height: 1; background: var(--good-bg); color: var(--good);
}
.pub-msg .pub-mark--bad { background: var(--bad-bg); color: var(--bad); }
.pub-msg .ref { display: inline-block; background: var(--accent-soft); color: var(--accent-text); border-radius: var(--r-sm); padding: 8px 14px; font-weight: 700; margin: 10px 0; }
.pub-msg .name { color: var(--text); font-weight: 700; }
.pub-msg .pub-foot { margin-top: 18px; }

/* ============================================================================ 2. print preview
 * A print document on screen: the warm page, a quiet toolbar, and the document on a white sheet,
 * drawn exactly as it prints. This part must stay inside `html.pv` and is linked media="screen". */
/* The toolbar's font, under its own family name: the sheet names "Assistant" itself, and must be drawn on
 * screen with the same font it prints with — so that name is deliberately not defined here. */
@font-face { font-family: "PV Assistant"; font-weight: 200 800; font-display: swap;
  src: url("../../fonts/assistant-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "PV Assistant"; font-weight: 200 800; font-display: swap;
  src: url("../../fonts/assistant-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@media screen {
  html.pv {
    --pv-accent: var(--accent, #173f78);
    --pv-accent-deep: color-mix(in srgb, var(--pv-accent) 78%, #05101f);
    --pv-accent-line: color-mix(in srgb, var(--pv-accent) 26%, #fffdf8);
    --pv-accent-softer: color-mix(in srgb, var(--pv-accent) 5%, #fffdf8);
    --pv-page: #f7f2e8; --pv-card: #fffdf8; --pv-text: #162a4d; --pv-text-2: #4d5b73; --pv-text-3: #667186;
    --pv-border: #eadfc8; --pv-bad: #ad2a36; --pv-bad-bg: #fae2e4;
    --pv-font: "PV Assistant", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans Hebrew", sans-serif;
    background: var(--pv-page);
  }
  html.pv body { background: var(--pv-page); }
  html.pv .pv-bar {
    position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 0; padding: 10px 16px; background: rgba(255, 253, 248, .96); border-bottom: 1px solid var(--pv-border);
    font-family: var(--pv-font); font-size: 14px; line-height: 1.3; color: var(--pv-text-2);
  }
  html.pv .pv-bar form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
  html.pv .pv-btn, html.pv .pv-bar select {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
    font-family: var(--pv-font); font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    padding: 8px 14px; border-radius: 12px; border: 1px solid var(--pv-border); background: var(--pv-card); color: var(--pv-text-2);
  }
  html.pv .pv-btn:hover, html.pv .pv-bar select:hover { border-color: var(--pv-accent-line); color: var(--pv-text); }
  html.pv .pv-btn:focus-visible, html.pv .pv-bar select:focus-visible { outline: 3px solid color-mix(in srgb, var(--pv-accent) 45%, transparent); outline-offset: 2px; }
  html.pv .pv-btn--primary, html.pv .pv-btn--primary:hover { background: var(--pv-accent); border-color: transparent; color: #fff; font-weight: 700; }
  html.pv .pv-btn--primary:hover { background: var(--pv-accent-deep); }
  html.pv .pv-btn--soft { background: color-mix(in srgb, var(--pv-accent) 9%, #fffdf8); border-color: transparent; color: color-mix(in srgb, var(--pv-accent) 92%, #000); font-weight: 700; }
  html.pv .pv-btn.on { background: var(--pv-accent-softer); border-color: var(--pv-accent-line); color: var(--pv-text); font-weight: 700; }
  html.pv .pv-hint { color: var(--pv-text-3); font-size: 13px; flex: 1 1 240px; }
  html.pv .pv-spacer { flex: 1 1 auto; }
  /* the document on a sheet (pages that have no sheet of their own) */
  html.pv .pv-sheet {
    max-width: 1100px; margin: 18px auto 40px; padding: 28px 32px; background: #fff; color: #222;
    border: 1px solid var(--pv-border); border-radius: 6px; box-shadow: 0 1px 2px rgba(74, 56, 22, .05), 0 12px 28px -16px rgba(74, 56, 22, .22);
    overflow-x: auto;
  }
  /* a side panel next to the sheet (e.g. "add an activity") */
  html.pv .pv-panel {
    background: var(--pv-card); border: 1px solid var(--pv-border); border-radius: 20px; color: var(--pv-text);
    box-shadow: 0 1px 2px rgba(74, 56, 22, .05), 0 12px 28px -16px rgba(74, 56, 22, .22); font-family: var(--pv-font);
  }
  html.pv .pv-panel input, html.pv .pv-panel select {
    font-family: var(--pv-font); font-size: 14px; min-height: 40px; padding: 8px 12px; border-radius: 12px;
    border: 1px solid var(--pv-border); background: #fffefb; color: var(--pv-text);
  }
  html.pv .pv-panel input:focus-visible, html.pv .pv-panel select:focus-visible { outline: 0; border-color: var(--pv-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pv-accent) 16%, transparent); }
  @media (max-width: 820px) {
    html.pv .pv-sheet { margin: 10px 8px 28px; padding: 16px 14px; }
    html.pv .pv-bar { padding: 8px 10px; }
  }
}
