@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #fafaf8;
  --text: #17181a;
  --muted: #6f7378;
  --line: #e4e3df;
  --line-strong: #d2d1cc;
  --accent: #155e52;
  --accent-hover: #114a41;
  --accent-soft: #edf3f1;
  --accent-line: #cfe0da;
  --danger: #a3352c;
  --danger-soft: #fbf0ee;
  --danger-line: #e6c3be;
  --warn-soft: #fbf6ea;
  --warn-line: #e5d7b6;
  --warn-accent: #8a6a1f;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono {
  font-family: var(--mono);
}

/* ---------- Embed widget ---------- */

body.widget-body {
  background: transparent;
  min-height: 100vh;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(23, 24, 26, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 20px 26px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 28px 70px -30px rgba(23, 24, 26, 0.5), 0 2px 8px rgba(23, 24, 26, 0.05);
  animation: card-in 180ms ease-out both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.card-head {
  margin-top: 12px;
}

.card-head h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.card-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

.card-sub strong {
  color: var(--text);
  font-weight: 500;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 16px;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.tab {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(23, 24, 26, 0.08), 0 0 0 1px rgba(23, 24, 26, 0.03);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  appearance: none;
}

.input::placeholder {
  color: #9a9da1;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-ltr {
  direction: ltr;
  text-align: left;
}

.input[type="password"] {
  letter-spacing: 0.5px;
}

.form-aside {
  display: flex;
  justify-content: flex-end;
  margin-top: -3px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-center {
  align-self: center;
  margin-top: 2px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn.is-busy {
  color: transparent;
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface-soft);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.alert {
  margin-top: 13px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.85;
}

.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.alert-ok {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

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

.form-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: -2px;
}

.account {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 8px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

.account-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
}

.account-name {
  font-size: 16px;
  font-weight: 600;
}

.account-email {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  direction: ltr;
  word-break: break-all;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-accent);
  font-size: 11px;
  line-height: 1.9;
}

.chip.is-verified {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.account-note {
  margin-top: 8px;
  max-width: 280px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.9;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.card-foot svg {
  flex: none;
}

.card-error {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------- Full pages ---------- */

.page-body {
  background: var(--bg);
  min-height: 100vh;
}

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  padding: 32px 18px;
}

.page-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px -34px rgba(23, 24, 26, 0.4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--accent);
}

.brand-center {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 50%;
  border: 1px solid transparent;
}

.status-icon.is-ok {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.status-icon.is-error {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.page-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.7;
}

.page-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 2;
}

.page-card .btn {
  margin-top: 18px;
}

.page-card .form {
  margin-top: 18px;
  text-align: right;
}

.page-card .alert {
  margin-top: 14px;
  text-align: right;
}

.page-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-foot {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- Landing ---------- */

.landing-body {
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1060px;
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
}

.topnav {
  display: flex;
  gap: 18px;
  margin-inline-start: auto;
}

.navlink {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 120ms ease;
}

.navlink:hover {
  color: var(--text);
}

.topbar-inner .btn {
  flex: none;
}

.landing-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 54px 24px 70px;
}

.hero {
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
}

.hero h1 {
  margin-top: 16px;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.4px;
}

.hero-lede {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.dot-ok {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 44px;
}

.tile {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tile h2 {
  font-size: 14.5px;
  font-weight: 600;
}

.tile p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.95;
}

.panel {
  margin-top: 18px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel h2 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
}

.panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 2;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.panel code,
.panel p code {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  direction: ltr;
}

.code-block {
  margin: 12px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  direction: ltr;
  text-align: left;
}

.code-block code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: #21262b;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
}

.hint {
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.95 !important;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .landing-main {
    padding: 36px 18px 52px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .panel {
    padding: 20px 18px;
  }

  .topnav {
    display: none;
  }

  .topbar-inner {
    padding: 0 18px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .auth-card {
    padding: 18px 18px 16px;
  }

  .page-card {
    padding: 24px 20px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
