/* MitaBase Pro — a product of ETMITA · https://etmita.com
   Copyright © ETMITA. All rights reserved. */
/*
 * public/negin.css — Negin's three surfaces (window.MT.negin, logic in
 * /js/core/negin.js — GENERATED from src/shared/negin.ts):
 *
 *   .negin-toast   the corner card — warnings and celebrations
 *   .negin-strip   a slim block at the top of a page — the first visit
 *   .negin-box     page CONTENT — a locked module's hero, an empty state
 *
 * MitaBase ink/lime tokens; logical properties so Persian mirrors;
 * reduced-motion instant. Entrances are expo-out and ≤ 300 ms (the card
 * was 450 ms until 2026-09-20 — long enough to be a wait).
 *
 * No inline-start edge and no inset shadow faking one: a coloured bar
 * down the side of a block is the operator's "AI signature" and
 * scripts/test-no-stripes.js sweeps this sheet.
 */

:root {
  /* expo-out: the house entrance, shared by all three surfaces */
  --negin-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --negin-in: 260ms;
}

#negin-toasts {
  position: fixed;
  inset-block-end: 18px;
  inset-inline-end: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(470px, calc(100vw - 36px));
  pointer-events: none;
}

.negin-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 44px 16px 12px;
  min-height: 96px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--mb-lime, #a4f03a) 35%, transparent);
  background: var(--mb-ink, #171717);
  color: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 0 4px color-mix(in srgb, var(--mb-lime, #a4f03a) 10%, transparent);
  overflow: visible;
  pointer-events: auto;
  animation: neginIn var(--negin-in, 260ms) var(--negin-ease) backwards;
}
.negin-toast.hidden { display: none !important; }
html[dir="rtl"] .negin-toast { padding: 14px 12px 16px 44px; }
.negin-toast-out {
  animation: neginOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.negin-toast-art {
  flex: none;
  width: 132px;
  height: auto;
  margin-block: -34px -14px;
  margin-inline: -14px -2px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.negin-toast-body { min-width: 0; flex: 1; }
.negin-toast-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--mb-lime, #a4f03a);
}
html[lang="fa"] .negin-toast-title,
html[lang="fa"] .negin-toast-text { font-family: var(--mb-font-fa, "Dana"), sans-serif; }
.negin-toast-text {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #d4d4d4;
}

.negin-toast-close {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 10px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #a3a3a3;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.negin-toast-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* the countdown IS the dismiss timer (animationend); hovering the
   card pauses the animation — and with it, the timer */
.negin-toast-bar {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 0 16px 16px;
  background: var(--mb-lime, #a4f03a);
  transform-origin: 0 50%;
  animation: neginBar var(--negin-ms, 10000ms) linear forwards;
}
html[dir="rtl"] .negin-toast-bar { transform-origin: 100% 50%; }
.negin-toast:hover .negin-toast-bar { animation-play-state: paused; }

@keyframes neginIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes neginOut {
  to { opacity: 0; transform: translateY(10px) scale(0.97); }
}
@keyframes neginBar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ── the card's one button ──────────────────────────────────────── */
.negin-card-cta {
  margin-top: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--mb-lime, #a4f03a);
  border-radius: 999px;
  background: transparent;
  color: var(--mb-lime, #a4f03a);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.negin-card-cta:hover { background: color-mix(in srgb, var(--mb-lime, #a4f03a) 14%, transparent); }
.negin-card-cta:focus-visible { outline: 2px solid var(--mb-lime, #a4f03a); outline-offset: 2px; }

/* a sticky card has no bar, so the bottom padding comes back */
.negin-toast--sticky { padding-block-end: 14px; }

/* ── the strip: the first visit to a page ───────────────────────── */
.negin-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block-end: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  border-radius: 14px;
  background: var(--surface-raised, #fff);
  animation: neginStripIn var(--negin-in, 260ms) var(--negin-ease) backwards;
}
.negin-strip.hidden { display: none !important; }
.negin-strip-out { animation: neginStripOut 180ms cubic-bezier(0.4, 0, 1, 1) forwards; }

.negin-strip-art {
  flex: none;
  width: 72px;
  height: auto;
  margin-block: -18px -12px;
  pointer-events: none;
}
.negin-strip-body { min-width: 0; flex: 1; }
.negin-strip-body.hidden { display: none !important; }
.negin-strip-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary, #171717);
}
.negin-strip-lead,
.negin-strip-text {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, #525252);
}
.negin-strip-ok {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary, #171717);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.negin-strip-ok:hover { background: var(--surface-canvas, #f6f4f2); }
.negin-strip-ok:focus-visible { outline: 2px solid var(--mb-lime, #a4f03a); outline-offset: 2px; }

/* ── the box: page content ──────────────────────────────────────── */
.negin-box {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  border-radius: 18px;
  background: var(--surface-raised, #fff);
  animation: neginStripIn var(--negin-in, 260ms) var(--negin-ease) backwards;
}
.negin-box.hidden { display: none !important; }
.negin-box--hero { padding: 28px 32px; gap: 28px; }
.negin-box--compact { padding: 18px 20px; }

.negin-box-art { flex: none; height: auto; pointer-events: none; }
.negin-box--hero .negin-box-art { width: 200px; margin-block: -28px -24px; }
.negin-box--compact .negin-box-art { width: 112px; margin-block: -20px -14px; }

.negin-box-body { min-width: 0; flex: 1; }
.negin-box-body.hidden { display: none !important; }
.negin-box-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary, #171717);
}
.negin-box--hero .negin-box-title { font-size: 22px; }
.negin-box--compact .negin-box-title { font-size: 16px; }
.negin-box-lead,
.negin-box-text {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #525252);
}
.negin-box--compact .negin-box-lead,
.negin-box--compact .negin-box-text { font-size: 13px; }

.negin-box-out {
  margin: 12px 0 0;
  padding-inline-start: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.negin-box-out.hidden { display: none !important; }
.negin-box-out > li {
  position: relative;
  padding-inline-start: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary, #171717);
}
/* a lime dot, not a bar: the check belongs at the text's own start */
.negin-box-out > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  inset-block-start: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mb-lime, #a4f03a);
}
.negin-box-cta {
  margin-top: 16px;
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: var(--mb-lime, #a4f03a);
  color: var(--mb-ink, #171717);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.negin-box-cta:hover { filter: brightness(1.05); }
.negin-box-cta:focus-visible { outline: 2px solid var(--mb-ink, #171717); outline-offset: 2px; }

html[lang="fa"] .negin-strip-title, html[lang="fa"] .negin-strip-lead, html[lang="fa"] .negin-strip-text,
html[lang="fa"] .negin-strip-ok, html[lang="fa"] .negin-card-cta,
html[lang="fa"] .negin-box-title, html[lang="fa"] .negin-box-lead, html[lang="fa"] .negin-box-text,
html[lang="fa"] .negin-box-out > li, html[lang="fa"] .negin-box-cta {
  font-family: var(--mb-font-fa, "Dana"), sans-serif;
}

@keyframes neginStripIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes neginStripOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* the box is the widest thing on a narrow screen: the artwork goes */
@media (max-width: 720px) {
  .negin-box { flex-direction: column; align-items: flex-start; gap: 12px; }
  .negin-box-art { display: none; }
  .negin-strip { align-items: flex-start; }
  .negin-strip-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .negin-toast, .negin-toast-out,
  .negin-strip, .negin-strip-out, .negin-box { animation: none !important; }
  .negin-toast-bar { animation: none !important; transform: scaleX(1); }
}
