/* فونت «ابر» (دو وزن موجود: نیم‌ضخیم و ضخیم) */
@font-face { font-family: 'Abar'; src: url('/fonts/AbarMidFaNum-SemiBold.woff2') format('woff2'); font-weight: 100 650; font-display: swap; }
@font-face { font-family: 'Abar'; src: url('/fonts/AbarMidFaNum-Bold.woff2') format('woff2'); font-weight: 651 900; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/vendor/Vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* «تخته‌ی کلاس»: سبزِ تخته‌سیاه، سفیدِ گچ و زردِ مدادی */
  --bg: #16201d; --bg2: #1b2724; --panel: #1f2d29; --panel2: #283a35; --line: #324740;
  --text: #f1efe6; --muted: #a2b2aa; --accent: #f2b544; --accent-ink: #2b1e02; --accent-soft: rgba(242,181,68,.16); --accent2: #7fc8b0;
  --danger: #e8705f; --warn: #f2b544; --ok: #6cc98f; --tile: #1c2925; --tile2: #23342f;
  --glass: rgba(27,39,36,.82); --glow1: rgba(242,181,68,.07); --glow2: rgba(127,200,176,.08);
  --radius: 18px; --shadow: 0 18px 44px rgba(0,0,0,.34);
  --role-teacher: #ef5a4c; --role-presenter: #4fc883; --role-student: #f1efe6;
}
:root[data-theme="light"] {
  --bg: #eaf0ec; --bg2: #f6f9f7; --panel: #ffffff; --panel2: #eef3f0; --line: #d5dfda;
  --text: #182622; --muted: #5f716a; --accent: #c98a12; --accent-ink: #ffffff; --accent-soft: rgba(201,138,18,.13); --accent2: #2f8f73;
  --tile: #dbe5e0; --tile2: #cad8d1; --glass: rgba(255,255,255,.86); --glow1: rgba(201,138,18,.07); --glow2: rgba(47,143,115,.08);
  --shadow: 0 16px 40px rgba(24,48,40,.13); --role-student: #8a9a93;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Abar', 'Vazirmatn', Tahoma, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); }
.hidden { display: none !important; }

/* دکمه‌ها و فرم‌ها */
.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 9px 16px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }

/* صفحات ساده (ورود، خطا) */
body.simple { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: radial-gradient(1200px 600px at 80% -10%, rgba(43,182,163,.18), transparent), var(--bg); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; width: 100%; max-width: 420px; box-shadow: var(--shadow); text-align: center; }
.card h1 { font-size: 22px; margin: 8px 0 10px; }
.card p { color: var(--muted); line-height: 1.9; margin: 0; }
.card form { text-align: right; margin-top: 18px; }
.card .btn { width: 100%; margin-top: 16px; padding: 12px; }
.card .icon { font-size: 44px; }

/* toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input[type=checkbox] { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.switch input[type=checkbox]::after { content: ''; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: right .2s; }
.switch input[type=checkbox]:checked { background: var(--accent); }
.switch input[type=checkbox]:checked::after { right: 21px; }

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: tin .25s ease; pointer-events: auto; max-width: 90vw; }
.toast.err { border-color: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

.modal-bg { position: fixed; inset: 0; background: rgba(5,8,15,.6); z-index: 500; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; overflow-x: hidden; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }

.switch > span { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: 100%; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; }
  .modal .actions .btn { flex: 1; }
  .card { padding: 24px 18px; }
}
