/* ==========================================================================
   /calculator/price-offers/ — price quote generator, restored 2026-10-11.
   Same page language as the other restored tools (banner creator, AI text
   cleaner, signature generator): the theme tokens, a 6% accent tint for
   surfaces, radii 22/16/10, the contact-form field recipe, the shared .btn and
   the portfolio.css orbit. Mobile First, every rule scoped under .po-page.

   Breakpoints: 768px (two columns inside the form), 1100px (form and preview
   side by side, preview sticky), 1200px (orbit shown).
   ========================================================================== */

.po-page {
  --po-surface: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
  --po-error: #B3261E;
  --po-h1: var(--h1-page);
  --po-h2: clamp(1.375rem, 1.9vw, 1.75rem);
  --po-h3: clamp(1.125rem, 1.6vw, 1.25rem);
  color: var(--color-text-primary);
  padding-block: var(--space-6) var(--space-12);
  overflow-x: clip;
}
.po-container { max-width: 1600px; margin-inline: auto; padding-inline: var(--space-4); }
.po-inner { max-width: 1200px; margin-inline: auto; }
.po-page [hidden] { display: none !important; }

/* ---------- Intro ---------- */
.po-intro { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding-block: var(--space-3) var(--space-6); }
.po-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-secondary); }
.po-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--color-text-secondary); transition: color 180ms ease; }
.po-breadcrumb a:hover { color: var(--color-accent); }
.po-breadcrumb [aria-current] { color: var(--color-text-primary); font-weight: var(--font-bold); }
.po-title { margin: 0; font-size: var(--po-h1); font-weight: var(--font-black); line-height: var(--leading-h1-page); letter-spacing: -0.01em; }
.po-subtitle { margin: 0; font-size: var(--text-body-lg); font-weight: var(--font-bold); line-height: var(--leading-ui); color: var(--color-accent); }
.po-lead { display: flex; flex-direction: column; gap: var(--space-2); max-width: 68ch; }
.po-lead p { margin: 0; font-size: var(--text-body); line-height: var(--leading-lead); color: var(--color-text-secondary); }
.po-lead .po-lead__first { font-weight: var(--font-bold); color: var(--color-text-primary); }
.po-page .portfolio-hero__graphic { display: none; position: absolute; inset: auto; top: 0; left: 20px; width: 180px; height: 180px; }
.po-page .portfolio-hero__orbit { inset: 0; width: auto; height: auto; }

/* ---------- No-JS ---------- */
.po-needs-js { margin: 0 0 var(--space-6); padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--po-surface); font-size: var(--text-md); }
.po-js .po-needs-js { display: none; }
html:not(.po-js) .po-workspace { display: none; }

/* ---------- Workspace ---------- */
.po-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.po-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: var(--space-5); min-width: 0; }
.po-card__title { margin: 0 0 var(--space-2); font-size: var(--po-h3); font-weight: var(--font-bold); line-height: var(--leading-heading); }
.po-hint { margin: 0; font-size: var(--text-xs); line-height: 1.55; color: var(--color-text-secondary); }
.po-hint--alert { font-weight: var(--font-bold); color: var(--po-error); }
.po-hint--alert:empty { display: none; }
.po-form { display: flex; flex-direction: column; gap: var(--space-6); margin-top: var(--space-4); }
.po-fieldset { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.po-fieldset legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--text-ui); font-weight: var(--font-bold); }
.po-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }

/* Fields: same recipe as the other tools */
.po-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.po-field > label { font-size: var(--text-ui); font-weight: var(--font-bold); color: var(--color-text-primary); }
.po-field input[type="text"],
.po-field input[type="number"],
.po-field input[type="tel"],
.po-field input[type="email"],
.po-field input[type="url"],
.po-field input[type="date"],
.po-field textarea { width: 100%; min-height: 3.25rem; padding-inline: 0.875rem; border-radius: var(--radius-button); border: 1px solid var(--color-border); background: var(--color-surface); font: inherit; font-size: var(--text-ui); color: var(--color-text-primary); transition: border-color 160ms ease-out; }
.po-field input[dir="ltr"] { text-align: right; }
.po-field input[dir="ltr"]:not(:placeholder-shown) { text-align: left; }
.po-field input[type="number"] { font-variant-numeric: tabular-nums; }
.po-field textarea { min-height: 0; padding-block: 0.75rem; line-height: 1.6; resize: vertical; }
.po-field input:hover,
.po-field textarea:hover { border-color: var(--color-text-secondary); }
.po-field input:focus-visible,
.po-field textarea:focus-visible { border-color: var(--color-accent); outline: 2px solid color-mix(in srgb, var(--color-accent) 30%, transparent); outline-offset: 1px; }
.po-field input[aria-invalid="true"] { border-color: var(--po-error); }
.po-field--rate { max-width: 14rem; }

