/* ========== متغیرها و تنظیمات پایه ========== */
:root {
  --bg: #0e1621;
  --panel: #17212b;
  --panel2: #1f2c3a;
  --text: #e6eef6;
  --muted: #9fb0c0;
  --primary: #2ea6ff;
  --bubble: #223040;
  --bubbleMe: #2b5278;
  --border: rgba(255,255,255,.07);
  --shadow: 0 10px 28px rgba(0,0,0,.38);
  --font: "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, Arial;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; }

/* ========== دکمه‌ها و المان‌های تعاملی ========== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 999px;
  color: var(--text);
}
.pill:hover { background: rgba(255,255,255,.05); }
.pill.small { padding: 6px 10px; font-size: 13px; }

.btn-primary {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--primary);
  color: #071019;
  font-weight: 900;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,.05); }

.btn-danger {
  border: 1px solid rgba(255,90,90,.35);
  background: rgba(255,90,90,.12);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(255,90,90,.18); }

.link { color: var(--primary); }

.alert {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,90,90,.14);
  border: 1px solid rgba(255,90,90,.35);
  margin: 10px 0;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* ========== فرم‌ها ========== */
label {
  display: block;
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
  font-size: 16px;
}

textarea { resize: none; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(46,166,255,.6);
}

/* ========== صفحات لاگین و ثبت‌نام ========== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  min-height: 100vh;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 900;
  font-size: 22px;
}

.subtitle {
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 16px;
}

.register-link {
  margin-top: 20px;
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid #eee;
}
.register-link a {
  color: #4a6cf7;
  text-decoration: none;
  font-size: 14px;
}
.register-link a:hover { text-decoration: underline; }

.alert.error {
  background-color: #fee;
  border-color: #f99;
  color: #c00;
}
.alert.success {
  background-color: #efe;
  border-color: #9f9;
  color: #090;
}

/* ========== اسکرول‌بار ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.03); border-radius: 3px; }
::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,.2);
  border-radius: 3px;
  transition: background-color 0.2s;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.3); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) rgba(255,255,255,.03); }

/* ========== تنظیمات اندازه فونت ========== */
body[style*="font-size: 14px"] .msg .body,
body[style*="font-size: 14px"] .room-name,
body[style*="font-size: 14px"] .chat-title { font-size: 14px; }
body[style*="font-size: 18px"] .msg .body,
body[style*="font-size: 18px"] .room-name,
body[style*="font-size: 18px"] .chat-title { font-size: 18px; }

/* ========== چک‌باکس و رادیو ========== */
input[type="checkbox"] { width: auto; margin: 0; }
input[type="radio"] { width: auto; margin: 0 5px 0 0; }