/* Cutorial design tokens + shared components */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Vazirmatn:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;600;700&family=Noto+Sans+Devanagari:wght@400;600;700&display=swap');

:root {
  --bg: #06070b;
  --bg-2: #0b0d14;
  --panel: #10131c;
  --panel-2: #161a26;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f5fa;
  --muted: #9aa3b5;
  --dim: #6b7386;
  --lime: #c6ff3d;
  --lime-ink: #0c1200;
  --violet: #8b6bff;
  --cyan: #35e0ff;
  --pink: #ff5fa8;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --font-display: 'Sora', 'Vazirmatn', 'Noto Sans Thai', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-body: 'Inter', 'Vazirmatn', 'Noto Sans Thai', 'Noto Sans Devanagari', system-ui, sans-serif;
}
html[dir='rtl'] {
  --font-display: 'Vazirmatn', 'Sora', system-ui, sans-serif;
  --font-body: 'Vazirmatn', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
html[dir='rtl'] h1, html[dir='rtl'] h2, html[dir='rtl'] h3, html[dir='rtl'] h4 { letter-spacing: 0; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img, video { max-width: 100%; display: block; }
::selection { background: var(--lime); color: var(--lime-ink); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  padding: 0.8em 1.4em; border-radius: 999px; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--lime); color: var(--lime-ink); box-shadow: 0 0 0 0 rgba(198, 255, 61, 0.5); }
.btn-primary:hover { box-shadow: 0 10px 40px -8px rgba(198, 255, 61, 0.55); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.07); }
.btn-sm { padding: 0.5em 1em; font-size: 0.82rem; }
.btn-danger { background: rgba(255, 107, 107, 0.12); color: var(--bad); border: 1px solid rgba(255, 107, 107, 0.3); }
.btn-ok { background: rgba(74, 222, 128, 0.12); color: var(--ok); border: 1px solid rgba(74, 222, 128, 0.3); }
.btn-lg { padding: 1em 1.8em; font-size: 1.02rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
html[dir='rtl'] .flip { transform: scaleX(-1); }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; direction: ltr; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--lime); color: var(--lime-ink);
  display: grid; place-items: center; transform: rotate(-6deg); box-shadow: 0 6px 24px -6px rgba(198, 255, 61, 0.6);
}
.logo-mark svg { width: 20px; height: 20px; }
.logo em { font-style: normal; color: var(--lime); margin-left: -10px; }

/* language menu */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 0.55em 0.9em; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 0.85rem; font-weight: 500; background: rgba(255, 255, 255, 0.03);
}
.lang-btn:hover { border-color: rgba(255, 255, 255, 0.35); }
.lang-btn svg { width: 16px; height: 16px; opacity: 0.8; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: 320px; max-width: 86vw;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 8px; border-radius: var(--radius-sm);
  background: rgba(16, 19, 28, 0.96); backdrop-filter: blur(20px); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: 0.18s;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu button { text-align: start; padding: 8px 12px; border-radius: 8px; font-size: 0.88rem; color: var(--muted); }
.lang-menu button:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.lang-menu button.on { color: var(--lime); background: rgba(198, 255, 61, 0.08); }

/* forms */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 0.8em 1em; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04); color: var(--text); font: inherit; font-size: 0.95rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(198, 255, 61, 0.12); background: rgba(255, 255, 255, 0.06); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239aa3b5' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; padding-inline-end: 2.4em; }
html[dir='rtl'] select.input { background-position: left 1em center; }
select.input option { background: #10131c; color: var(--text); }
.input[dir='ltr'] { text-align: left; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending, .chip.review, .chip.verifying, .chip.new { color: var(--warn); background: rgba(251, 191, 36, 0.12); }
.chip.approved, .chip.paid, .chip.code { color: var(--ok); background: rgba(74, 222, 128, 0.12); }
.chip.rejected, .chip.suspended { color: var(--bad); background: rgba(255, 107, 107, 0.12); }

/* toast */
.toasts { position: fixed; bottom: 24px; inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  padding: 12px 20px; border-radius: 999px; background: #1b2030; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 0.9rem; font-weight: 500; animation: toast-in 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.toast.err { border-color: rgba(255, 107, 107, 0.5); color: #ffb4b4; }
.toast.ok { border-color: rgba(198, 255, 61, 0.5); color: var(--lime); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } }

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