/* Checkbox and radios (native, accent-coloured, 44px targets) */
.po-check,
.po-radio { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--text-ui); cursor: pointer; }
.po-check input,
.po-radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent); cursor: pointer; flex: none; }
.po-radios { display: flex; flex-direction: column; gap: var(--space-1); }

/* Template cards */
.po-templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.po-template { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--color-surface); text-align: center; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.po-template:hover { border-color: var(--color-text-secondary); }
.po-template input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.po-template:has(input:checked) { border-color: var(--color-accent); background: var(--po-surface); box-shadow: inset 0 0 0 1px var(--color-accent); }
.po-template:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.po-template__art { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 100%; height: 58px; padding: 0 12px; border-radius: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 6px solid var(--po-primary); }
.po-template__art span { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--color-text-primary) 18%, transparent); }
.po-template__art span:nth-child(1) { width: 55%; background: var(--po-primary); }
.po-template__art span:nth-child(2) { width: 80%; }
.po-template__art span:nth-child(3) { width: 40%; background: var(--po-secondary); }
.po-template__name { font-size: var(--text-sm); font-weight: var(--font-bold); }
.po-template__desc { font-size: var(--text-xs); line-height: 1.4; color: var(--color-text-secondary); }

/* Service rows */
.po-services { display: flex; flex-direction: column; gap: var(--space-4); }
.po-service { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--po-surface); }
.po-service .po-field--name { grid-column: 1 / -1; }
.po-service__remove { grid-column: 1 / -1; min-height: 44px; border: 1px solid var(--color-border); border-radius: var(--radius-button); background: var(--color-surface); font: inherit; font-size: var(--text-sm); font-weight: var(--font-bold); color: var(--po-error); cursor: pointer; transition: background-color 160ms ease; }
.po-service__remove:hover { background: color-mix(in srgb, var(--po-error) 8%, var(--color-surface)); }
.po-service__remove:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.po-btn { width: 100%; height: auto; min-height: 54px; padding-block: 12px; white-space: normal; text-align: center; }

