/* Clip Hero - shared design system. Dark, one accent (electric lime). */
:root {
  --bg: #09090b;
  --bg-2: #0e0e11;
  --surface: #131317;
  --surface-2: #1a1a1f;
  --surface-3: #232329;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f5f5f4;
  --text-2: #c9c9cf;
  --muted: #8b8b95;
  --accent: #c6ff3d;
  --accent-2: #b3f01f;
  --accent-ink: #0b0d05;
  --accent-soft: rgba(198, 255, 61, 0.12);
  --accent-glow: rgba(198, 255, 61, 0.35);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.12);
  --warn: #ffb547;
  --info: #7aa7ff;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name b { color: var(--accent); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14.5px;
  letter-spacing: -0.005em; white-space: nowrap; transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.18); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 0 0 var(--accent-glow); }
.btn-primary:hover { background: #d4ff66; box-shadow: 0 8px 30px -8px var(--accent-glow); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--danger-soft); color: #ff8a8a; border-color: rgba(255, 92, 92, 0.25); }
.btn-danger:hover { background: rgba(255, 92, 92, 0.2); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn-sm svg { width: 16px; height: 16px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 16px; /* 16px stops iOS zoom-on-focus */
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(198, 255, 61, 0.55); box-shadow: 0 0 0 4px rgba(198, 255, 61, 0.1); }
.input::placeholder, .textarea::placeholder { color: #5f5f68; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b8b95' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.hint { font-size: 12.5px; color: var(--muted); }

/* toggle switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #d9d9de; transition: transform .25s var(--ease), background .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.switch input:checked + .track { background: var(--accent); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-lg { width: 62px; height: 36px; }
.switch-lg .track::after { width: 28px; height: 28px; }
.switch-lg input:checked + .track::after { transform: translateX(26px); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.live { color: var(--accent); border-color: rgba(198, 255, 61, .3); background: var(--accent-soft); }
.pill.live .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(198, 255, 61, .18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(198, 255, 61, 0); } }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: rgba(255, 181, 71, .13); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: #ff8a8a; }
.badge.info { background: rgba(122, 167, 255, .13); color: var(--info); }

.toast-wrap { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: #1f1f25; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7); animation: toast-in .3s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.err { border-color: rgba(255, 92, 92, .35); }
.toast.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.err::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
