/* signup.css: הזמנה להרשמה לרשימת התפוצה של סטודיו חוט מחשבה (גרסה 1, 18.11.2026).
   נטען בשורה אחת בכל עמוד מתנה, ליד signup.js. כל המחלקות מתחילות ב-su- כדי לא להתנגש בעיצוב של העמוד.

   הצבעים והגופנים נלקחים מהעמוד המארח. עמוד יכול להגדיר אותם בעצמו, למשל:
     :root{ --su-accent: var(--ochre); --su-focus: var(--focus); }
   ומה שלא הוגדר, signup.js קורא מהעמוד עצמו (רקע, צבע טקסט, גופן הכותרת וגופן הגוף),
   ואם גם זה לא עובד, נשארים צבעי הסטודיו שכאן:
     --su-paper   רקע הנייר            #E7DCC6
     --su-ink     דיו לכל טקסט         #231F19
     --su-accent  החוט, קישוט בלבד     #9C4132
     --su-alert   טקסט שגיאה           #9C4132 (בעמוד כהה signup.js מחליף לגוון בהיר)
     --su-focus   טבעת פוקוס           כמו הדיו
     --su-display גופן הכותרת          Frank Ruhl Libre
     --su-body    גופן הטקסט           Assistant
*/

.su-box, .su-toast, .su-fb{
  --_paper: var(--su-paper, #E7DCC6);
  --_ink: var(--su-ink, #231F19);
  --_accent: var(--su-accent, #9C4132);
  --_alert: var(--su-alert, #9C4132);
  --_focus: var(--su-focus, var(--su-ink, #231F19));
  --_display: var(--su-display, "Frank Ruhl Libre", "David Libre", Georgia, serif);
  --_body: var(--su-body, "Assistant", "Segoe UI", Arial, sans-serif);
  /* tints made from the two host colours, so they follow any page, light or dark */
  --_tint: color-mix(in srgb, var(--_accent) 9%, color-mix(in srgb, var(--_ink) 3%, var(--_paper)));
  --_line: color-mix(in srgb, var(--_ink) 34%, var(--_paper));
  --_mute: color-mix(in srgb, var(--_ink) 80%, var(--_paper));
  --_ease-out: cubic-bezier(.23, 1, .32, 1);
  --_ease-io: cubic-bezier(.77, 0, .175, 1);
  box-sizing: border-box;
  font-family: var(--_body);
  color: var(--_ink);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
.su-box *, .su-toast *, .su-fb *{ box-sizing: border-box; }
.su-box :is(p, h2, h3, form, fieldset), .su-toast :is(p, h2){ margin: 0; }

.su-sr{ position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the signature: a running stitch across the top, tied off in a knot at the start.
   On signup the gaps close into one continuous thread. */
.su-stitch{
  position: relative;
  height: 14px;
  margin-inline-start: 25px;
}
.su-stitch::before, .su-stitch::after{
  content: ""; position: absolute; inset-inline: 0; top: 6px; height: 3px; border-radius: 2px;
}
.su-stitch::before{
  background: repeating-linear-gradient(to left, var(--_accent) 0 12px, transparent 12px 19px);
}
.su-stitch::after{
  background: var(--_accent);
  transform: scaleX(0); transform-origin: 100% 50%;
}
.su-knot{
  position: absolute; inset-inline-start: -27px; top: -9px;
  width: 34px; height: 34px; color: var(--_accent);
  transform-origin: 47% 43%;
  overflow: visible;
}
.su-closed .su-stitch::after{ transform: scaleX(1); }
.su-sewing .su-stitch::after{ transition: transform .55s var(--_ease-out); }
.su-tug .su-knot{ animation: su-tug .62s var(--_ease-out); }
@keyframes su-tug{ 0%{ transform: rotate(0) } 28%{ transform: rotate(-16deg) } 58%{ transform: rotate(9deg) } 82%{ transform: rotate(-3deg) } 100%{ transform: rotate(0) } }

/* ---------- the box under the download block */
.su-box{
  container: su / inline-size;
  width: 100%;
  max-width: 34rem;
  margin-block: clamp(28px, 4vh, 40px) 0;
  padding: 10px clamp(18px, 4cqi, 26px) 22px;
  background: var(--_tint);
  border-radius: 4px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.su-box .su-stitch{ margin-inline-end: -4px; margin-bottom: 12px; }

.su-title{
  font-family: var(--_display);
  font-weight: 400;
  font-size: clamp(1.45rem, 6cqi, 1.75rem);
  line-height: 1.2;
  color: var(--_ink);
  text-wrap: balance;
}
.su-box .su-lede{ margin-top: 6px; color: var(--_mute); max-width: 30rem; text-wrap: pretty; }

/* the note that opens inside the box right after a download click (the inline nudge) */
.su-hello{ display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--_ease-io); }
.su-hello > div{ overflow: hidden; min-height: 0; }
.su-hello.su-open{ grid-template-rows: 1fr; }
.su-hello-in{
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px; padding: 10px 12px 10px 6px;
  background: var(--_paper); border-radius: 3px;
  font-size: 1rem; line-height: 1.5;
}
.su-hello-in p{ flex: 1; padding-top: 3px; }
.su-hello-in .su-x{ min-height: 40px; padding: 0 8px; margin-top: -6px; }
.su-hello-in .su-x svg{ width: 18px; height: 18px; }
.su-hello .su-check{ flex: none; width: 20px; height: 20px; margin-top: 5px; }

.su-box .su-form{ margin-top: 16px; display: grid; gap: 14px; }
.su-field{ display: grid; gap: 6px; }
.su-label{ font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.su-input{
  width: 100%; min-height: 48px;
  padding: 10px 14px;
  font: inherit; font-family: var(--_body); font-size: 1.08rem; line-height: 1.3;
  color: var(--_ink);
  background: var(--_paper);
  border: 1.5px solid var(--_line);
  border-radius: 4px;
  text-align: right;
  caret-color: var(--_ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.su-input::placeholder{ color: var(--_mute); opacity: .75; }
.su-input:hover{ border-color: color-mix(in srgb, var(--_ink) 55%, var(--_paper)); }
.su-input:focus{ outline: none; }
.su-input:focus-visible, .su-input:focus{ border-color: var(--_ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--_focus) 35%, transparent); }
.su-input[aria-invalid="true"]{ border-color: var(--_alert); border-width: 2px; }

.su-consent{
  display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; align-items: start;
  font-size: 1rem; line-height: 1.55;
  cursor: pointer;
}
.su-consent input{
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin: 2px 0 0;
  background: var(--_paper);
  border: 1.5px solid var(--_ink);
  border-radius: 3px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background-color .12s ease;
}
.su-consent input::after{
  content: ""; width: 12px; height: 7px; margin-top: -3px;
  border-left: 2.5px solid var(--_paper); border-bottom: 2.5px solid var(--_paper);   /* physical sides: a tick never mirrors in RTL */
  transform: rotate(-45deg) scale(0); transition: transform .14s var(--_ease-out);
}
.su-consent input:checked{ background: var(--_ink); }
.su-consent input:checked::after{ transform: rotate(-45deg) scale(1); }
.su-consent input:focus-visible{ outline: 3px solid var(--_focus); outline-offset: 2px; }
.su-consent input[aria-invalid="true"]{ border-color: var(--_alert); border-width: 2px; }
.su-consent a{ display: block; width: fit-content; margin-top: 4px; color: var(--_ink); text-decoration: underline; text-decoration-color: var(--_accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.su-consent a:focus-visible{ outline: 2px solid var(--_focus); outline-offset: 2px; border-radius: 2px; }

.su-err{ display: flex; gap: 6px; align-items: flex-start; color: var(--_alert); font-size: 1rem; font-weight: 500; line-height: 1.45; }
.su-err:empty{ display: none; }
.su-err svg{ flex: none; width: 17px; height: 17px; margin-top: 3px; }
.su-err .su-ltr{ display: block; font-weight: 400; color: var(--_mute); direction: ltr; text-align: right; }
.su-consent + .su-err{ margin-inline-start: 36px; margin-top: 4px; }

.su-actions{ display: flex; align-items: center; margin-top: 2px; }
@container su (max-width: 22rem){ .su-actions .su-btn{ flex: 1; } }

/* the hidden field for bots: off screen, out of the tab order, silent for screen readers */
.su-trap{ position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.su-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  font: inherit; font-family: var(--_body); font-weight: 700; font-size: 1.08rem; line-height: 1;
  color: var(--_paper); background: var(--_ink);
  border: 2px solid var(--_ink); border-radius: 4px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .12s var(--_ease-out);
}
.su-btn:hover{ background: color-mix(in srgb, var(--_ink) 84%, var(--_paper)); }
.su-btn:active{ transform: scale(.97); }
.su-btn:focus-visible{ outline: 3px solid var(--_focus); outline-offset: 3px; }
.su-btn[aria-busy="true"]{ pointer-events: none; opacity: .8; }
.su-btn.su-quiet{ background: transparent; color: var(--_ink); border-color: transparent; text-decoration: underline; text-decoration-color: var(--_line); text-underline-offset: 4px; padding: 0 10px; font-weight: 500; }
.su-btn.su-quiet:hover{ background: transparent; color: var(--_ink); text-decoration-color: var(--_ink); }

/* when saving did not work: a calm note under the button; the address and the tick stay as they were */
.su-note{
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; background: var(--_paper);
  border: 1.5px solid var(--_alert); border-radius: 4px;
  color: var(--_ink); font-size: 1rem; line-height: 1.5;
}
.su-note svg{ flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--_alert); }

.su-box .su-privacy{ margin-top: 2px; color: var(--_mute); font-size: .95rem; line-height: 1.5; }
/* the one quiet alternative: WhatsApp, below the box's main ask */
.su-box .su-alt{ margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--_ink, currentColor) 22%, transparent); font-size: 1rem; line-height: 1.5; }
.su-box .su-alt a{ color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.su-box .su-alt a:focus-visible{ outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

/* success and "already on the list" */
.su-done{ display: grid; gap: 6px; }
.su-done:focus{ outline: none; }
.su-done-head{ display: flex; gap: 10px; align-items: center; }
.su-done-head svg{ flex: none; width: 28px; height: 28px; color: var(--_ink); }
.su-done-head svg path{ stroke-dasharray: 1; stroke-dashoffset: 0; }
.su-sewing .su-done-head svg path{ stroke-dashoffset: 1; animation: su-draw .34s var(--_ease-out) .45s forwards; }
@keyframes su-draw{ to{ stroke-dashoffset: 0 } }
.su-done .su-addr{ direction: ltr; text-align: right; color: var(--_ink); overflow-wrap: anywhere; }
.su-done p{ color: var(--_mute); }
.su-done .su-btn{ justify-self: start; margin-top: 6px; }

.su-box [hidden], .su-toast [hidden]{ display: none !important; }

/* ---------- the floating nudge, used when the box is out of sight at the moment of download */
.su-toast{
  position: fixed; z-index: 9990;
  inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 32px));
  padding: 6px 18px 16px;
  background: var(--_paper);
  border: 1px solid var(--_line);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(20, 16, 10, .08), 0 14px 32px rgba(20, 16, 10, .18);
  font-size: 1.02rem; line-height: 1.5;
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: 50% 100%;
  transition: transform .28s var(--_ease-out), opacity .22s ease, bottom .2s var(--_ease-out);
}
.su-toast.su-in{ opacity: 1; transform: none; }
.su-toast.su-out{ opacity: 0; transform: translateY(12px) scale(.98); transition-duration: .18s; }
.su-toast .su-stitch{ margin-bottom: 8px; }
.su-toast-head{ display: flex; gap: 8px; align-items: center; font-weight: 700; }
.su-toast-head svg{ flex: none; width: 20px; height: 20px; }
.su-toast .su-toast-q{ margin-top: 2px; }
.su-toast-row{ display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px; }
.su-toast-row .su-btn{ min-height: 44px; font-size: 1.02rem; padding: 0 16px; }

/* ---------- the persistent Facebook link: small, bottom corner, the other side from the nudge */
.su-fb{
  position: fixed; z-index: 9980;
  inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 46px; min-height: 46px; padding: 0 12px;
  justify-content: center;
  background: var(--_paper);
  border: 1px solid var(--_line);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(20, 16, 10, .08), 0 6px 16px rgba(20, 16, 10, .12);
  color: var(--_ink); text-decoration: none;
  font-size: .98rem; font-weight: 700; line-height: 1;
  transition: transform .15s var(--_ease-out), box-shadow .15s ease, opacity .2s ease, bottom .2s var(--_ease-out);
}
.su-fb svg{ width: 22px; height: 22px; flex: none; }
.su-fb .su-fb-txt{ display: none; }
.su-fb:hover{ transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20, 16, 10, .1), 0 10px 22px rgba(20, 16, 10, .16); }
.su-fb:active{ transform: scale(.97); }
.su-fb:focus-visible{ outline: 3px solid var(--_focus); outline-offset: 3px; }
@media (min-width: 768px){
  .su-fb{ padding: 0 16px 0 12px; }
  .su-fb .su-fb-txt{ display: inline; }
}
/* on a phone the nudge spans the width, so the Facebook circle steps aside while it is open */
@media (max-width: 599px){
  html.su-toast-open .su-fb{ opacity: 0; pointer-events: none; transform: translateY(8px); }
}
/* room under the last line of the page so the fixed circle never sits on top of text */
.su-fb-room{ height: 72px; width: 1px; flex: none; }
@media print{ .su-fb, .su-toast, .su-fb-room{ display: none !important; } }

/* the floating download bar of /sticky-dl.js (.sdl.on) also lives at the bottom. While it is shown and the two would
   overlap, signup.js sets --su-lift (the bar's height plus its own bottom gap) and these classes, and the circle
   and the card step up above it. When the bar goes away they settle back. */
html.su-lift-fb .su-fb{ bottom: calc(var(--su-lift, 64px) + 12px); }
html.su-lift-toast .su-toast{ bottom: calc(var(--su-lift, 64px) + 12px); }

/* ---------- reduced motion: every change happens in place, with no travel and no sway */
@media (prefers-reduced-motion: reduce){
  .su-toast{ transform: none !important; transition: opacity .12s linear; }
  .su-hello{ transition: none; }
  .su-tug .su-knot{ animation: none; }
  .su-sewing .su-stitch::after{ transition: none; }
  .su-sewing .su-done-head svg path{ animation: none; stroke-dashoffset: 0; }
  .su-btn, .su-fb, .su-input, .su-consent input, .su-consent input::after{ transition: none; }
  .su-btn:active, .su-fb:active, .su-fb:hover{ transform: none; }
}
