/* The Samvesta component layer (ADR-0067, RB5): the brand's own pieces, ported once from
 * brand/sme-os/aurora.css (the canvas's class spec) and shared by both OSes on web and desktop.
 * One namespace, `sv-`. Every colour, gradient, font, radius, shadow and duration is a token
 * from packages/ui/tokens.css — this file names none of its own (scripts/check_brand.py).
 *
 * The rules the classes carry (brand/sme-os/README.md):
 *   Usha (sv-aur, sv-aur-text, sv-ring, sv-orb, the AI states) only on what the AI drafted or is
 *     doing — never a button, the nav or decoration (RB6). It is the same in every pack.
 *   Neel is every action (sv-btn-ai is the primary button: Neel, NOT Usha, despite the canvas's
 *     name for it). Genda is "needs you" (sv-needs, sv-nav-pill). WhatsApp green is WhatsApp only
 *     (sv-btn-wa), with Neel 950 text — white on it is 2.0:1.
 *   A pack's colour sits on its own chip (sv-pack-chip[data-pack]), nowhere else (O1).
 * The React primitives over these classes are packages/product-ui/components/brand/. */

/* ---------- Usha: AI only ---------- */
.sv-aur {
  background-image: var(--usha-loop); background-size: 300% 100%;
  animation: sv-flow var(--motion-ai-flow) linear infinite;
}
.sv-aur-text {
  background-image: var(--usha-deep); background-size: 300% 100%;
  animation: sv-flow var(--motion-ai-flow) linear infinite;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* "Drafted": the ring round what the AI made. The card inside keeps the panel ground. */
.sv-ring-wrap { position: relative; isolation: isolate; }
.sv-ring { position: relative; padding: 1.5px; border-radius: var(--radius-ring); }
.sv-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background-image: var(--usha-loop); background-size: 300% 100%;
  animation: sv-flow var(--motion-ai-flow) linear infinite;
}
.sv-ring-glow::after {
  content: ""; position: absolute; inset: -10px; z-index: -1;
  border-radius: calc(var(--radius-ring) + 10px);
  background-image: var(--usha-loop); background-size: 300% 100%;
  animation: sv-flow var(--motion-ai-flow) linear infinite; filter: blur(24px); opacity: .22;
}
.sv-ring-in, .sv-ring > .sv-card {
  position: relative; border-radius: calc(var(--radius-ring) - 1.5px);
  background: var(--panel); padding: var(--space-20);
}
/* A card inside the ring drops its own frame: the ring is the frame (RB6; Try it, wow wrap W1). */
.sv-ring-in > .sv-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.sv-orb {
  border-radius: 50%; background-image: var(--usha-orb); flex: none;
  animation: sv-spin var(--motion-ai-spin) linear infinite;
}
.sv-orb-box { position: relative; flex: none; width: var(--sv-orb-size, auto); height: var(--sv-orb-size, auto);  /* set by <AiOrb size> */ }
.sv-orb-box .sv-orb { position: absolute; inset: 12%; }
.sv-orb-glow {
  position: absolute; inset: 0; border-radius: 50%; background-image: var(--usha-orb);
  filter: blur(36px); opacity: .4; animation: sv-breathe var(--motion-ai-breathe) ease-in-out infinite;
}
.sv-orb-shine { position: absolute; inset: 12%; border-radius: 50%; background: var(--orb-shine); }

