@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");

/* تم برگرفته از پوستر رویداد: سرمه‌ای عمیق + طلایی */
:root {
  --navy-950: #071533;
  --navy-900: #0b1d44;
  --navy-800: #10285c;
  --navy-700: #173a7a;
  --navy-600: #24509b;
  --gold: #d9a84e;
  --gold-2: #c08a32;
  --gold-3: #f0cf86;
  --gold-soft: #f7ecd2;
  --cream: #fbf7ee;

  --bg: #f3efe6;
  --surface: #ffffff;
  --surface-2: #f8f5ee;
  --ink: #12203f;
  --ink-2: #33405e;
  --muted: #677089;
  --line: #e5dfd0;
  --line-2: #d3cab5;
  --brand: var(--navy-800);
  --brand-2: var(--navy-900);
  --brand-soft: #e3e9f5;
  --ok: #1f8a5b;
  --ok-soft: #e1f3ea;
  --danger: #c0392b;
  --danger-soft: #fbe5e2;

  --ax-D: #2f6fd6;
  --ax-E: #1f8a5b;
  --ax-M: #c58a26;
  --ax-S: #b5487a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(7, 21, 51, .08), 0 6px 22px rgba(7, 21, 51, .10);
  --font: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", system-ui, sans-serif;
  --pattern: url("/img/pattern.svg");
  --gold-grad: linear-gradient(135deg, #f0cf86 0%, #d9a84e 45%, #b98227 100%);
  --navy-grad: radial-gradient(120% 90% at 85% 0%, #1d4590 0%, #10285c 45%, #071533 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  font-size: 15.5px;
}
h1, h2, h3, h4 { line-height: 1.5; margin: 0; }
a { color: var(--navy-700); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* پس‌زمینه سرمه‌ای با نقش هندسی طلایی */
.navy-bg {
  background-color: var(--navy-900);
  background-image: var(--pattern), var(--navy-grad);
  background-size: 120px 120px, cover;
  background-attachment: scroll;
  color: #fff;
}
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  color: var(--gold);
  -webkit-text-fill-color: transparent;
}
.gold-rule { display: block; height: 3px; width: 88px; border-radius: 3px; background: var(--gold-grad); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: .55em 1.15em; border-radius: 999px; cursor: pointer; font-weight: 700;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s, filter .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gold-grad); border-color: var(--gold-2); color: var(--navy-950); box-shadow: 0 2px 10px rgba(192, 138, 50, .35); }
.btn-primary:hover { background: var(--gold-grad); filter: brightness(1.06); border-color: var(--gold-2); }
.btn-navy { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-900); border-color: var(--navy-900); }
.btn-danger { color: var(--danger); border-color: #e9b8b1; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: .3em .85em; font-size: .88em; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); border-color: transparent; }
.btn-on-navy { background: rgba(255,255,255,.08); border-color: rgba(240,207,134,.45); color: #fff; }
.btn-on-navy:hover { background: rgba(255,255,255,.16); border-color: var(--gold); }

/* --- forms --- */
.field { display: flex; flex-direction: column; gap: .3em; }
.field > span { font-size: .9em; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: .6em .85em; background: var(--surface); outline: none;
}
.input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(217, 168, 78, .28); }

.switch { display: flex; align-items: flex-start; gap: .75em; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; flex: none; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin-top: .2em; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { right: 21px; }
.switch b { display: block; }
.switch small { color: var(--muted); display: block; line-height: 1.6; }

.card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff; padding: .6em 1.2em; border-radius: 999px; opacity: 0;
  border: 1px solid rgba(240,207,134,.5);
  transition: opacity .2s, transform .2s; z-index: 1000; pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); border-color: transparent; }

.axis-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; flex: none; }

.live { display: inline-flex; align-items: center; gap: .4em; font-size: .82em; font-weight: 700; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9aa3b5; }
.live.on { color: var(--ok); }
.live.on::before { background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,.6); animation: pulse 1.8s infinite; }
.live.off { color: var(--danger); }
.live.off::before { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,204,113,.55); } 70% { box-shadow: 0 0 0 8px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }

/* --- matrix --- */
.matrix-wrap { position: relative; width: 100%; }
.matrix-wrap svg { display: block; width: 100%; height: auto; font-family: var(--font); user-select: none; }
.matrix-tip {
  position: absolute; pointer-events: none; background: var(--navy-900); color: #fff; padding: .55em .8em;
  border-radius: 10px; font-size: 13px; line-height: 1.7; max-width: 280px; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  border: 1px solid rgba(240,207,134,.45);
  transform: translate(50%, -110%); z-index: 5; display: none;
}
.matrix-tip b { display: block; font-size: 13.5px; color: var(--gold-3); }
.legend { display: flex; flex-wrap: wrap; gap: .4em 1.2em; font-size: .9em; color: var(--ink-2); }
.legend label { display: inline-flex; align-items: center; gap: .4em; cursor: pointer; }
.legend input { accent-color: var(--navy-700); }
