/* מסך הכניסה (9.11.2026). נטען רק ב-login.html, אחרי account.css.
   במחשב (901px ומעלה): הדיו והטיפה. הדיו מכסה את המסך, נשפך למעלה לטיפה תלויה, וממנה נופלת טיפת ליים שנוחתת כנקודה
   בסוף הכותרת. התנועה ב-login-drop.js; כאן הצבעים, הצורות והמצבים (data-phase על ה-body: splash, fold, drip, ready, out).
   בטלפון (עד 900px): כמו בלוח "כניסה" שבקנבס. דיו כהה למעלה עם הלוגו, ודף נייר שעולה עליו עם הטופס. בלי סקריפט, רק CSS. */
.drop, body[data-page="login"] .brand .bline, body[data-page="login"] .on-desk { display: none; }

/* ===== הטלפון: דיו למעלה, דף נייר עולה ===== */
@media (max-width: 900px) {
  body[data-page="login"] {
    --page: #fbfbf8; --surface-1: #ffffff; --surface-2: #f1f1ec;
    --text-primary: #0a0a0a; --text-secondary: #5c5c58; --text-muted: #6f6f6b;
    --border: rgba(10, 10, 10, .14); --line: rgba(10, 10, 10, .1); --accent-text: #4a7a06; --accent-wash: rgba(198, 243, 107, .3);
    --inkh: clamp(170px, 34svh, 300px);
    background: var(--page); color: var(--text-primary);
  }
  body[data-page="login"]::before { display: none; }   /* the old glows of account.css */
  /* while the ink folds the page is exactly one screen, so nothing scrolls under it */
  body[data-page="login"] .auth { position: relative; max-width: none; min-height: 100svh; margin: 0; padding: 0; display: flex; flex-direction: column; animation: m-lock 1.5s step-end; }
  /* the ink: the whole screen at first with the mark in its middle, then it folds up into the top and the paper rises after it.
     The mark rides the fold and rests at the ink's foot */
  body[data-page="login"] .brand { position: relative; flex: none; height: var(--inkh); margin: 0; padding: 0 24px 56px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 10px; overflow: hidden;
    color: #fff; text-decoration: none; background: linear-gradient(160deg, #1c1b19, #0a0a0a 70%); animation: m-ink .9s cubic-bezier(.4, 0, .2, 1) .5s backwards; }
  body[data-page="login"] .brand::before { content: ""; position: absolute; inset: -60px; background: linear-gradient(115deg, transparent 42%, rgba(230, 190, 120, .14) 50%, transparent 58%); filter: blur(30px); pointer-events: none; }
  body[data-page="login"] .brand::after { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 35% at 25% 85%, rgba(198, 243, 107, .16), transparent 70%); pointer-events: none; }
  body[data-page="login"] .brand .mark { position: relative; z-index: 1; color: #fff; font-size: clamp(42px, 13vw, 56px); animation: m-mark .45s ease .05s backwards; }
  body[data-page="login"] .brand .bline { display: block; position: relative; z-index: 1; font-size: 16px; font-weight: 300; color: rgba(255, 255, 255, .72); animation: m-mark .45s ease .15s backwards; }
  /* the paper sheet: above the ink where they overlap, so its round corners show */
  body[data-page="login"] .panel { position: relative; z-index: 1; flex: 1 0 auto; margin-top: -32px; padding: 28px 24px 4px; background: var(--page); border: 0; border-radius: 32px 32px 0 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body[data-page="login"] .panel > section { animation: m-fade .5s ease .95s backwards; }
  body[data-page="login"] .testbar { order: 2; margin: 10px 24px 0; }
  body[data-page="login"] .legal { order: 3; margin: 0; padding: 14px 24px max(18px, env(safe-area-inset-bottom)); background: var(--page); animation: m-fade .5s ease 1.1s backwards; }
  /* the words and the form, in the app's own shapes */
  body[data-page="login"] h1 { font-size: 28px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin: 0 0 6px; }
  body[data-page="login"] h1::after { content: "."; color: var(--accent-text); }
  body[data-page="login"] .lead { color: var(--text-secondary); margin: 0 0 20px; font-size: 14px; }
  body[data-page="login"] .field { margin-bottom: 14px; }
  body[data-page="login"] .field > span, body[data-page="login"] .field .lblrow label { font-weight: 500; font-size: 13px; color: var(--text-secondary); }
  body[data-page="login"] .input { min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: #fff; font-size: 16px; }
  body[data-page="login"] .input.ltr { text-align: left; }
  body[data-page="login"] .pw .input.ltr { padding-left: 66px; padding-right: 14px; }
  body[data-page="login"] .input:focus { border-color: #4a7a06; box-shadow: 0 0 0 4px rgba(198, 243, 107, .35); }
  body[data-page="login"] .row2 { justify-content: flex-end; margin: -6px 0 12px; }
  body[data-page="login"] .row2 .linkbtn { font-size: 13px; font-weight: 500; text-decoration: none; padding: 4px 0; }
  body[data-page="login"] .btn { min-height: 50px; border-radius: 999px; border: 1px solid var(--border); background: #fff; }
  body[data-page="login"] .btn.primary { min-height: 54px; background: #c6f36b; color: #11160a; border-color: transparent; box-shadow: 0 14px 28px -18px rgba(74, 122, 6, .7); }
  body[data-page="login"] .btn.quiet { background: none; border-color: transparent; min-height: 44px; }
  body[data-page="login"] .btn.dark { background: var(--text-primary); color: var(--page); border-color: transparent; }
  body[data-page="login"] .below { margin: 16px 0 0; font-size: 13.5px; }
  body[data-page="login"] .below a { font-weight: 600; text-decoration: none; }
  body[data-page="login"] .msg { border-radius: 14px; }
}
@keyframes m-lock { from { max-height: 100svh; overflow: hidden; } }
@keyframes m-ink { from { height: 100svh; padding-bottom: calc(50svh - 46px); } }
@keyframes m-fade { from { opacity: 0; transform: translateY(14px); } }
@keyframes m-mark { from { opacity: 0; transform: translateY(8px); } }
/* a short phone: everything draws in so the sign-in still fits one screen */
@media (max-width: 900px) and (max-height: 640px) {
  body[data-page="login"] { --inkh: clamp(132px, 26svh, 170px); }
  body[data-page="login"] .brand { padding-bottom: 46px; gap: 6px; }
  body[data-page="login"] .brand .mark { font-size: 40px; }
  body[data-page="login"] .brand .bline { font-size: 14px; }
  body[data-page="login"] .panel { padding-top: 20px; }
  body[data-page="login"] h1 { font-size: 24px; margin-bottom: 2px; }
  body[data-page="login"] .lead { margin-bottom: 12px; font-size: 13.5px; }
  body[data-page="login"] .field { margin-bottom: 9px; }
  body[data-page="login"] .field > span, body[data-page="login"] .field .lblrow { margin-bottom: 4px; }
  body[data-page="login"] .input { min-height: 44px; padding: 8px 14px; }
  body[data-page="login"] .row2 { margin: -4px 0 8px; }
  body[data-page="login"] .btn.primary { min-height: 48px; }
  body[data-page="login"] .below { margin-top: 10px; }
  body[data-page="login"] .legal { padding-top: 8px; padding-bottom: 12px; font-size: 12px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  body[data-page="login"] .auth, body[data-page="login"] .brand, body[data-page="login"] .panel > section, body[data-page="login"] .legal, body[data-page="login"] .brand .mark, body[data-page="login"] .brand .bline { animation: none; }
}

@media (min-width: 901px) {
  body[data-page="login"] .on-desk { display: initial; }
  body[data-page="login"] .on-phone { display: none; }
  body[data-page="login"] {
    --page: #fbfbf8; --surface-1: #ffffff; --surface-2: #f1f1ec; --fbg: #f1f1ec;
    --text-primary: #0a0a0a; --text-secondary: #5c5c58; --text-muted: #6f6f6b;
    --border: rgba(10, 10, 10, .14); --line: rgba(10, 10, 10, .1); --accent-text: #4a7a06; --accent-wash: rgba(198, 243, 107, .3);
    --edge: rgba(255, 255, 255, .16);
    position: relative; min-height: 100svh; overflow-x: hidden; background: var(--page); color: var(--text-primary); transition: background .4s, color .4s;
  }
  body[data-page="login"][data-theme="dark"] {
    color-scheme: dark;
    --page: #0a0a0a; --surface-1: #141414; --surface-2: #1b1b1b; --fbg: #1b1b1b;
    --text-primary: #ffffff; --text-secondary: #b5b5b0; --text-muted: #a3a39e;
    --border: rgba(255, 255, 255, .16); --line: rgba(255, 255, 255, .1); --accent-text: #c6f36b; --accent-wash: rgba(198, 243, 107, .14);
    --bad: #ff7a66; --warn-bg: rgba(245, 185, 58, .12); --warn-ink: #f6d68e; --edge: rgba(255, 255, 255, .3);
  }
  body[data-page="login"]::before { display: none; }   /* the old glows of account.css */

  /* ----- the ink ----- */
  .drop { display: block; position: absolute; top: 0; left: 0; right: 0; height: 100svh; min-height: 480px; z-index: 2; pointer-events: none; overflow: hidden; }
  .drop .ink { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 22px 34px rgba(10, 10, 10, .22)); }
  .drop .droplet { position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #c6f36b; box-shadow: 0 0 0 1px rgba(74, 122, 6, .25), 0 6px 14px -4px rgba(74, 122, 6, .55); opacity: 0; will-change: transform; }
  .drop .ring { position: absolute; left: 0; top: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid #c6f36b; opacity: 0; }
  .drop .ring.go { animation: drop-ring .65s cubic-bezier(.2, .7, .2, 1) forwards; }

  /* ----- the mark: in the middle of the ink at first, then it rides up and rests over the tip ----- */
  body[data-page="login"] .brand { position: absolute; z-index: 3; left: 50%; top: 50svh; margin: 0; transform: translate(-50%, -50%) scale(1.4); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-decoration: none; white-space: nowrap;
    transition: top .9s cubic-bezier(.3, .9, .3, 1), left .9s cubic-bezier(.3, .9, .3, 1), transform .9s cubic-bezier(.3, .9, .3, 1); }
  body[data-page="login"]:not([data-phase="splash"]):not([data-phase="out"]) .brand { left: var(--mx, 50%); top: max(58px, 14.75svh); transform: translate(-50%, -50%) scale(1); }
  body[data-page="login"] .brand .mark { color: #fff; font-size: clamp(36px, 7.4svh, 68px); }
  body[data-page="login"] .brand .bline { display: block; font-size: 15px; font-weight: 300; color: rgba(255, 255, 255, .62); transition: opacity .3s; }
  body[data-page="login"][data-phase="out"] .brand .bline { opacity: 0; }

  /* ----- the page under the drop. Not positioned, so the mark inside it can rise above the ink ----- */
  body[data-page="login"] .auth { max-width: 478px; min-height: 100svh; margin: 0 auto; padding: max(200px, 41svh) 24px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
  body[data-page="login"] .panel { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body[data-page="login"] .legal { margin-top: auto; padding-top: 18px; }
  body[data-page="login"] .testbar { margin-bottom: 14px; }

  /* the heading waits for the drop; the lime dot at its end is where the drop lands */
  body[data-page="login"] h1 { font-size: 44px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; margin: 0 0 8px; opacity: 0; transition: opacity .4s; }
  body[data-page="login"] [data-pane="main"] h1 { font-size: 56px; letter-spacing: -.05em; line-height: 1; }
  body[data-page="login"][data-phase="drip"] h1, body[data-page="login"][data-phase="ready"] h1 { opacity: 1; }
  body[data-page="login"] h1 .slot { display: inline-block; width: .2em; height: .2em; border-radius: 50%; background: transparent; margin-inline-start: .07em; }
  body[data-page="login"][data-dot="on"] h1 .slot { background: #c6f36b; box-shadow: 0 0 0 1px rgba(74, 122, 6, .25); }

  /* the lines arrive one after another, once the drop has landed */
  body[data-page="login"] .panel section > :not(h1), body[data-page="login"] .legal, body[data-page="login"] .testbar { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s cubic-bezier(.3, .7, .2, 1); }
  body[data-page="login"][data-phase="ready"] .panel section > :not(h1), body[data-page="login"][data-phase="ready"] .legal, body[data-page="login"][data-phase="ready"] .testbar { opacity: 1; transform: none; }
  body[data-page="login"] .panel section > :nth-child(3) { transition-delay: .05s; }
  body[data-page="login"] .panel section > :nth-child(4) { transition-delay: .1s; }
  body[data-page="login"] .panel section > :nth-child(5) { transition-delay: .15s; }
  body[data-page="login"] .panel section > :nth-child(6) { transition-delay: .2s; }
  body[data-page="login"] .panel section > :nth-child(n+7) { transition-delay: .25s; }
  body[data-page="login"] .legal { transition-delay: .3s; }

  /* ----- the form, in the app's own shapes ----- */
  body[data-page="login"] .lead { color: var(--text-secondary); margin: 0 0 18px; font-size: 15px; }
  body[data-page="login"] .field > span, body[data-page="login"] .field .lblrow label { font-weight: 500; font-size: 13.5px; color: var(--text-muted); }
  body[data-page="login"] .field .lblrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  body[data-page="login"] .field .lblrow .linkbtn { padding: 0; font-size: 13px; font-weight: 500; text-decoration: none; }
  body[data-page="login"] .input { min-height: 56px; padding: 12px 18px; border-radius: 16px; border: 1px solid transparent; background: var(--fbg); font-size: 16.5px; }
  body[data-page="login"] .input.ltr { text-align: left; }
  body[data-page="login"] .pw .input.ltr { padding-left: 66px; padding-right: 18px; }   /* the typing starts clear of "הצגה", which sits on the left */
  body[data-page="login"] .input:focus { border-color: #4a7a06; box-shadow: 0 0 0 5px rgba(198, 243, 107, .3); }
  body[data-page="login"] .input[aria-invalid="true"] { border-color: var(--bad); }
  body[data-page="login"] .btn { min-height: 56px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); }
  body[data-page="login"] .btn.primary { background: #c6f36b; color: #11160a; border-color: transparent; box-shadow: 0 14px 28px -16px rgba(74, 122, 6, .7); font-size: 16.5px; transition: width .3s cubic-bezier(.3, .7, .2, 1), filter .15s, transform .1s; }
  body[data-page="login"] .btn.quiet { background: none; border-color: transparent; min-height: 44px; }
  body[data-page="login"] .btn.dark { background: var(--text-primary); color: var(--page); border-color: transparent; }
  /* while it works the button draws in to a small pill with three dots */
  body[data-page="login"] .btn.primary[aria-busy="true"] { opacity: 1; width: 112px; color: transparent; position: relative; }
  body[data-page="login"] .btn.primary[aria-busy="true"]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border: 0; border-radius: 50%; background: #11160a; box-shadow: -13px 0 0 #11160a, 13px 0 0 #11160a; animation: drop-dots .8s infinite ease-in-out; }
  body[data-page="login"] .below { margin: 16px 0 0; }
  body[data-page="login"] .below a { font-weight: 600; text-decoration: none; }
  body[data-page="login"] .msg { border-radius: 16px; }
}
@keyframes drop-ring { 0% { opacity: .9; transform: var(--at) scale(.1); } 100% { opacity: 0; transform: var(--at) scale(1); } }
@keyframes drop-dots { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* a low computer screen: everything draws in so the sign-in still fits one screen */
@media (min-width: 901px) and (max-height: 700px) {
  body[data-page="login"] .auth { padding-top: max(150px, 30svh); padding-bottom: 12px; }
  body[data-page="login"] .brand .bline { display: none; }
  body[data-page="login"]:not([data-phase="splash"]):not([data-phase="out"]) .brand { top: max(48px, 13svh); }
  body[data-page="login"] h1 { font-size: 32px; margin-bottom: 4px; }
  body[data-page="login"] [data-pane="main"] h1 { font-size: 40px; }
  body[data-page="login"] .lead { margin-bottom: 10px; font-size: 14.5px; line-height: 1.45; }
  body[data-page="login"] .field { margin-bottom: 8px; }
  body[data-page="login"] .field > span, body[data-page="login"] .field .lblrow { margin-bottom: 4px; }
  body[data-page="login"] .input { min-height: 46px; padding: 8px 16px; }
  body[data-page="login"] .btn { min-height: 46px; padding: 8px 20px; }
  body[data-page="login"] form > .btn.primary { margin-top: 6px; }
  body[data-page="login"] .below { margin-top: 8px; font-size: 14.5px; }
  body[data-page="login"] .legal { padding-top: 8px; font-size: 12px; }
}
@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  body[data-page="login"] .brand, body[data-page="login"] h1, body[data-page="login"] .panel section > :not(h1), body[data-page="login"] .legal { transition: none; }
  body[data-page="login"] .btn.primary[aria-busy="true"]::after { animation: none; }
}
