@import 'fonts/fontiran.css';
:root {
  --primary: #0e61a1;
  --secondary: #707a82;
  --info: #46caeb;
  --success: #4bd08b;
  --warning: #f8c076;
  --error: #ff547b;
  --indigo: #8763da;
  --light-primary: #71a9cf;
  --modern-primary: #125169;
  --light-info: #e1f5fa;
  --light-secondary: #8ca0af;
  --light-success: #dffff3;
  --light-error: #ffede9;
  --light-warning: #fff6ea;
  --light-indigo: #f1ebff;
  --text-primary: #2a3547;
  --text-secondary: #2a3547;
  --border: #e5eaef;
  --input-border: #dfe5ef;
  --container: #ffffff;
  --background: #f9fafb;
  --hover: #f6f9fc;
  --surface: #ffffff;
  --grey-50: #b0b7be;
  --grey-100: #707a82;
  --grey-200: #111c2d;
  --dark-bg: #2a3447;
  --bg-light: #f5f8fb;
  --bg-dark: #111c2d;
  --header-height: 76px;
  --sidebar-width: 258px;
  --shadow-sm: 0 8px 28px rgba(17, 28, 45, 0.06);
  --shadow-md: 0 18px 48px rgba(17, 28, 45, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--background);
  font-family: 'IRANYekanXFaNum', sans-serif;
  font-size: 15px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

a {
  color: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-ligatures: none;
}

:not(pre) > code {
  display: inline-block;
  direction: ltr;
  padding: 0.05rem 0.38rem;
  color: var(--modern-primary);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88em;
  line-height: 1.65;
  vertical-align: baseline;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  right: 10px;
  padding: 8px 14px;
  color: #fff;
  background: var(--bg-dark);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1600px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 205px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--modern-primary));
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(14, 97, 161, 0.24);
  font: 800 22px/1 Arial, sans-serif;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  direction: ltr;
  line-height: 1.25;
}

.brand-copy strong {
  color: var(--grey-200);
  font-size: 18px;
}

.brand-copy small {
  color: var(--secondary);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.header-title {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  line-height: 1.45;
  font-weight: 700;
}

.eyebrow {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
}

.version-badge {
  padding: 5px 11px;
  color: var(--primary);
  background: #edf6fd;
  border: 1px solid #d9ebf8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-nav {
  display: none;
}

.docs-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 36px;
}

.sidebar {
  min-width: 0;
}

.sidebar-inner {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  padding: 8px 0 28px;
}

.sidebar-label {
  margin: 0 16px 10px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  position: relative;
  padding: 9px 16px;
  color: var(--secondary);
  border-radius: 10px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 3px;
  background: var(--primary);
  border-radius: 5px;
  opacity: 0;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--hover);
}

.nav-link.active {
  color: var(--primary);
  background: #edf6fd;
  font-weight: 700;
}

.nav-link.active::before {
  opacity: 1;
}

.sidebar-note {
  margin: 22px 8px 0;
  padding: 13px 14px;
  color: var(--secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.7;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--light-success);
}

.main-content {
  min-width: 0;
  padding-bottom: 50px;
}

.doc-section {
  padding: 76px 0;
  border-bottom: 1px solid var(--border);
}

.hero-section {
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-content: center;
  gap: 34px;
}

.hero-copy {
  align-self: center;
}

.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
}

h1,
h2,
h3 {
  color: var(--grey-200);
  line-height: 1.5;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 4.5vw, 62px);
  letter-spacing: -0.035em;
}

h2 {
  margin: 0;
  font-size: clamp(25px, 2.5vw, 34px);
  letter-spacing: -0.025em;
}

h3 {
  margin: 34px 0 14px;
  font-size: 18px;
}

p {
  margin: 0 0 18px;
}

.hero-lead {
  max-width: 750px;
  color: var(--secondary);
  font-size: 18px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  padding: 11px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 750;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(14, 97, 161, 0.22);
}