/* ---------- Preview ---------- */
.po-preview { display: flex; flex-direction: column; gap: var(--space-4); }
.po-preview .po-card__title { margin-bottom: 0; }
.po-sheet-wrap { padding: var(--space-3); border-radius: var(--radius-stat); background: var(--po-surface); border: 1px solid var(--color-border); }
.po-sheet { --po-primary: #2878b5; --po-secondary: #2c3e50; padding: var(--space-4); border-radius: 6px; background: #ffffff; color: #222222; box-shadow: 0 1px 4px rgba(17, 17, 17, .12); font-size: var(--text-sm); line-height: 1.6; }
.po-sheet__head { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding-bottom: var(--space-3); margin-bottom: var(--space-4); border-bottom: 2px solid var(--po-primary); text-align: center; }
.po-sheet__logo { max-width: 120px; max-height: 70px; object-fit: contain; }
.po-sheet__title { margin: 0; font-size: var(--text-body-lg); font-weight: var(--font-black); color: var(--po-primary); }
.po-sheet__parties { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.po-sheet__party h4 { margin: 0 0 var(--space-1); font-size: var(--text-sm); font-weight: var(--font-bold); color: var(--po-primary); }
.po-sheet__line { margin: 0; overflow-wrap: anywhere; }
.po-sheet__line strong { font-weight: var(--font-bold); }
.is-placeholder { color: #6b6b6b; font-style: italic; }
.po-sheet__table-wrap { overflow-x: auto; }
.po-sheet__table { width: 100%; border-collapse: collapse; margin-block: var(--space-2); font-size: var(--text-xs); }
.po-sheet__table th { padding: 8px 6px; background: var(--po-primary); color: #ffffff; border: 1px solid #dddddd; text-align: center; font-weight: var(--font-bold); }
.po-sheet__table td { padding: 8px 6px; border: 1px solid #dddddd; text-align: center; overflow-wrap: anywhere; }
.po-sheet__table td:nth-child(n+3) { white-space: nowrap; } /* an amount never breaks between the number and the shekel sign */
.po-sheet__summary { display: grid; gap: 2px; margin: var(--space-2) 0 0; padding: 0; }
.po-sheet__sum-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 4px 0; border-bottom: 1px solid #eeeeee; font-variant-numeric: tabular-nums; }
.po-sheet__sum-row dt, .po-sheet__sum-row dd { margin: 0; }
.po-sheet__total { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: var(--space-3); padding: var(--space-3); background: var(--po-primary); color: #ffffff; border-bottom: 4px solid var(--po-secondary); text-align: center; }
.po-sheet__total-value { font-size: var(--text-body-lg); font-weight: var(--font-black); font-variant-numeric: tabular-nums; }
.po-sheet__total-note { font-size: var(--text-xs); }
.po-sheet__notes { margin-top: var(--space-3); padding: var(--space-3); background: #f5f5f5; border-inline-start: 4px solid var(--po-secondary); }
.po-sheet__notes h4 { margin: 0 0 var(--space-1); font-size: var(--text-sm); font-weight: var(--font-bold); }
.po-sheet__notes-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.po-sheet__credit { margin: var(--space-4) 0 0; padding-top: var(--space-3); border-top: 1px solid #dddddd; text-align: center; font-size: var(--text-xs); color: #595959; }

.po-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.po-errors { padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--po-error) 35%, var(--color-border)); border-radius: var(--radius-stat); background: color-mix(in srgb, var(--po-error) 6%, var(--color-surface)); }
.po-errors__title { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--font-bold); color: var(--po-error); }
.po-errors__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.po-errors__link { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); text-align: start; color: var(--color-text-primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.po-errors__link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
.po-status { margin: 0; min-height: 1.5em; font-size: var(--text-sm); font-weight: var(--font-bold); line-height: 1.5; color: var(--color-accent); }
.po-status.is-error { color: var(--po-error); }

/* ---------- Questions ---------- */
.po-faq { margin-top: var(--space-10); }
.po-section-title { margin: 0 0 var(--space-4); font-size: var(--po-h2); font-weight: var(--font-bold); line-height: var(--leading-heading); }
.po-faq__list { display: grid; gap: var(--space-3); }
.po-faq__item { padding: var(--space-4) var(--space-5); border-radius: var(--radius-stat); background: var(--po-surface); }
.po-faq__q { margin: 0 0 var(--space-2); font-size: var(--text-ui); font-weight: var(--font-bold); line-height: var(--leading-heading); }
.po-faq__a { margin: 0 0 var(--space-2); font-size: var(--text-md); line-height: var(--leading-ui); color: var(--color-text-secondary); }
.po-faq__a:last-child { margin-bottom: 0; }

/* ---------- Tablet, >=768px ---------- */
@media (min-width: 768px) {
  .po-page { padding-block: var(--space-8) var(--space-13); }
  .po-intro { padding-block: var(--space-5) var(--space-6); }
  .po-card { padding: var(--space-7); }
  .po-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .po-service { grid-template-columns: minmax(0, 2fr) minmax(0, 0.8fr) minmax(0, 1fr) auto; align-items: end; }
  .po-service .po-field--name { grid-column: auto; }
  .po-service__remove { grid-column: auto; padding-inline: var(--space-4); }
  .po-btn { width: auto; padding-inline: var(--space-6); }
  .po-actions { flex-direction: row; }
  .po-actions .po-btn { flex: 1 1 0; }
  .po-sheet { padding: var(--space-6); }
  .po-sheet__parties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .po-faq__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Form and preview side by side, >=1100px ---------- */
@media (min-width: 1100px) {
  .po-workspace { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  /* A long quote makes the card taller than the screen: it then scrolls inside itself, so the buttons stay reachable. */
  .po-preview { position: sticky; top: calc(var(--header-h-desktop) + var(--space-4)); max-height: calc(100vh - var(--header-h-desktop) - var(--space-8)); overflow-y: auto; }
}

@media (min-width: 1200px) {
  .po-page .portfolio-hero__graphic { display: block; }
  .po-title, .po-lead { max-width: min(68ch, calc(100% - 220px)); }
}

@media (max-width: 767px) {
  .po-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .po-template, .po-field input, .po-field textarea, .po-service__remove, .po-breadcrumb a { transition: none; }
}
