/* --------------------------------------------------------------------------
   Public form.

   Every value here is lifted from the original bundle's inline styles, so the
   server-rendered page matches it. Where the original set a style through a JS
   object (baseInputStyle, wrapBase, selectWrapBase, caretStyle, errStyle,
   textareaStyle) the equivalent class carries the same declarations.

   Vazirmatn is self-hosted from the woff2 files that were embedded in the
   original bundle -- same font, no Google Fonts request.
   -------------------------------------------------------------------------- */

/* Variable font: one file per subset covers every weight the page uses. */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4,
    U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24,
    U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47,
    U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59,
    U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A,
    U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89,
    U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-latin.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;
}

* { box-sizing: border-box; font-family: 'Vazirmatn', sans-serif; }

body { margin: 0; background: oklch(0.1 0.005 260); }

input::placeholder, textarea::placeholder { color: oklch(0.5 0.01 250); }
select { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  background: oklch(0.78 0.12 205);
  color: oklch(0.15 0.02 255);
  padding: 10px 18px;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}
.skip-link:focus { inset-inline-start: 0; }

/* --- shell ---------------------------------------------------------------- */

.app {
  min-height: 100vh;
  background: oklch(0.08 0.004 260);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* --- top bar -------------------------------------------------------------- */

.topbar {
  width: 100%;
  max-width: 1580px;
  margin: 24px 24px 0;
  background: oklch(0.13 0.015 255);
  border-radius: 20px;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { color: oklch(0.95 0.01 250); font-size: 17px; font-weight: 700; }
.brand-tag { color: oklch(0.65 0.02 250); font-size: 12px; font-weight: 600; }

.topnav { display: flex; align-items: center; gap: 28px; }
.topnav a { color: oklch(0.9 0.01 250); font-size: 14px; text-decoration: none; }

/* Placeholder slots the original left for a logo and a hero image. */
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed oklch(0.35 0.02 255);
  color: oklch(0.55 0.02 250);
  font-size: 11px;
  text-align: center;
  overflow: hidden;
}
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot-logo { width: 34px; height: 34px; border-radius: 8px; }

/* Uploaded logo occupies exactly the placeholder's box. */
.brand-logo {
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.slot-hero { width: 340px; height: 190px; flex-shrink: 0; border-radius: 14px; }

/* Uploaded hero image occupies exactly the placeholder's box. */
.hero-img {
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

/* --- language switcher ---------------------------------------------------- */

/* Language dropdown. <details>/<summary> gives the open/close behaviour and
   keyboard handling for free; these rules make it look like the original's
   custom panel. */
.lang { position: relative; }

.lang > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  color: oklch(0.9 0.01 250);
  font-size: 13px;
  user-select: none;
}
/* Remove the native disclosure triangle in every engine. */
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::marker { content: ''; }
.lang > summary:focus-visible {
  outline: 2px solid oklch(0.78 0.12 205);
  outline-offset: 4px;
  border-radius: 6px;
}

.lang-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid oklch(0.75 0.01 250);
  transition: transform .15s;
}
.lang[open] .lang-caret { transform: rotate(180deg); }

.lang-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 150px;
  background: oklch(0.17 0.02 255);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
  z-index: 20;
  box-shadow: 0 12px 30px oklch(0 0 0 / 0.4);
  overflow: hidden;
}
.lang-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 14px;
  color: oklch(0.92 0.01 250);
  text-decoration: none;
  white-space: nowrap;
}
.lang-panel a:hover { background: oklch(0.22 0.02 255); }
.lang-panel a[aria-current="page"] { color: oklch(0.78 0.12 205); }

.flag { border-radius: 2px; object-fit: cover; display: block; flex-shrink: 0; }

/* --- hero ----------------------------------------------------------------- */

.hero-wrap {
  width: 100%;
  padding: 32px 24px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.blob {
  position: absolute;
  top: -260px;
  right: -120px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    oklch(0.32 0.05 240), oklch(0.14 0.03 250) 55%, transparent 75%);
  opacity: 0.55;
  filter: blur(1px);
  pointer-events: none;
}
.dot { position: absolute; border-radius: 50%; background: oklch(0.6 0.02 250); }
.dot-a { top: 38px; left: 38%; width: 5px; height: 5px; opacity: 0.6; }
.dot-b { top: 20px; left: 63%; width: 4px; height: 4px; opacity: 0.4; }

.hero {
  position: relative;
  width: 100%;
  max-width: 1580px;
  margin-bottom: 28px;
  padding: 0 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
}
.hero-text {
  color: oklch(0.92 0.01 250);
  font-size: 19px;
  line-height: 2;
  text-align: start;
  max-width: 900px;
  margin: 0;
}
/* The page's real heading. The original had no h1 at all, so nothing told a
   crawler what this page is; it is styled to sit in the hero without changing
   the visual weight the design had. */
.hero-title {
  margin: 0 0 14px;
  color: oklch(0.96 0.01 250);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
}

/* --- card ----------------------------------------------------------------- */