/* ---------- the AI states: thinking · drafted (sv-ring) · needs you · done ---------- */
.sv-live {
  width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--sv-jamun-500);
  animation: sv-pulse var(--motion-ai-pulse) ease-out infinite;
}
.sv-think { display: inline-flex; gap: 3px; align-items: center; }
.sv-think i {
  display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--sv-jamun-500);
  animation: sv-dot var(--motion-ai-dot) ease-in-out infinite;
}
.sv-think i:nth-child(2) { animation-delay: .15s; background: var(--sv-gulabi-500); }
.sv-think i:nth-child(3) { animation-delay: .3s; background: var(--sv-genda-500); }
.sv-shimmer {
  background: linear-gradient(90deg, var(--ink-2) 0%, var(--ai) 45%, var(--ink-2) 60%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: sv-shim var(--motion-ai-shimmer) linear infinite;
}
.sv-caret {
  display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; margin-left: 2px;
  background: var(--sv-jamun-500); animation: sv-blink var(--motion-ai-blink) steps(2) infinite;
}
.sv-rise { animation: sv-in var(--motion-rise) var(--ease-rise) both; }
.sv-bubble-ai {
  padding: 14px 18px; border-radius: 4px 18px 18px 18px; background: var(--ai-soft);
  border: 1px solid var(--ai-line); font-size: 16px; line-height: 1.5;
}
/* Genda: something waits for the owner. */
.sv-needs {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--needs); box-shadow: 0 0 0 4px var(--needs-halo);
}
/* Done: the AI goes quiet — plain text and a Tulsi dot. */
.sv-done { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.sv-ai-done { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.sv-thinking { display: inline-flex; align-items: center; gap: 8px; }
.sv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- controls ---------- */
.sv-btn-ai, .sv-btn-wa {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius-pill);
  font: var(--weight-medium) 15px/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
/* The primary action. Neel, never Usha — the AI's colour is for what it made, not buttons. */
.sv-btn-ai { color: var(--on-accent); background: var(--accent); box-shadow: var(--accent-glow); }
.sv-btn-ai:hover { background: var(--accent-hover); }
/* WhatsApp sends only. */
.sv-btn-wa { color: var(--on-whatsapp); background: var(--whatsapp); font-weight: var(--weight-semibold); }
.sv-btn-wa:hover { background: var(--whatsapp-hover); }
.sv-btn-ai:focus-visible, .sv-btn-wa:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sv-btn-ai:disabled, .sv-btn-wa:disabled { opacity: .5; cursor: default; }
.sv-nav-pill {
  margin-left: auto; min-width: 22px; padding: 2px 8px; border-radius: var(--radius-pill);
  text-align: center; font: var(--weight-semibold) 12px var(--font-sans);
  font-variant-numeric: tabular-nums; color: var(--on-needs); background: var(--needs);
}

/* ---------- the pack chip: the only place a pack's own colour appears (O1) ---------- */
.sv-pack-chip {
  --sv-pack: var(--needs);
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft);
}
.sv-pack-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sv-pack); }
.sv-pack-chip[data-pack="shop"] { --sv-pack: var(--pack-shop); }
.sv-pack-chip[data-pack="clinic"] { --sv-pack: var(--pack-clinic); }
.sv-pack-chip[data-pack="services"] { --sv-pack: var(--pack-services); }
.sv-pack-chip[data-pack="online-seller"] { --sv-pack: var(--pack-seller); }
.sv-pack-chip[data-pack="new-business"] { --sv-pack: var(--pack-new); }
.sv-pack-chip[data-pack="enterprise"] { --sv-pack: var(--pack-ent); }

/* ---------- money: Mukta's tabular figures (Tiro has no ₹, so never a number in serif) ---------- */
.sv-money { font-family: var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.sv-money-in { color: var(--ok-ink); }
.sv-money-due { color: var(--err); }

/* ---------- status chip ---------- */
.sv-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-pill); white-space: nowrap; letter-spacing: .06em;
  text-transform: uppercase; font: var(--weight-semibold) 11.5px var(--font-sans);
  background: var(--panel-2); color: var(--ink-2);
}
.sv-chip-ok { background: var(--ok-soft); color: var(--ok-ink); }
.sv-chip-warn { background: var(--warn-soft); color: var(--warn-ink); }
.sv-chip-err { background: var(--err-soft); color: var(--err); }
.sv-chip-info { background: var(--info-soft); color: var(--info); }
.sv-chip-ai { background: var(--ai-soft); color: var(--ai); }

/* ---------- the logo lock-up (the SVG itself is generated: components/brand/logo-art.ts) ---------- */
.sv-lock { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; }
.sv-lock svg { flex: none; display: block; }

/* ---------- serif: one warm word per screen ---------- */
.sv-serif { font-family: var(--font-serif); font-style: italic; font-weight: var(--weight-regular); letter-spacing: 0; }

@keyframes sv-flow { to { background-position: 300% 50%; } }
@keyframes sv-spin { to { transform: rotate(360deg); } }
@keyframes sv-breathe { 50% { opacity: .6; transform: scale(1.08); } }
@keyframes sv-pulse {
  0% { box-shadow: 0 0 0 0 var(--ai-pulse); }
  70% { box-shadow: 0 0 0 8px var(--ai-pulse-end); }
  100% { box-shadow: 0 0 0 0 var(--ai-pulse-end); }
}
@keyframes sv-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes sv-shim { to { background-position: -200% 0; } }
@keyframes sv-blink { 50% { opacity: 0; } }
@keyframes sv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sv-aur, .sv-aur-text, .sv-ring::before, .sv-ring-glow::after, .sv-orb, .sv-orb-glow, .sv-live,
  .sv-think i, .sv-shimmer, .sv-caret, .sv-rise { animation: none !important; }
}