.secondary-button {
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.hero-card {
  align-self: center;
  padding: 8px 24px;
  background:
    linear-gradient(145deg, rgba(225, 245, 250, 0.55), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.hero-card > div {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}

.hero-card > div:last-child {
  border-bottom: 0;
}

.hero-card span {
  color: var(--secondary);
  font-size: 13px;
}

.hero-card code,
.hero-card strong {
  color: var(--grey-200);
  font-size: 12px;
}

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

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.section-number {
  flex: 0 0 auto;
  min-width: 38px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  color: var(--primary);
  background: #edf6fd;
  border: 1px solid #d9ebf8;
  border-radius: 8px;
  direction: ltr;
  font: 800 11px/1 Arial, sans-serif;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.callout p {
  margin: 4px 0 0;
  color: #425066;
}

.callout-icon {
  flex: 0 0 auto;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  direction: ltr;
  font: 800 12px/1 Arial, sans-serif;
}

.info-callout {
  background: var(--light-info);
  border-color: #c8ecf5;
}

.info-callout .callout-icon {
  color: #087792;
  background: rgba(70, 202, 235, 0.22);
}

.warning-callout {
  background: var(--light-warning);
  border-color: #f6dfbe;
}

.warning-callout .callout-icon {
  color: #9b5c08;
  background: rgba(248, 192, 118, 0.3);
}

.danger-callout {
  background: var(--light-error);
  border-color: #ffd5dc;
}

.danger-callout .callout-icon {
  color: #bf294b;
  background: rgba(255, 84, 123, 0.16);
}

.prominent-callout {
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.flow {
  display: grid;
  grid-template-columns: repeat(11, auto);
  align-items: stretch;
  gap: 9px;
  margin: 30px 0;
  overflow-x: auto;
  padding: 4px 2px 14px;
}

.flow-step {
  min-width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.flow-step span,
.mini-card-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.flow-step strong {
  font-size: 13px;
}

.flow-step small {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 10px;
  white-space: nowrap;
}

.flow-arrow {
  align-self: center;
  color: var(--light-primary);
  font-size: 18px;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(30px, 4vw, 58px);
  align-items: start;
}

.endpoint-content {
  min-width: 0;
}

.endpoint-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0;
  padding: 10px 12px;
  direction: ltr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.endpoint-bar code {
  min-width: 0;
  overflow: auto;
  color: var(--grey-200);
  white-space: nowrap;
  background: transparent;
  border: 0;
  font-size: 13px;
}

.method {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #fff;
  border-radius: 7px;
  font: 800 11px/1.4 Arial, sans-serif;
  letter-spacing: 0.03em;
}

.method.post {
  background: var(--primary);
}

.danger-endpoint .method.post {
  background: var(--error);
}

.icon-button,
.code-title button,
.copy-code-button {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 5px 9px;
  color: var(--secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  transition: color 0.2s ease, background 0.2s ease;
}

.endpoint-bar .icon-button {
  margin-left: auto;
}

.icon-button:hover,
.code-title button:hover {
  color: var(--primary);
  background: var(--hover);
}

.table-wrap {
  width: 100%;
  margin: 14px 0 25px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}

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

.wide-table table {
  min-width: 980px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: #4f5d70;
  background: var(--bg-light);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdff;
}

td:first-child,
td:nth-child(2) {
  white-space: nowrap;
}

.required-badge,
.optional-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.required-badge {
  color: #b83555;
  background: var(--light-error);
}

.optional-badge {
  color: #64717a;
  background: #eef2f5;
}

.response-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.response-fields > div {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.response-fields > div > code {
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.response-fields > div > span {
  float: left;
}

.response-fields p {
  margin: 7px 0 0;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.7;
}

.code-panel,
.json-example {
  min-width: 0;
  overflow: hidden;
  color: #dfe8f5;
  background: var(--bg-dark);
  border: 1px solid #253249;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  direction: ltr;
}

.code-panel {
  position: sticky;
  top: calc(var(--header-height) + 22px);
}

.code-panel-header,
.code-title {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  color: #b9c8da;
  background: #172337;
  border-bottom: 1px solid #2a3850;
  direction: rtl;
  font-size: 11px;
  font-weight: 700;
}

.copy-code-button,
.code-panel .code-title button,
.json-example .code-title button {
  color: #b9c8da;
  border-color: #3a4860;
}

.copy-code-button:hover,
.code-panel .code-title button:hover,
.json-example .code-title button:hover {
  color: #fff;
  background: #25344c;
}

.code-tabs {
  display: flex;
  gap: 3px;
  padding: 9px 10px 0;
  overflow-x: auto;
  background: #172337;
}

.code-tabs button {
  padding: 7px 9px;
  color: #8fa2b9;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font: 700 10px/1.5 Arial, sans-serif;
  white-space: nowrap;
}

.code-tabs button:hover,
.code-tabs button.active {
  color: #fff;
}

.code-tabs button.active {
  border-color: var(--info);
}

pre {
  margin: 0;
  overflow: auto;
  direction: ltr;
  text-align: left;
  tab-size: 2;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 18px;
  color: #dfe8f5;
  background: transparent;
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre;
}

.request-code {
  min-height: 340px;
  max-height: 570px;
}

.expected-response {
  border-top: 1px solid #2a3850;
}

.expected-response .code-title {
  color: #91e9bc;
  background: rgba(75, 208, 139, 0.08);
}

.json-example {
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.compact-example {
  max-width: 680px;
}

.callback-url-example pre code {
  min-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.split-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.mini-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.mini-card h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.mini-card p {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
}

.mini-card-number {
  float: right;
  margin: 0 0 8px 10px;
}

.muted-text {
  color: var(--secondary);
  font-size: 13px;
}

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 24px;
  direction: ltr;
}

.status-list code {
  padding: 5px 9px;
  color: #5d40a5;
  background: var(--light-indigo);
  border: 1px solid #e1d6fb;
  border-radius: 7px;
  font-size: 10px;
}

.global-errors-table table {
  min-width: 900px;
}

.success-row td {
  background: rgba(223, 255, 243, 0.42);
}

.pending-row td {
  background: rgba(255, 246, 234, 0.5);
}

.docs-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0 0;
  color: var(--secondary);
  font-size: 12px;
}

.docs-footer strong {
  color: var(--primary);
  direction: ltr;
}

.copy-toast {
  position: fixed;
  z-index: 300;
  right: 50%;
  bottom: 26px;
  padding: 9px 18px;
  color: #fff;
  background: var(--bg-dark);
  border: 1px solid #344158;
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 12px;
}

.copy-toast.visible {
  opacity: 1;
  transform: translate(50%, 0);
}

@media (max-width: 1240px) {
  .docs-shell {
    gap: 26px;
  }

  .endpoint-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .code-panel {
    position: static;
    max-width: 820px;
  }

  .request-code {
    min-height: 0;
  }
}

@media (max-width: 940px) {
  :root {
    --header-height: 68px;
  }

  .header-inner,
  .docs-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .header-title {
    display: none;
  }

  .version-badge {
    margin-right: auto;
  }

  .mobile-nav {
    position: sticky;
    z-index: 90;
    top: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(249, 250, 251, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }

  .mobile-nav label {
    flex: 0 0 auto;
    color: var(--secondary);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-nav select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--input-border);
    border-radius: 9px;
  }

  .docs-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 72px);
  }

  .hero-section {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 600px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .header-inner,
  .docs-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy small {
    display: none;
  }

  .mobile-nav {
    padding-right: 14px;
    padding-left: 14px;
  }

  .mobile-nav label {
    display: none;
  }

  .doc-section {
    padding: 54px 0;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 26px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    text-align: center;
  }

  .hero-card {
    padding: 4px 16px;
  }

  .hero-card > div {
    min-height: 60px;
  }

  .callout {
    padding: 15px;
  }

  .section-heading {
    gap: 10px;
  }

  .response-fields,
  .split-cards {
    grid-template-columns: 1fr;
  }

  .endpoint-bar {
    gap: 8px;
    padding: 9px;
  }

  .endpoint-bar code {
    font-size: 10px;
  }

  th,
  td {
    padding: 11px 12px;
  }

  pre code {
    padding: 15px;
    font-size: 10.5px;
  }

  .docs-footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .sidebar,
  .mobile-nav,
  button,
  .copy-toast {
    display: none !important;
  }

  .docs-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .doc-section {
    break-inside: avoid;
  }

  .code-panel {
    position: static;
    break-inside: avoid;
  }
}
