/* ==========================================================================
   Formi, the clipboard mascot (rig: assets/js/auth.js). Used on sign-in and on every form.
   ========================================================================== */
/* ---------- mascot "Formi": a clipboard with gloved hands (rig: assets/js/auth.js) ---------- */
.mascot {
  --m-ink: #13212c; --m-coral: #ff7a59; --m-butter: #ffc857; --m-paper: #fffdf8; --m-lid: #f4ecda;
  position: relative; width: 300px; height: 312px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
}
.m-frame { width: 100%; height: 100%; }
.mascot-svg { width: 100%; height: auto; display: block; overflow: visible; }
.m-shadow { fill: rgba(4, 38, 34, .3); }
.m-feet ellipse { fill: var(--m-coral); stroke: var(--m-ink); stroke-width: 3; }
.m-page { fill: url(#mBody); stroke: var(--m-ink); stroke-width: 3.5; }
.m-gloss { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; opacity: .95; }
.m-box { fill: #fff; stroke: var(--m-ink); stroke-width: 2.4; }
.m-box.is-on { fill: #c9f0ea; }
.m-tick { fill: none; stroke: #0f9b8e; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.m-line { fill: #e9dfc8; }
.m-badge circle { fill: var(--m-butter); stroke: var(--m-ink); stroke-width: 2.5; }
.m-badge path { fill: var(--m-ink); }
.m-clip-base { fill: var(--m-coral); stroke: var(--m-ink); stroke-width: 3; }
.m-clip-hole { fill: rgba(255, 255, 255, .6); }
.m-brow path { fill: none; stroke: var(--m-ink); stroke-width: 3.4; stroke-linecap: round; }
.m-white { fill: url(#mEye); }
.m-eye-rim { fill: none; stroke: var(--m-ink); stroke-width: 3; }
.m-iris-ring { fill: url(#mIris); }
.m-pupil { fill: #0a1418; }
.m-shine { fill: #fff; }
.m-shine.sm { opacity: .85; }
.m-lid-u, .m-lid-l { fill: var(--m-lid); }
.m-lid-u-edge, .m-lid-l-edge { fill: none; stroke: var(--m-ink); stroke-width: 2.8; stroke-linecap: round; }
.m-cheek { fill: url(#mBlush); opacity: .55; }
.m-mouth-shape { fill: #4a2228; stroke: var(--m-ink); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.m-tongue { fill: #ff8f7a; }
.m-sweat { fill: #8fd3ff; stroke: var(--m-ink); stroke-width: 2; opacity: 0; }
.m-arm { fill: none; stroke: var(--m-ink); stroke-width: 6.5; stroke-linecap: round; }
.m-thumb, .m-finger rect, .m-palm { fill: var(--m-butter); stroke: var(--m-ink); stroke-width: 2.6; }
.m-seam { fill: none; stroke: var(--m-ink); stroke-width: 1.6; stroke-linecap: round; opacity: .35; }
.m-cuff { fill: #fff; stroke: var(--m-ink); stroke-width: 2.4; }

/* speech bubble */
.m-bubble {
  position: absolute; left: 64%; top: -4%; z-index: 3; width: max-content; max-width: 200px;
  padding: 8px 13px; border-radius: 16px 16px 16px 5px; background: #fff; color: var(--m-ink);
  border: 2px solid var(--m-ink); box-shadow: 3px 3px 0 var(--m-ink);
  font: 700 13.5px/1.3 var(--font-display); letter-spacing: -.005em;
  opacity: 0; transform: translateY(8px) scale(.6) rotate(-6deg); transform-origin: 0 100%;
  transition: opacity .16s ease, transform .42s var(--spring); pointer-events: none;
}
.m-bubble.is-on { opacity: 1; transform: none; }
.m-bubble.is-sleepy { font-style: italic; color: #4b5d68; }

@media (max-width: 960px) {
  .mascot { width: 214px; height: 186px; }
  .m-frame { overflow: hidden; }
  .m-bubble { left: 60%; top: 2%; max-width: 150px; font-size: 12px; padding: 6px 10px; }
}
@media (min-width: 600px) and (max-width: 960px) { .mascot { width: 236px; height: 236px; } }


/* ---------- Formi as the form-fill guide (assets/js/formi-guide.js) ---------- */
.formi-guide { --fm-s: 1; position: fixed; right: 18px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 900; width: calc(118px * var(--fm-s)); height: calc(124px * var(--fm-s)); pointer-events: none; animation: fgIn .7s var(--spring) both .3s; }
[dir="rtl"] .formi-guide { right: auto; left: 18px; }
@keyframes fgIn { from { transform: translateY(140px) scale(.6); } }
.formi-guide .mascot { width: 100% !important; height: 100% !important; pointer-events: auto; filter: drop-shadow(0 10px 16px rgba(19, 33, 44, .22)); }
.formi-guide .m-frame { overflow: visible !important; }
.formi-guide .m-bubble { left: auto; right: 86%; top: -18%; max-width: min(300px, 70vw); font-size: 13.5px; line-height: 1.4; border-radius: 16px 16px 5px 16px; transform-origin: 100% 100%; }
[dir="rtl"] .formi-guide .m-bubble { right: auto; left: 86%; border-radius: 16px 16px 16px 5px; transform-origin: 0 100%; }
.fg-tools { position: absolute; top: -6px; right: -6px; z-index: 4; display: flex; gap: 4px; pointer-events: auto; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.formi-guide:hover .fg-tools, .formi-guide:focus-within .fg-tools { opacity: 1; transform: none; }
@media (hover: none) { .fg-tools { opacity: 1; transform: none; } }
.fg-btn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line, #13212c); background: #fff; color: #13212c; box-shadow: 2px 2px 0 var(--line, #13212c); }
.fg-btn:hover { background: #fff8e1; }
.fg-btn .fg-off { display: none; } .fg-btn.is-off .fg-on { display: none; } .fg-btn.is-off .fg-off { display: inline; }
.fg-chip { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 8px; border-radius: 99px; border: 1.5px solid #13212c; background: #fffdf8; color: #13212c; font: 700 13px var(--font-display); box-shadow: 3px 3px 0 #13212c; animation: fgIn .5s var(--spring) both; }
[dir="rtl"] .fg-chip { right: auto; left: 16px; }
.fg-chip-face { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: #ff7a59; color: #fff; font-size: 10px; }
.fill-body:has(.formi-guide:not([hidden])) .f-wrap { padding-bottom: 150px; }
.fill-body:has(.formi-guide:not([hidden])) .fx-bar { padding-right: 140px; }
[dir="rtl"] .fill-body:has(.formi-guide:not([hidden])) .fx-bar { padding-right: 20px; padding-left: 140px; }
.fg-confetti { position: fixed; inset: 0; z-index: 950; pointer-events: none; }
.fg-confetti i { position: absolute; width: 9px; height: 14px; border-radius: 3px; animation: fgBurst 1.9s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes fgBurst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 220px)) rotate(var(--r)); opacity: 0; } }
@media print { .formi-guide, .fg-chip { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .formi-guide, .fg-chip { animation: none; } }

/* ---------- phones: the same Formi as on computers ----------
   (It used to shrink to a round face badge; now it keeps its whole clipboard body. People can move it
   and make it bigger or smaller themselves: assets/js/formi-drag.js.) */
@media (max-width: 600px) {
  .formi-guide .m-bubble, body .fc-dock .m-bubble { max-width: min(250px, calc(100vw - 150px)); font-size: 12.5px; line-height: 1.4; padding: 7px 11px; }
  .fg-btn { width: 26px; height: 26px; }
  .fg-btn .icon { width: 14px; height: 14px; }
  .fg-chip { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); height: 38px; }
}
@media (pointer: coarse), (max-width: 720px) {
  .fg-btn { min-width: 32px; min-height: 32px; }
}
.fg-btn[data-fg="mute"].is-off { opacity: .75; }

/* ---------- moving and resizing Formi (assets/js/formi-drag.js) ---------- */
.formi-guide .mascot, .fc-dock .mascot { touch-action: none; cursor: grab; }
.fm-dragging .mascot { cursor: grabbing; }
.fm-dragging, .fm-resizing { animation: none !important; transition: none !important; }
.fm-dragging .mascot { filter: drop-shadow(0 22px 26px rgba(19, 33, 44, .3)) !important; }
.fm-home { transition: left .35s var(--spring), top .35s var(--spring), width .35s var(--spring), height .35s var(--spring); }
/* the grip: an invisible corner you can pull, with a soft corner line when you hover or touch it */
.fm-grip { position: absolute; z-index: 5; width: 30px; height: 30px; left: -10px; top: -10px; pointer-events: auto; touch-action: none; cursor: nwse-resize; }
.fm-grip::before { content: ""; position: absolute; inset: 8px; border: 3px solid var(--brand, #0f9b8e); border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; opacity: 0; transition: opacity .2s; }
.formi-guide:hover .fm-grip::before, .fc-dock:hover .fm-grip::before, .fm-resizing .fm-grip::before { opacity: .85; }
@media (hover: none) { .fm-grip::before { opacity: .45; } .fm-grip { width: 38px; height: 38px; left: -14px; top: -14px; } }
.fm-left .fm-grip { left: auto; right: -10px; cursor: nesw-resize; }
.fm-left .fm-grip::before { border-left: 0; border-right: 3px solid var(--brand, #0f9b8e); border-radius: 0 12px 0 0; }
.fm-top .fm-grip { top: auto; bottom: -10px; cursor: nesw-resize; }
.fm-top .fm-grip::before { border-top: 0; border-bottom: 3px solid var(--brand, #0f9b8e); border-radius: 0 0 0 12px; }
.fm-top.fm-left .fm-grip { cursor: nwse-resize; }
.fm-top.fm-left .fm-grip::before { border-left: 0; border-right: 3px solid var(--brand, #0f9b8e); border-radius: 0 0 12px 0; }
@media (hover: none) { .fm-left .fm-grip { right: -14px; } .fm-top .fm-grip { bottom: -14px; } }
/* tools sit on the corner the grip doesn't use */
.formi-guide.fm-left .fg-tools { right: auto; left: -6px; }
/* the speech bubble opens toward the middle of the screen */
.formi-guide.fm-left .m-bubble, body .fc-dock.fm-left .m-bubble { right: auto; left: 86%; border-radius: 16px 16px 16px 5px; transform-origin: 0 100%; }
.formi-guide.fm-top .m-bubble, body .fc-dock.fm-top .m-bubble { top: 100%; margin-top: 6px; border-radius: 5px 16px 16px 16px; transform-origin: 0 0; }
.formi-guide.fm-top:not(.fm-left) .m-bubble, body .fc-dock.fm-top:not(.fm-left) .m-bubble { border-radius: 16px 5px 16px 16px; transform-origin: 100% 0; }