.card {
  position: relative;
  width: 100%;
  max-width: 1580px;
  background: oklch(0.15 0.02 255 / 0.92);
  border-radius: 28px;
  padding: 44px 48px;
  box-shadow: 0 30px 80px oklch(0 0 0 / 0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px;
}

.col { display: flex; flex-direction: column; gap: 22px; }
.col-extra { gap: 14px; }
/* Columns 2..4 in the original carry a divider on their leading edge. */
.col-divided {
  border-inline-start: 1px solid oklch(0.32 0.02 255);
  padding-inline-start: 32px;
}

.col-title {
  color: oklch(0.78 0.12 205);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
}

/* --- fields --------------------------------------------------------------- */

label {
  display: block;
  color: oklch(0.92 0.01 250);
  font-size: 14px;
  margin-bottom: 8px;
}

.req { color: oklch(0.7 0.19 35); }

.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid oklch(0.55 0.02 250);
  color: oklch(0.65 0.02 250);
  font-size: 10px;
  cursor: help;
  vertical-align: middle;
}

.input,
.select {
  width: 100%;
  box-sizing: border-box;
  background: oklch(0.07 0 0);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
  padding: 13px 16px;
  color: oklch(0.92 0.01 250);
  font-size: 15px;
  outline: none;
}

.textarea {
  width: 100%;
  box-sizing: border-box;
  background: oklch(0.07 0 0);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
  padding: 13px 16px;
  color: oklch(0.92 0.01 250);
  font-size: 15px;
  outline: none;
  height: 230px;
  resize: none;
}

/* Bordered wrapper used by the date and phone fields. */
.wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: oklch(0.07 0 0);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
  padding: 13px 16px;
}
.wrap input {
  border: none;
  background: transparent;
  outline: none;
  color: oklch(0.92 0.01 250);
  font-size: 15px;
  flex: 1;
  padding: 0;
  font-family: inherit;
  min-width: 0;
}
.wrap-phone input { padding: 0 12px; }

.phone-code {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-inline-end: 10px;
  border-inline-end: 1px solid oklch(0.32 0.02 255);
  position: relative;
}
.phone-code select {
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  color: oklch(0.92 0.01 250);
  font-size: 14px;
  font-family: inherit;
  padding: 0 4px 0 0;
  cursor: pointer;
  /* Wide enough for "+998" without pushing the number field around. */
  width: 4.5em;
}

.select-wrap {
  position: relative;
  background: oklch(0.07 0 0);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
}
.select-wrap select {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 13px 40px 13px 16px;
  color: oklch(0.92 0.01 250);
  font-size: 15px;
  outline: none;
  appearance: none;
  font-family: inherit;
  cursor: pointer;
}
.select-wrap option { background: oklch(0.15 0.02 255); }

/* Country trigger keeps the flag beside the value, as the original did. */
.select-wrap-country {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: 48px;
}
.select-wrap-country select { padding: 13px 24px 13px 0; }

/* --- enhanced dropdown (flags in the list) -------------------------------- */
/* Only applies once the script has upgraded the control; without it the
   native select below is untouched and fully usable. */

.fx-enhanced .fx-native {
  /* Kept in the DOM so it still submits, but taken out of the layout. */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.fx-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: oklch(0.92 0.01 250);
  font-size: 15px;
  font-family: inherit;
  text-align: start;
  padding: 13px 40px 13px 16px;
}
.fx-trigger:focus-visible {
  outline: 2px solid oklch(0.78 0.12 205);
  outline-offset: -2px;
  border-radius: 12px;
}
.fx-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inside the country wrapper the flag already sits to the side. */
.select-wrap-country .fx-trigger { padding: 13px 24px 13px 0; }

/* The phone-code trigger is a compact "+98" next to the number field. */
.phone-code .fx-trigger {
  padding: 0 4px 0 0;
  width: auto;
  font-size: 14px;
  gap: 6px;
}

.fx-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  width: 100%;
  min-width: 230px;
  max-height: 260px;
  overflow-y: auto;
  background: oklch(0.17 0.02 255);
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 12px;
  z-index: 20;
  box-shadow: 0 12px 30px oklch(0 0 0 / 0.4);
  /* Scroll the list, not the page behind it. */
  overscroll-behavior: contain;
}
/* The dial-code panel hangs off a narrow trigger, so give it its own width. */
.phone-code .fx-panel { width: 230px; }

.fx-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: oklch(0.9 0.01 250);
  font-size: 14px;
}
.fx-option:hover,
.fx-option.is-active { background: oklch(0.22 0.02 255); }
.fx-option[aria-selected="true"] { color: oklch(0.78 0.12 205); }

.fx-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-dial { color: oklch(0.6 0.01 250); font-size: 13px; }
/* Keeps the placeholder row's text lined up with the flagged rows below it. */
.fx-spacer { width: 20px; flex-shrink: 0; }

.caret {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-30%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid oklch(0.7 0.02 250);
  pointer-events: none;
}
.caret-inline {
  position: static;
  transform: none;
  flex-shrink: 0;
}

.has-error { border-color: oklch(0.65 0.2 30); }

.err {
  color: oklch(0.65 0.2 30);
  font-size: 13px;
  margin-top: 6px;
}

