/* Zovvar Room — shared styles
   Palette from Persian tilework: lapis, turquoise, saffron. Persian-first (RTL), Vazirmatn type. */

@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --lapis-950: #0b1a33;
  --lapis-900: #10244a;
  --lapis-800: #183466;
  --lapis-700: #23467f;
  --lapis-600: #305a9c;
  --turquoise: #23a39a;
  --turquoise-600: #178077;
  --turquoise-50: #e2f4f1;
  --saffron: #f2a93b;
  --saffron-50: #fdf1dc;
  --rose: #df5a5f;
  --rose-600: #c4444a;
  --rose-50: #fce9ea;
  --mist: #eef2f6;
  --paper: #ffffff;
  --ink: #13233b;
  --ink-2: #52627a;
  --line: #d4dde8;

  --r-input: 10px;
  --r-tile: 14px;
  --r-panel: 18px;

  --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%2323a39a' stroke-width='1.1'%3E%3Crect x='17' y='17' width='22' height='22'/%3E%3Crect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 0l9.6 9.6M56 0l-9.6 9.6M0 56l9.6-9.6M56 56l-9.6-9.6'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--mist);
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { display: block; }
[hidden] { display: none !important; }
a { color: var(--turquoise-600); }

:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }
.flip-rtl { transform: scaleX(-1); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- buttons and fields */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .45rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--r-input);
  background: var(--paper); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--turquoise-600); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #136b63; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink-2); }
.btn.danger { background: var(--rose-600); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #a8373d; }
.btn.small { min-height: 36px; padding: .3rem .8rem; font-size: 14px; }
.btn.big { min-height: 52px; font-size: 18px; padding-inline: 1.6rem; }

.field { display: grid; gap: .35rem; }
.field > label, .label { font-weight: 500; font-size: 15px; }
.input {
  width: 100%; min-height: 46px; padding: .5rem .85rem;
  border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--paper);
}
.input:focus-visible { outline: 3px solid var(--saffron); outline-offset: 0; border-color: var(--saffron); }
.input[dir="ltr"] { text-align: left; }
.hint { margin: 0; color: var(--ink-2); font-size: 14px; }
.error { margin: 0; color: var(--rose-600); font-size: 15px; font-weight: 500; }

/* ---------- light pages: home and admin */

.band {
  background-color: var(--lapis-900);
  background-image: var(--girih);
  background-size: 56px 56px;
  padding: 56px 20px 64px;
  color: #fff;
}
.band-inner { max-width: 960px; margin: 0 auto; display: flex; justify-content: center; }
.cartouche {
  position: relative;
  display: grid; justify-items: center; gap: .1rem;
  padding: 1.1rem 2.4rem 1.3rem;
  background: var(--lapis-900);
  border: 2px solid var(--saffron);
  border-radius: 999px;
  outline: 1px solid rgba(242, 169, 59, .55);
  outline-offset: 6px;
  text-align: center;
}
.site-title { margin: 0; font-size: clamp(30px, 6vw, 48px); line-height: 1.25; font-weight: 700; letter-spacing: 0; }
.site-sub { margin: 0; color: #cfe4f3; font-size: 16px; }

.page { max-width: 560px; margin: -28px auto 0; padding: 0 16px 48px; }
.page.wide { max-width: 980px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 24px;
}
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 .9rem; font-size: 22px; line-height: 1.5; }
.panel h3 { margin: 0 0 .6rem; font-size: 18px; }
.row { display: flex; gap: .6rem; align-items: stretch; }
.row > .input { flex: 1; min-width: 0; }
.stack { display: grid; gap: 1rem; }
.foot { text-align: center; margin: 22px 0 0; font-size: 15px; }

/* ---------- admin */

.narrow-panel { max-width: 440px; margin-inline: auto; }
.modes { display: grid; gap: .6rem; border: 0; padding: 0; margin: 0; }
.modes legend { margin-bottom: .4rem; }
.mode {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.mode:has(input:checked) { border-color: var(--turquoise-600); background: var(--turquoise-50); }
.mode input { margin-top: .45rem; width: 18px; height: 18px; accent-color: var(--turquoise-600); flex: none; }
.mode-body { display: grid; }
.mode-body span { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }

.rooms-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.rooms-head h2 { margin: 0; }
.rooms { list-style: none; margin: 0; padding: 0; }
.room-row { display: grid; gap: .45rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.room-row:first-child { border-top: 0; }
.room-row.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--saffron-50); } to { background: transparent; } }
.room-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.room-top h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.online { flex: none; color: var(--ink-2); font-size: 14px; }
.online.live { color: var(--turquoise-600); font-weight: 700; }
.room-meta { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; color: var(--ink-2); font-size: 14px; }
.kind { padding: 0 .55rem; border-radius: 6px; font-weight: 500; }
.kind.webinar { background: var(--saffron-50); color: #8a5a14; }
.kind.meeting { background: var(--turquoise-50); color: var(--turquoise-600); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); }
.room-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .15rem; }
.room-actions .icon { width: 18px; height: 18px; }
.btn.danger-text { color: var(--rose-600); }
.btn.danger-text:hover:not(:disabled) { border-color: var(--rose-600); }
.rooms-empty { margin: .5rem 0 0; color: var(--ink-2); }

/* ---------- toasts */

#toasts {
  position: fixed; inset-inline: 0; bottom: 96px; z-index: 50;
  display: grid; justify-items: center; gap: .5rem; pointer-events: none; padding: 0 12px;
}
.toast {
  pointer-events: auto;
  max-width: min(520px, 100%);
  padding: .65rem 1.1rem; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 15px; line-height: 1.7;
  box-shadow: 0 8px 24px rgba(11, 26, 51, .28);
  animation: toast-in .2s ease-out;
}
.toast.error { background: var(--rose-600); }
.toast.ok { background: var(--turquoise-600); }
.toast.hand { background: var(--saffron); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.room-meta .banned { color: var(--rose-600); font-weight: 500; }
