/* Shared design for the server-rendered pages (login, sign-up, password reset, account,
   admin, developer docs) so they match the web app. Published to /assets/ by
   scripts/deploy.mjs; served publicly because the login page needs it before sign-in. */

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Vazirmatn";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/vazirmatn-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Vazirmatn";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/vazirmatn-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Vazirmatn";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/vazirmatn-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}

:root {
  --font: "Inter", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f7f5f8;
  --surface: #ffffff;
  --hover: #f1eef3;
  --border: #e9e5eb;
  --border-strong: #d9d3dc;
  --text: #140f17;
  --text-2: #443b49;
  --muted: #6f6675;
  --faint: #9c95a1;
  --accent: #6c158d;
  --accent-hover: #531170;
  --accent-text: #ffffff;
  --accent-soft: #f4eaf9;
  --accent-ink: #531170;
  --ring: rgba(135,27,172,0.3);
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --code-bg: #f8f6f9;
  --shadow: 0 1px 2px rgba(20,15,23,0.05), 0 12px 32px -12px rgba(20,15,23,0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0a10;
    --surface: #17121b;
    --hover: #201925;
    --border: #2a2131;
    --border-strong: #3a2e42;
    --text: #ece7ef;
    --text-2: #cbc3d0;
    --muted: #a193a8;
    --faint: #74677b;
    --accent: #a8c41a;
    --accent-hover: #c6d51a;
    --accent-text: #141a02;
    --accent-soft: rgba(168,196,26,0.12);
    --accent-ink: #c6d51a;
    --ring: rgba(168,196,26,0.3);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --code-bg: #120f14;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0a10;
  --surface: #17121b;
  --hover: #201925;
  --border: #2a2131;
  --border-strong: #3a2e42;
  --text: #ece7ef;
  --text-2: #cbc3d0;
  --muted: #a193a8;
  --faint: #74677b;
  --accent: #a8c41a;
  --accent-hover: #c6d51a;
  --accent-text: #141a02;
  --accent-soft: rgba(168,196,26,0.12);
  --accent-ink: #c6d51a;
  --ring: rgba(168,196,26,0.3);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --code-bg: #120f14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

:root[lang="fa"] {
  --font: "Vazirmatn", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
}

p {
  margin: 0 0 12px;
}

small {
  font-size: 12px;
  color: var(--faint);
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- Forms ---------- */
label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
}

input,
select,
textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  height: auto;
  padding: 10px 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.field {
  margin: 16px 0;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: 600 14px var(--font);
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

button:hover,
.btn:hover {
  background: var(--accent-hover);
}

button:active,
.btn:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary,
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

button.secondary:hover,
.btn.secondary:hover {
  background: var(--hover);
}

.btn-google {
  width: 100%;
  margin-top: 12px;
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
}

.btn-google:hover {
  background: var(--hover) !important;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  color: var(--faint);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error,
.good {
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.good {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- Auth card (login, sign-up, reset, verify) ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-card button[type="submit"],
.login-card form > button {
  width: 100%;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 16px;
  font-weight: 650;
}

.login-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.login-brand b,
.brand b {
  color: var(--accent-ink);
  font-weight: 650;
}

.login-card h1 {
  font-size: 22px;
}

.langbar {
  display: flex;
  gap: 4px;
  margin: 14px 0 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--hover);
  width: fit-content;
}

.langbar a {
  padding: 4px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none !important;
}

.langbar a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.links form {
  margin: 0;
}

/* ---------- Account / admin / developer pages ---------- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

.header,
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 -16px 28px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
}

.brand small {
  font-weight: 500;
}

.brand-logo-inline {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.header .links a,
.top .links a {
  color: var(--muted);
}

.header .links a:hover,
.top .links a:hover {
  color: var(--text);
}

.header button,
.top button {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.card {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(20,15,23,0.04);
}

.card + h2 {
  margin-top: 24px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, #871bac, #0f766e);
  color: #fff;
  font-size: 22px;
  font-weight: 650;
  flex: none;
}

.stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}

.stats p {
  margin: 2px 0 0;
}

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline input {
  max-width: 220px;
  height: 34px;
}

.inline button {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.pill.off {
  background: var(--danger-soft);
  color: var(--danger);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

code,
pre,
.key {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
}

:not(pre) > code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--hover);
}

pre {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre;
  direction: ltr;
  line-height: 1.6;
}

.endpoint {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.endpoint:last-of-type {
  border-bottom: 0;
}

.method {
  flex: none;
  min-width: 52px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 600 11.5px ui-monospace, Menlo, monospace;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 650px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Buttons inside header link rows keep their own text colour. */
.header .links a.btn,
.top .links a.btn {
  color: var(--accent-text);
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