.alert {
  color: oklch(0.65 0.2 30);
  font-size: 14px;
  border: 1px solid oklch(0.65 0.2 30);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
}

.privacy {
  color: oklch(0.6 0.02 250);
  font-size: 13px;
  margin: 24px 0 0;
  max-width: 80ch;
}

/* Honeypot: out of the layout without display:none, which bots check for. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions { margin-top: 36px; }

.btn {
  background: transparent;
  border: 1px solid oklch(0.78 0.12 205);
  color: oklch(0.78 0.12 205);
  padding: 14px 40px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: oklch(0.78 0.12 205 / 0.1); }
.btn:focus-visible { outline: 2px solid oklch(0.78 0.12 205); outline-offset: 2px; }

/* --- blog ("ماموریت ها") --------------------------------------------------- */

.posts-head { margin-bottom: 32px; }
.posts-head h1 {
  margin: 0 0 10px;
  color: oklch(0.96 0.01 250);
  font-size: 26px;
  font-weight: 700;
}
.posts-head .lede { color: oklch(0.65 0.02 250); margin: 0; }

.empty-note { color: oklch(0.6 0.02 250); padding: 32px 0; margin: 0; }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }

.post-card {
  border: 1px solid oklch(0.32 0.02 255);
  border-radius: 16px;
  padding: 24px 26px;
  background: oklch(0.12 0.015 258);
  transition: border-color .15s;
}
.post-card:hover { border-color: oklch(0.78 0.12 205); }

.post-card h2 { margin: 0 0 8px; font-size: 19px; font-weight: 700; line-height: 1.6; }
.post-card h2 a { color: oklch(0.94 0.01 250); text-decoration: none; }
.post-card h2 a:hover { color: oklch(0.78 0.12 205); }

.post-meta { margin: 0 0 12px; color: oklch(0.58 0.02 250); font-size: 13px; }

.post-blurb { margin: 0 0 14px; color: oklch(0.78 0.015 250); line-height: 1.9; }

.post-more { color: oklch(0.78 0.12 205); text-decoration: none; font-size: 14px; font-weight: 600; }
.post-more:hover { text-decoration: underline; }

.post-pager {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
  color: oklch(0.6 0.02 250);
  font-size: 14px;
}
.post-pager a { color: oklch(0.78 0.12 205); text-decoration: none; }

/* --- a single post --------------------------------------------------------- */

.card-article { max-width: 820px; margin-inline: auto; }

.crumbs { margin-bottom: 22px; font-size: 14px; }
.crumbs a { color: oklch(0.7 0.02 250); text-decoration: none; }
.crumbs a:hover { color: oklch(0.78 0.12 205); }

.article h1 {
  margin: 0 0 12px;
  color: oklch(0.96 0.01 250);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.5;
}

.article-summary {
  color: oklch(0.8 0.015 250);
  font-size: 17px;
  line-height: 1.9;
  margin: 0 0 28px;
  padding-inline-start: 16px;
  border-inline-start: 3px solid oklch(0.78 0.12 205);
}

/* Long-form reading: wider line height and a capped measure. */
.article-body { color: oklch(0.9 0.01 250); font-size: 16px; line-height: 2.1; }
.article-body p { margin: 0 0 20px; }
.article-body h2 { margin: 34px 0 14px; font-size: 21px; color: oklch(0.78 0.12 205); }
.article-body h3 { margin: 26px 0 12px; font-size: 18px; color: oklch(0.9 0.01 250); }
.article-body ul { margin: 0 0 20px; padding-inline-start: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: oklch(0.78 0.12 205); }
.article-body strong { font-weight: 700; color: oklch(0.96 0.01 250); }

/* --- success -------------------------------------------------------------- */

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 18px;
  text-align: center;
}
.success-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid oklch(0.78 0.12 205);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-check {
  width: 24px;
  height: 14px;
  border-left: 3px solid oklch(0.78 0.12 205);
  border-bottom: 3px solid oklch(0.78 0.12 205);
  transform: rotate(-45deg) translateY(-2px);
}
.success-title { color: oklch(0.96 0.01 250); font-size: 22px; font-weight: 600; margin: 0; }
.success-body { color: oklch(0.65 0.02 250); font-size: 15px; margin: 0; }
.success-ref-label { color: oklch(0.65 0.02 250); font-size: 13px; margin: 6px 0 0; }
.success-ref {
  margin: 0;
  color: oklch(0.78 0.12 205);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  user-select: all;
}
.success .btn { margin-top: 12px; padding: 12px 32px; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .hero { flex-direction: column; align-items: stretch; }
  .slot-hero { width: 100%; }
  .card { padding: 32px 20px; }
  /* Dividers become horizontal rules once the columns stack. */
  .col-divided {
    border-inline-start: none;
    padding-inline-start: 0;
    border-top: 1px solid oklch(0.32 0.02 255);
    padding-top: 28px;
  }
}

@media (max-width: 640px) {
  .topbar { margin: 12px 12px 0; padding: 14px 18px; flex-wrap: wrap; gap: 14px; }
  .hero-wrap { padding: 24px 12px 40px; }
  .hero-text { font-size: 17px; }
  .topnav { display: none; }
}

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