/* ELLSMS — پنل هوشمند پیامک
   طراحی بر پایه‌ی رنگ برند داتیس: فیروزه‌ای تیره (teal)، با تایپوگرافی
   فارسی یکدست (وزیرمتن) که سلسله‌مراتب را با وزن و اندازه می‌سازد، نه با
   ترکیب چند فونت. اعداد تاریخ و زمان همیشه فارسی؛ شماره‌موبایل و اعداد خام
   (اعتبار، کد) به‌صورت لاتین و چپ‌به‌راست ایزوله می‌مانند تا خوانا و
   کپی‌پذیر بمانند. */

/* Self-hosted Vazirmatn. This was previously an external webfont import; the
   font is now served from this application's own assets, so the panel has no
   runtime dependency on any third-party font service. All @font-face rules live
   in fonts.css and nowhere else. */
@import url('/assets/css/fonts.css');

:root {
  /* Brand teal (DATIS logo). The names --indigo / --blue are historical: every component and the
     reseller white-label override (brand_color_style() in app/ResellerPanel.php) read them, so they
     keep their names. --indigo is the accent for text, active states and solid buttons (5.9:1 on
     white, 5.3:1 on --tint); --blue is links and focus rings (4.9:1 on white). */
  --indigo: #076f7a;
  --blue:   #0a7d89;
  --ink:    #0b1023;
  --muted:  #5c657d; /* ≥4.5:1 on --card, --canvas, --tint and --line (was #666f87: 4.46 on --tint) */
  --line:   #e1ebec;
  --canvas: #f4f8f9;
  --tint:   #e8f6f7;
  --card:   #ffffff;
  --ok:     #157347;  --ok-bg:   #e7f8ef;
  --warn:   #b45309;  --warn-bg: #fdf3e3;
  --err:    #c0223a;  --err-bg:  #fdeaee;
  --grad: linear-gradient(120deg, var(--indigo), var(--blue));
  /* Accent tints derived from --indigo, so a reseller's own brand colour recolours them too. */
  --accent-50:  color-mix(in srgb, var(--indigo) 6%, #fff);
  --accent-100: color-mix(in srgb, var(--indigo) 11%, #fff);
  --accent-200: color-mix(in srgb, var(--indigo) 20%, #fff);
  --accent-300: color-mix(in srgb, var(--indigo) 36%, #fff);
  --accent-hover: color-mix(in srgb, var(--indigo) 82%, #000);
  /* --lp-accent is a text/icon accent for the public marketing pages only.
     It defaults to --indigo (a no-op everywhere else) and is overridden to a
     brighter violet inside .lp-body's dark theme below, where plain --indigo
     text would not have enough contrast against a near-black page. */
  --lp-accent: var(--indigo);
  /* --font-ui is THE default typeface of the panel. Everything that renders
     prose, labels, buttons, tables and form controls resolves to this. Tahoma
     is the first fallback because it ships with Windows and covers Persian, so
     a failed font load degrades to something readable rather than to a Latin
     face that cannot draw Persian at all. */
  --font-ui: 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif;

  /* --font-mono is for DIAGNOSTIC values only: provider_message_id, API keys,
     hashes, request IDs, JSON. These need fixed-width digits so a 19-digit
     reference can be read and compared character by character. Vazirmatn is
     deliberately NOT in this stack — it is proportional, and listing it first
     (as this variable previously did) meant "monospace" values were never
     actually monospaced. */
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* --font-num is for DISPLAY numerals: dashboard stat values, price amounts,
     chart labels. These are branded headline numbers, not diagnostic strings —
     they want the UI face, kept LTR and tabular so digits align in a column.
     This is what the old --mono was actually being used for at those sites, so
     they keep their exact current appearance. */
  --font-num: var(--font-ui);

  /* Legacy aliases, kept so existing call sites work without renaming unrelated
     CSS. --mono maps to --font-num (its historical behaviour: Vazirmatn first)
     rather than to --font-mono, so repointing diagnostics to a true monospace
     does not silently restyle the dashboard's headline numbers. */
  --font: var(--font-ui);
  --mono: var(--font-num);

  /* ====================================================================
     TYPE SCALE — the panel's only permitted font sizes.
     --------------------------------------------------------------------
     Before this existed the panel used about twenty hardcoded sizes, five
     of them half-pixel values (11.5, 12.5, 13.5, 14.5, 15.5). Differences
     that small are invisible on their own but read, collectively, as an
     interface that was never measured: nothing lines up with anything, and
     hierarchy comes out of nowhere. These eight steps are a real scale —
     each one is distinguishable from its neighbour, and every panel rule
     below resolves to one of them. Adding a ninth size, or writing a px
     value at a call site, puts the panel back where it started.

     The landing pages (.lp-*) are a separate, display-oriented layout and
     deliberately keep their own larger sizes; this scale is for the panel. */
  --fs-2xs:  11px;  /* micro meta: chart axis labels, field provenance */
  --fs-xs:   12px;  /* table headers, hints, badges, captions */
  --fs-sm:   13px;  /* form labels, small buttons, pills */
  --fs-base: 14px;  /* table cells — the panel's densest running text */
  --fs-md:   15px;  /* body prose, form controls */
  --fs-lg:   17px;  /* card titles */
  --fs-xl:   20px;  /* page title */
  --fs-2xl:  26px;  /* dashboard stat values */

  /* LINE HEIGHTS. One global value cannot serve both a paragraph of Persian
     prose and a table of delivery statuses. 1.85 everywhere (the previous
     setting) made every dense surface sprawl. Three named values instead,
     each applied where it belongs. */
  --lh-tight: 1.3;   /* stat values, page title — single-line display text */
  --lh-snug:  1.5;   /* tables, labels, controls, badges — dense UI */
  --lh-base:  1.65;  /* running prose and hints, still comfortable in Persian */

  /* SPACING — a 4px grid, for the same reason the type scale exists. */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { direction: rtl; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--ink);
  font-feature-settings: "ss01" 1;
  background:
    radial-gradient(circle at 6% 4%, rgba(7,111,122,.05), transparent 32%),
    radial-gradient(circle at 96% 96%, rgba(17,184,197,.06), transparent 32%),
    var(--canvas);
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* GLOBAL TYPOGRAPHY FLOOR.
   Form controls are the reason this block exists: browsers do NOT inherit
   font-family into <input>, <select>, <textarea>, <button> or <option> from
   body — the UA stylesheet substitutes a system face — so without naming them
   explicitly the panel's inputs would silently render in a different font from
   everything around them. <option> is listed because Windows in particular
   styles dropdown items from the UA sheet rather than from the <select>.
   Declared once here rather than repeated per component. */
html,
body,
button,
input,
select,
textarea,
option,
optgroup,
table,
th,
td,
a,
label,
legend,
fieldset,
dialog,
[role="dialog"] {
  font-family: var(--font-ui);
}

/* Latin/Western digits (phone numbers, raw amounts) stay LTR & isolated
   so they don't get visually reversed inside RTL text. */
.ltr, .msisdn, .num, code.kbd {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* DIAGNOSTIC VALUES — genuinely fixed-width.
   provider_message_id, API keys, hashes, request IDs, gateway/route codes and
   JSON are read character by character and compared against a provider's
   dashboard, so every glyph must occupy the same width. A 19-digit reference
   such as 4473621976262727360 is only checkable by eye when its digits line up.
   These values are strings, never numbers: word-break keeps a long reference
   inside its table cell instead of widening the row, and tabular-nums stops a
   proportional '1' from making two equal-length IDs look different lengths.
   CSS affects presentation only — the underlying value is never altered.

   Placed AFTER the .ltr/.msisdn rule above on purpose: an element carrying both
   (e.g. class="ltr provider-ref") must resolve to the monospace face, and these
   selectors tie on specificity, so source order decides. code.kbd is the one
   deliberate exception — it is a keyboard hint in running prose, not a value to
   transcribe — and it keeps the UI face via its higher specificity above. */
.mono, code, kbd, samp, pre,
.provider-ref, .api-key, .hash, .request-id,
input.mono, textarea.mono, input.provider-ref, textarea.api-key {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}
.provider-ref, .api-key, .hash, .request-id {
  word-break: break-all;
  user-select: all;
}

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex: 0 0 240px;
  background: var(--ink);
  color: #cfd4ea;
  display: flex; flex-direction: column;
}
.sidebar::before {
  content: ""; display: block; height: 4px;
  background: var(--grad);
}
.brand { display: block; padding: 20px 18px 10px; }
.brand img { width: 100%; border-radius: 12px; background: #fff; }
.nav-label {
  font-size: var(--fs-xs); letter-spacing: .02em;
  color: #8892b3; padding: 20px 20px 8px;
  position: relative; font-weight: 600;
}
.nav-label::after {
  content: ""; position: absolute; right: 20px; bottom: 3px;
  width: 24px; height: 2px; background: var(--grad); border-radius: 2px;
}
/* Collapsible sidebar groups (app/views/header.php): the label is the <summary>. */
.nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  transition: color .15s ease;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover,
.nav-group.has-active > summary { color: #cfd4ea; }
.nav-group > summary:focus-visible { outline: 2px solid rgba(255,255,255,.45); outline-offset: -2px; }
.nav-chevron {
  margin-inline-start: auto; width: 7px; height: 7px;
  border-inline-start: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(135deg); transition: transform .15s ease; opacity: .8;
}
.nav-group[open] > summary .nav-chevron { transform: rotate(45deg); }
.nav-group > .nav-item:last-child { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .nav-chevron, .nav-group > summary { transition: none; } }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px; color: #cfd4ea; font-weight: 500;
  transition: background-color .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-item.is-active {
  background: var(--grad); color: #fff;
  box-shadow: inset -3px 0 0 rgba(255,255,255,.55);
}
.nav-icon { width: 18px; text-align: center; opacity: .9; }
.sidebar-foot { margin-top: auto; padding: var(--sp-4) var(--sp-5); font-size: var(--fs-xs); color: #6f7899; direction: ltr; text-align: right; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 26px; position: sticky; top: 0; z-index: 5;
}
.page-title { font-size: var(--fs-xl); line-height: var(--lh-tight); margin: 0; font-weight: 800; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.credit-pill {
  background: var(--tint); color: var(--indigo);
  border-radius: 999px; padding: 6px 14px; font-size: var(--fs-sm); font-weight: 600;
}
.user-chip { color: var(--muted); font-size: var(--fs-base); }

/* Mobile menu toggle — hidden on desktop, shown via the media query below */
.menu-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 40px; height: 40px; flex: 0 0 40px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; padding: 0;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

.sidebar-backdrop { display: none; }

.content { padding: var(--sp-5); max-width: 1200px; width: 100%; }

/* ---------- Cards / grid ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: var(--sp-5); margin-bottom: var(--sp-4);
  box-shadow: 0 1px 2px rgba(11,16,35,.04), 0 10px 28px rgba(11,16,35,.035);
  transition: box-shadow .15s ease;
}
.card h2 { margin: 0 0 var(--sp-4); font-size: var(--fs-lg); line-height: var(--lh-tight); font-weight: 700; }
.grid { display: grid; gap: var(--sp-4); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: var(--sp-4) var(--sp-5);
}
.stat .stat-label { font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--muted); font-weight: 600; }
/* tabular-nums is the whole point of a stat row: without it Vazirmatn sets
   digits proportionally, so four figures stacked in a 4-up grid each start at a
   different optical position and the row reads as crooked. The .ltr/.msisdn rule
   above already does this for phone numbers and amounts; these headline numerals
   were the one place that never got it. */
.stat .stat-value {
  font-size: var(--fs-2xl); line-height: var(--lh-tight); font-weight: 800;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  margin-top: var(--sp-1); direction: ltr; unicode-bidi: isolate; display: block; text-align: right;
}
/* Unit beside a headline count («۱۲۳ پارت»): the number carries the weight, the unit stays quiet.
   .stat-value is LTR, so the unit comes first in the source and is bidi-isolated: it then sits on
   the number's left, which is where Persian reads it. */
.stat .stat-value .stat-unit {
  font-family: inherit; font-size: var(--fs-xs); font-weight: 500; opacity: .75; unicode-bidi: isolate;
}
.stat.stat-accent { background: var(--grad); border: 0; color: #fff; }
.stat.stat-accent .stat-label { color: #d8f3f5; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: var(--fs-sm); line-height: var(--lh-snug); margin-bottom: var(--sp-3); }
/* The control used to be 16px against a 13.5px label, which inverted the
   hierarchy: the empty box shouted louder than the question it was asking.
   15px sits just above the label and just below body prose, so a form reads
   label → value instead of the other way round. */
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], select, textarea {
  width: 100%; margin-top: var(--sp-1);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-family: inherit; font-size: var(--fs-md); line-height: var(--lh-snug);
  background: #fff; color: #0b1023;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* ...except on a touch device, where iOS Safari zooms the whole viewport when a
   focused control is under 16px. Keyed to the pointer, not to a width: an iPad
   in landscape is wider than any phone breakpoint and still zooms. */
@media (pointer: coarse) {
  input[type=text], input[type=password], input[type=number], input[type=email],
  input[type=date], select, textarea { font-size: 16px; }
}
textarea { min-height: 112px; resize: vertical; }
/* NATIVE DROPDOWN LISTS. Firefox draws a <select>'s open list outside the page, from the options'
   own computed styles. Left implicit, the list came up blank in the RTL panel — empty white rows
   and a cut-off grey highlight — because the right-aligned option text was laid out off the visible
   edge and the list took the OS (possibly dark) theme's text colour against the select's white
   background. Naming the scheme, colours and direction on the options keeps every dropdown
   readable whatever the browser or system theme. */
html { color-scheme: light; }
select option, select optgroup {
  color: #0b1023; background-color: #fff;
  direction: rtl; text-align: right; unicode-bidi: plaintext;
  white-space: normal;
}
select option:disabled { color: #8a94ab; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(10,125,137,.15); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); line-height: var(--lh-base); margin-top: var(--sp-1); }
/* The rules of a new password (password_policy_hint_html()); assets/js/password-policy.js marks each
   line .is-ok / .is-bad while the user types. */
.pw-rules { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); line-height: var(--lh-base); margin-top: var(--sp-1); }
.pw-rules-title { display: block; }
.pw-rule { display: block; padding-inline-start: 1.4em; position: relative; }
.pw-rule::before { content: "•"; position: absolute; inset-inline-start: .3em; }
.pw-rule.is-ok { color: var(--ok); }
.pw-rule.is-ok::before { content: "✓"; }
.pw-rule.is-bad { color: var(--err); }
.pw-rule.is-bad::before { content: "✕"; }

.btn {
  display: inline-block; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 18px; font: inherit; font-weight: 700; line-height: var(--lh-snug); cursor: pointer;
  background: #fff; color: var(--ink);
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); border: 0; color: #fff; }
.btn-danger  { background: var(--err-bg); color: var(--err); border-color: #f4c9d1; }
.btn-ghost   { border-color: var(--line); color: var(--muted); }
.btn-sm      { padding: 5px 12px; font-size: var(--fs-sm); border-radius: 7px; }
.btn-block   { width: 100%; }

/* Persian date / time pickers (three selects) */
.jdate, .jtime { display: inline-flex; gap: 6px; align-items: center; }
.jdate select, .jtime select { width: auto; margin-top: 0; padding: 8px 8px; }
.jtime-sep { color: var(--muted); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
/* Tables carry their own line-height: inheriting body prose spacing made a
   twenty-row report twice as tall as it needed to be, which is the single
   biggest reason the panel felt loose. */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); line-height: var(--lh-snug); }
th, td { text-align: right; padding: var(--sp-2) 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); white-space: nowrap; }
tr:hover td { background: #f9f9ff; }

/* ---------- Badges / flash ---------- */
.badge { display: inline-block; border-radius: 999px; padding: 3px 12px; font-size: var(--fs-xs); line-height: var(--lh-snug); font-weight: 700; }
.badge-active, .badge-ok, .badge-delivered { background: var(--ok-bg); color: var(--ok); }
.badge-pending, .badge-processing { background: var(--warn-bg); color: var(--warn); }
.badge-failed, .badge-send_failed, .badge-undelivered, .badge-cancelled, .badge-off { background: var(--err-bg); color: var(--err); }
.badge-done, .badge-user, .badge-sent { background: var(--tint); color: var(--indigo); }
.badge-unknown { background: var(--line); color: var(--muted); }
/* Reached the operator, but the delivery report says it never reached the phone (bulk job page). */
.badge-not-delivered { background: #ffedd5; color: #b45309; }
.badge-admin { background: var(--ink); color: #fff; }
/* «مشتری ویژه» (app/VipCustomers.php): a gold badge, and a warm tint with a gold edge on the customer's
   rows in admin lists and reports. */
.badge-vip { background: #fff1c2; color: #8a5a00; border: 1px solid #f2c94c; white-space: nowrap; }
tr.row-vip > td, tr.row-vip > th { background: #fff9e6; }
tr.row-vip > :first-child { box-shadow: inset -4px 0 0 #f2c94c; }
tr.row-vip:hover > td, tr.row-vip:hover > th { background: #fff3cc; }
.vip-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }

.badge-open { background: var(--warn-bg); color: var(--warn); }
.badge-answered { background: var(--tint); color: var(--indigo); }
.badge-closed { background: var(--ok-bg); color: var(--ok); }

/* ---------- Send confirmation modal (inline, same-page — see cost_preview.php) ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(11,16,35,.5); backdrop-filter: blur(2px);
  align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal-overlay.is-open { display: flex; }
.modal-dialog {
  width: 100%; max-width: 640px; margin: auto 0;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(11,16,35,.28);
  animation: modal-in .18s ease;
}
.modal-dialog .card { margin-bottom: 0; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ticket-thread { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.ticket-msg { padding: 12px 16px; border-radius: 10px; background: var(--tint); }
.ticket-msg.is-admin { background: var(--ink); color: #fff; }
.ticket-msg-meta { font-size: var(--fs-xs); opacity: .7; margin-bottom: 6px; }

.flash { border-radius: 11px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error   { background: var(--err-bg); color: var(--err); }
.flash-info    { background: var(--tint); color: var(--indigo); }

/* ---------- Simple bar chart (dashboard, no JS) ---------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.bar .bar-fill { background: var(--grad); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar .bar-x { font-size: var(--fs-2xs); color: var(--muted); margin-top: 6px; }
.bar .bar-v { font-size: var(--fs-2xs); font-family: var(--mono); direction: ltr; color: var(--ink); margin-bottom: 4px; }
/* Dashboard: recent bulk jobs with live progress */
.dash-jobs { display: grid; gap: 10px; }
.dash-job { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.dash-job:hover { border-color: var(--indigo); background: var(--tint); }
.dash-job-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dash-job-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-progress { display: flex; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.dash-progress-ok { background: var(--grad); }
.dash-progress-bad { background: var(--err); }
.dash-job-meta { margin-top: 6px; font-size: var(--fs-xs); }

/* ---------- Login ---------- */
.login-body {
  /* Sign-up, 2FA, logout and the other pages around sign-in share the login page's turquoise and
     graphite (public/assets/css/login.css) rather than the panel's indigo. Scoped to .login-body,
     so the logged-in panel is unchanged. A reseller's host overrides --login-brand. */
  --indigo: var(--login-brand, #087f8c);
  --blue: var(--login-brand, #11b8c5);
  --grad: linear-gradient(var(--login-brand, #11b8c5), var(--login-brand, #11b8c5));
  --ink: #25292b;
  --muted: #697477;
  --line: #e4eaeb;
  --canvas: #f8fafa;
  --tint: #e7f8fa;
  --font-ui: 'Estedad', 'Vazirmatn', Tahoma, Arial, sans-serif;
  --font: var(--font-ui);
  font-family: var(--font-ui);
  display: grid; place-items: center; min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(17, 184, 197, .10), transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(37, 41, 43, .05), transparent 40%),
    var(--canvas);
}
.login-body .btn-primary { color: var(--login-on-brand, #25292b); }
.login-body .btn-primary:hover { background: var(--login-brand-hover, #087f8c); color: #fff; }
.login-card {
  width: min(410px, 92vw); background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 30px;
  box-shadow: 0 24px 60px rgba(11,16,35,.10);
  position: relative;
}
.login-card::before {
  content: ""; position: absolute; top: -4px; left: -1px; right: -1px; height: 4px;
  background: var(--grad); border-radius: 18px 18px 0 0;
}
.login-logo { width: 74%; display: block; margin: 0 auto 16px; }
.login-foot { text-align: center; color: var(--muted); font-size: var(--fs-xs); margin: 16px 0 0; }
.login-foot a, .login-sub a { text-decoration: underline; text-underline-offset: 3px; }
.login-sub { text-align: center; color: var(--muted); margin: -8px 0 16px; font-size: var(--fs-sm); }

/* ---------- Misc ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.toolbar > * { margin-bottom: 0; }
.pagination { display: flex; gap: 8px; margin-top: 16px; }
.pager { flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; }
.pager .btn { min-width: 36px; justify-content: center; }
.pager .is-disabled { opacity: .45; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { color: var(--muted); font-size: var(--fs-sm); margin-inline-start: 8px; }
.pager-jump { display: flex; align-items: center; gap: 6px; margin: 0 0 0 0; margin-inline-start: 8px; }
.pager-jump label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.pager-jump input { width: 80px; padding: 5px 8px; margin: 0; }
.msg-preview { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); text-align: center; padding: 34px 0; }

/* ---------- Profile / KYC — account-type switcher ---------- */
.segmented {
  display: inline-flex; background: var(--canvas); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; gap: 4px;
}
.segmented input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label {
  margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 22px; border-radius: 9px; font-size: var(--fs-base); font-weight: 700; color: var(--muted);
  cursor: pointer; transition: background .15s ease, color .15s ease; user-select: none;
}
.segmented input[type=radio]:checked + label { background: #fff; color: var(--indigo); box-shadow: 0 1px 2px rgba(11,16,35,.08); }
.segmented input[type=radio]:disabled + label { cursor: default; opacity: .6; }
.segmented input[type=radio]:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Profile — read-only / central-system fields ---------- */
.field-readonly { position: relative; }
.field-readonly input,
input[type=text][readonly], input[type=text]:disabled,
select:disabled { background: var(--canvas); color: var(--muted); cursor: not-allowed; }
.field-source { font-weight: 400; color: var(--muted); font-size: var(--fs-2xs); margin-inline-start: 6px; }

/* ---------- Profile — summary/overview strip ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.summary-item { background: var(--canvas); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.summary-item .summary-label { font-size: var(--fs-2xs); color: var(--muted); font-weight: 700; }
.summary-item .summary-value { font-size: var(--fs-md); line-height: var(--lh-snug); font-weight: 700; margin-top: 4px; word-break: break-word; }
.summary-item .summary-value.ltr { direction: ltr; unicode-bidi: isolate; display: block; text-align: right; }

/* ---------- Profile — sub-sections within one card ---------- */
.subsection { margin-bottom: 22px; }
.subsection:last-child { margin-bottom: 0; }
/* «حقیقی / حقوقی» parts (app/views/customer_identity_fields.php) — also outside .panel, e.g. /register. */
[data-when-type][hidden] { display: none !important; }
.subsection-title {
  font-size: var(--fs-sm); font-weight: 800; color: var(--indigo); margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.subsection-title::before { content: ""; width: 4px; height: 14px; border-radius: 3px; background: var(--grad); display: inline-block; }

/* ---------- Structured forms ----------
   One layout for every long form: a card is split into titled .form-section blocks, each a
   .form-grid of fields (three columns on desktop, two on tablet, one on phone), and closes with a
   single .form-actions row. Fields line up across rows because every one is the same grid cell —
   the old auto-fit rows and inline date pickers made each row wrap at a different point. */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.card-head h2 { margin: 0; }
.card-head .hint { margin: var(--sp-1) 0 0; }
.form-section + .form-section { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
/* A section that is a <fieldset> (so it can be disabled as a whole) looks like any other section. */
fieldset.form-section { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid > label, .form-grid > .field { margin-bottom: 0; min-width: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-full { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  .form-grid, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .form-grid, .form-grid.cols-2, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
/* A date inside a form grid fills its cell like any other control: year | month | day. */
.form-grid .jdate { display: flex; width: 100%; margin-top: var(--sp-1); }
.form-grid .jdate select { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
.form-grid .jdate .jdate-m { flex-grow: 1.5; }
.form-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.form-actions .hint { margin: 0; }
/* A checkbox option sized like a text field, so it sits on the same row line as its neighbours. */
.form-grid > label.check, label.check {
  display: flex; align-items: center; gap: var(--sp-2); align-self: end;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); cursor: pointer;
}
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--indigo); flex: none; }
/* A wrapping list of checkbox options (the contact form's groups); scrolls once it gets long. */
.group-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); max-height: 220px; overflow-y: auto; padding: 2px; }
.group-picker label.check { padding: 6px 10px; margin: 0; font-weight: 400; }
.req { color: var(--err); margin-inline-start: 2px; }
/* The caption of a field that is not a single control (e.g. a segmented radio group). */
.field-label { display: block; font-weight: 600; font-size: var(--fs-sm); line-height: var(--lh-snug); margin-bottom: var(--sp-1); }
/* ---------- Tabs ----------
   A long page (user editor, account profile) shows one section at a time. Without JavaScript every
   panel stays visible, one after another; assets/js/forms.js adds .is-ready and hides the rest. */
.tabs-nav {
  display: flex; gap: var(--sp-1); overflow-x: auto; scrollbar-width: thin;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--sp-1); margin-bottom: var(--sp-4);
}
.tabs-nav button {
  appearance: none; border: 0; background: none; border-radius: 9px; cursor: pointer;
  padding: 8px 16px; font: inherit; font-size: var(--fs-sm); font-weight: 700; line-height: var(--lh-snug);
  color: var(--muted); white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.tabs-nav button:hover { color: var(--ink); background: var(--canvas); }
.tabs-nav button[aria-selected="true"] { background: var(--grad); color: #fff; }
.tabs-nav .tab-count { font-weight: 400; opacity: .8; margin-inline-start: 4px; }
.tabs.is-ready > .tab-panel:not(.is-active) { display: none; }
.tab-panel > .card:last-child, .tab-panel > .grid:last-child { margin-bottom: 0; }

/* ---------- KYC document tiles ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.doc-tile {
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column; transition: box-shadow .15s ease;
}
.doc-tile:hover { box-shadow: 0 6px 18px rgba(11,16,35,.06); }
.doc-tile-thumb {
  height: 128px; background: var(--canvas); display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); overflow: hidden; position: relative;
}
.doc-tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-tile-icon { font-size: 34px; opacity: .35; }
.doc-tile-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.doc-tile-title { font-size: var(--fs-sm); font-weight: 700; }
.doc-tile-note { font-size: var(--fs-xs); color: var(--err); background: var(--err-bg); border-radius: 8px; padding: 6px 9px; }
.doc-tile-foot { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--canvas); }
.doc-tile-foot form { display: flex; align-items: center; gap: 8px; margin: 0; }

/* A styled stand-in for the raw file input: the native <input type=file> is visually hidden and its
   label takes over as a normal-looking button, with the chosen filename echoed beside it via a tiny
   inline script (no upload/validation behavior changes — purely cosmetic). */
.file-picker { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.file-picker input[type=file] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.file-picker-btn {
  flex: 0 0 auto; border: 1px dashed var(--line); border-radius: 8px; background: var(--tint);
  color: var(--indigo); font-size: var(--fs-xs); font-weight: 700; padding: 7px 12px; cursor: pointer; white-space: nowrap;
}
.file-picker-name { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .menu-toggle { display: flex; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; right: 0; height: 100vh;
    width: min(78vw, 300px); flex: 0 0 auto;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 60;
    box-shadow: -12px 0 32px rgba(11,16,35,.18);
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(11,16,35,.42);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 55;
  }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .brand img { width: 170px; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .page-title { font-size: var(--fs-lg); }

  /* Comfortable touch targets */
  .nav-item { padding: 13px 20px; font-size: var(--fs-md); }
  .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 34px; }
}

@media (max-width: 480px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .card { padding: 16px; border-radius: 12px; }
  .topbar { padding: 10px 12px; }
  .page-title { font-size: var(--fs-lg); }
  .credit-pill { font-size: var(--fs-xs); padding: 5px 11px; }
  .user-chip { font-size: var(--fs-sm); }
  table { font-size: var(--fs-sm); }
  th, td { padding: 8px 8px; }
  .stat .stat-value { font-size: var(--fs-xl); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar > * { width: 100%; }
  .doc-grid, .summary-grid { grid-template-columns: 1fr; }
  .segmented { display: flex; }
  .segmented label { flex: 1; }
}

/* ---------- Marketing landing page ---------- */
/* White / charcoal / turquoise theme for the public marketing pages (landing, about,
   contact, guide, legal) — scoped to .lp-body so the logged-in dashboard (a plain <body>,
   no class, defined via app/views/header.php) keeps its own colours. Nearly every landing
   component reads var(--card)/var(--line)/var(--ink)/var(--muted)/var(--canvas)/var(--tint),
   so the tokens below paint the page, and the charcoal bands re-declare them light-on-dark.
   See docs/landing.md#colours-public-site-and-sign-in-pages. */
.lp-body {
  overflow-x: hidden;
  /* DATIS public-site identity (docs/landing.md#colours-public-site-and-sign-in-pages):
     60% white/near-white surfaces, 30% graphite type and structure, 10% turquoise taken from the
     cyan-turquoise triangle of the DATIS logo. Defined here, not on :root, so the logged-in panel
     keeps its own colours. Primary buttons are turquoise with graphite text (6.1:1); on hover they
     turn deep turquoise with white text (4.75:1). Small turquoise text uses --primary-ink. */
  --background: #f8fafa;
  --surface: #ffffff;
  --foreground: #25292b;
  --muted-foreground: #697477;
  --primary: #11b8c5;
  --primary-hover: #087f8c;
  --primary-ink: #076f7a;
  --primary-light: #e7f8fa;
  --primary-border: #b8e8ec;
  --border: #e4eaeb;
  --dark-surface: #25292b;
  --dark-surface-2: #1d2123;

  /* Older names the public components already read, mapped onto the tokens above. */
  --t-500: var(--primary);
  --t-600: #0e9aa6;
  --t-ink: var(--primary-hover);
  --t-300: #6fd6df;
  --t-50:  var(--primary-light);
  --charcoal: var(--dark-surface);
  --charcoal-deep: var(--dark-surface-2);
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --line: var(--border);
  --canvas: var(--background);
  --tint: var(--primary-light);
  --card: var(--surface);
  --lp-accent: var(--primary-ink);
  --indigo: var(--primary-hover);
  --blue: var(--primary);
  --grad: linear-gradient(var(--primary), var(--primary));

  /* Type: Estedad (self-hosted, fonts.css) for the public pages; Vazirmatn stays the fallback. */
  --font-ui: 'Estedad', 'Vazirmatn', Tahoma, Arial, sans-serif;
  --font: var(--font-ui);
  --font-num: var(--font-ui);
  --mono: var(--font-ui);
  /* Fluid display scale (RTL Persian needs a little more line height than Latin). */
  --fs-display: clamp(34px, 5.2vw, 64px);
  --fs-h2: clamp(26px, 3.2vw, 40px);
  --fs-h3: clamp(19px, 1.7vw, 23px);
  --fs-lead: clamp(16px, 1.25vw, 18px);
  /* Shared motion and shape tokens. */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .5s;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 1px 2px rgba(37, 41, 43, .04), 0 12px 32px -18px rgba(37, 41, 43, .18);
  --shadow-lift: 0 2px 4px rgba(37, 41, 43, .04), 0 24px 48px -22px rgba(37, 41, 43, .28);
  font-family: var(--font-ui);
  color: var(--foreground);
  background: var(--background);
}
.lp-body .btn-primary { color: var(--foreground); transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.lp-body .btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.lp-body .btn:active { transform: translateY(1px); }
.lp-body :focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 3px; }
/* The dark (graphite) bands re-declare the tokens, so components that read var(--ink) /
   var(--card) / var(--line) inside them draw light-on-dark. */
.lp-body .lp-cta, .lp-body .lp-footer, .lp-body .ab-hero, .lp-body .ab-subnav, .lp-body .ab-statement, .lp-body .ab-mv-card {
  --ink: #f2f5f5;
  --muted: #aab4b6;
  --line: rgba(255, 255, 255, .13);
  --tint: rgba(255, 255, 255, .07);
  --card: rgba(255, 255, 255, .05);
  --lp-accent: var(--t-300);
  --ok: #6fd6df;
  --ok-bg: rgba(111, 214, 223, .16);
}
.lp-body .ab-hero, .lp-body .ab-statement, .lp-body .ab-mv-card { color: var(--ink); }
@media (prefers-contrast: more) { .lp-body { background-image: none; background: var(--canvas); } }

/* ---------- Animated page background (app/views/public_header.php, docs/landing.md) ----------
   One fixed layer behind every public page: two soft turquoise glows that float, two layers of thin
   wave lines drifting sideways at different speeds (parallax), and fine light streaks gliding right to
   left. Only transform/opacity animate, so it stays on the compositor; it is decorative
   (aria-hidden, no pointer events) and stands still for prefers-reduced-motion. */
.lp-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; }
.lp-bg-glow { position: absolute; border-radius: 50%; will-change: transform; }
.lp-bg-glow.is-a {
  width: 62vmax; height: 62vmax; inset-inline-end: -18vmax; top: -22vmax;
  background: radial-gradient(closest-side, rgba(17, 184, 197, .11), rgba(17, 184, 197, 0) 72%);
  animation: lp-bg-float-a 38s ease-in-out infinite alternate;
}
.lp-bg-glow.is-b {
  width: 54vmax; height: 54vmax; inset-inline-start: -20vmax; bottom: -24vmax;
  background: radial-gradient(closest-side, rgba(8, 127, 140, .08), rgba(8, 127, 140, 0) 72%);
  animation: lp-bg-float-b 46s ease-in-out infinite alternate;
}
@keyframes lp-bg-float-a { to { transform: translate(-8vw, 10vh) scale(1.08); } }
@keyframes lp-bg-float-b { to { transform: translate(10vw, -8vh) scale(1.12); } }
/* At least 2000px wide so the waves keep a gentle slope on phones (−50% is always one full period). */
.lp-bg-waves { position: absolute; top: 0; left: 0; width: max(200%, 2000px); height: 100%; will-change: transform; }
.lp-bg-waves svg { display: block; width: 100%; height: 100%; }
.lp-bg-waves path { fill: none; vector-effect: non-scaling-stroke; }
.lp-bg-waves.is-a path { stroke: url(#lpBgShine); stroke-width: 1.1; }
.lp-bg-waves.is-b path { stroke: rgba(37, 41, 43, .045); stroke-width: 1; }
.lp-bg-waves.is-a { animation: lp-bg-drift 120s linear infinite; }
.lp-bg-waves.is-b { animation: lp-bg-drift 180s linear infinite reverse; }
@keyframes lp-bg-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lp-bg-streak {
  --n: 0; position: absolute; left: 0; height: 2px; width: 22vw; min-width: 150px;
  top: calc(6% + var(--n) * 9.4%);
  /* A turquoise tail that brightens into a white-hot head (the head leads, on the left). */
  background: linear-gradient(270deg, rgba(17, 184, 197, 0), rgba(17, 184, 197, .38) 72%, rgba(255, 255, 255, .7) 97%, rgba(17, 184, 197, 0));
  border-radius: 2px; box-shadow: 0 0 8px rgba(17, 184, 197, .2); opacity: 0; will-change: transform, opacity;
  animation: lp-bg-streak calc(13s + var(--n) * 1.9s) cubic-bezier(.45, .05, .55, .95) infinite;
  animation-delay: calc(var(--n) * -3.3s);
}
.lp-bg-streak:nth-child(3n) { width: 30vw; }
.lp-bg-streak:nth-child(3n + 1) { width: 16vw; }
/* Right to left, as Persian reads; fades in and out at the edges. Every second streak is fainter. */
.lp-bg-streak:nth-child(2n) { height: 1.5px; box-shadow: none; }
@keyframes lp-bg-streak {
  0%   { transform: translateX(100vw); opacity: 0; }
  12%  { opacity: .75; }
  88%  { opacity: .75; }
  100% { transform: translateX(-35vw); opacity: 0; }
}
@media (max-width: 640px) {
  .lp-bg-streak:nth-child(n + 11) { display: none; } /* the two glows + two wave layers come first: keep 6 streaks */
  .lp-bg-waves.is-a path { stroke-width: 1.1; }
  .lp-bg-waves.is-a { opacity: .8; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-bg-glow, .lp-bg-waves { animation: none; }
  .lp-bg-streak { display: none; }
}
@media (prefers-contrast: more) { .lp-bg { display: none; } }

/* ---------- Floating navigation (app/views/public_header.php) ----------
   A light bar floating over the page: official DATIS logo on the right, links in the middle, the
   panel CTA on the left. Frosted white with a hairline border; a little more opaque, with a soft
   shadow, once the page scrolls (.is-scrolled from public_footer.php). */
.lp-nav {
  position: sticky; top: 0; z-index: 20; padding: 12px 20px 0;
  pointer-events: none; /* only the bar itself takes clicks, not the margin around it */
}
.lp-nav-inner {
  pointer-events: auto; position: relative;
  max-width: 1200px; margin: 0 auto; padding: 8px 10px; padding-inline-start: 18px;
  display: flex; align-items: center; gap: 22px;
  background: rgba(255, 255, 255, .74); border: 1px solid var(--border); border-radius: 18px;
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 2px rgba(37, 41, 43, .03);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.lp-nav.is-scrolled .lp-nav-inner { background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-soft); }
.lp-brand { flex: 0 0 auto; display: flex; align-items: center; text-decoration: none; }
.lp-brand:hover { text-decoration: none; }
/* The official DATIS wordmark in its own colours (navy + the turquoise triangle). */
.lp-brand-logo { display: block; height: 40px; width: auto; }
.lp-nav-links { display: flex; gap: 2px; flex: 1; justify-content: center; align-items: center; }
.lp-nav-links > a, .lp-nav-drop > a {
  position: relative; color: var(--muted-foreground); font-weight: 500; font-size: 14.5px; padding: 9px 13px; border-radius: 11px; white-space: nowrap;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.lp-nav-links > a:hover, .lp-nav-drop > a:hover { color: var(--foreground); background: var(--background); text-decoration: none; }
.lp-nav-links > a::after, .lp-nav-drop > a::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--primary); transform: scale(0); transition: transform .25s var(--ease);
}
.lp-nav-links > a[aria-current="page"], .lp-nav-drop > a[aria-current="page"] { color: var(--foreground); }
.lp-nav-links > a[aria-current="page"]::after, .lp-nav-drop > a[aria-current="page"]::after { transform: scale(1); }
@media (min-width: 981px) and (max-width: 1180px) {
  .lp-nav-links > a, .lp-nav-drop > a { padding: 8px 8px; font-size: 13.5px; }
  .lp-nav-inner { gap: 10px; }
}

/* «درباره ما» submenu: a white card of icon links, opened on hover or by the chevron button. */
.lp-nav-drop { position: relative; display: flex; align-items: center; }
.lp-nav-drop > a { padding-inline-end: 4px; }
.lp-nav-drop-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted-foreground); cursor: pointer; transition: color .2s ease, background-color .2s ease;
}
.lp-nav-drop-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.lp-nav-drop-btn:hover, .lp-nav-drop.is-open .lp-nav-drop-btn { color: var(--foreground); background: var(--background); }
.lp-nav-drop.is-open .lp-nav-drop-btn svg { transform: rotate(180deg); }
.lp-nav-menu {
  position: absolute; top: calc(100% + 16px); left: 50%; width: 360px; padding: 8px; z-index: 30;
  display: grid; gap: 2px; border-radius: 18px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px); transform-origin: 50% 0;
  transition: opacity .2s ease, transform .3s var(--ease), visibility 0s linear .3s;
}
.lp-nav-menu::before { content: ""; position: absolute; inset-inline: 0; top: -18px; height: 18px; }
.lp-nav-drop.is-open .lp-nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.lp-nav-menu > a {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; color: var(--foreground); text-decoration: none;
  transition: background-color .2s ease;
}
.lp-nav-drop.is-open .lp-nav-menu > a { animation: lp-menu-in .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes lp-menu-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lp-nav-menu > a:hover, .lp-nav-menu > a:focus-visible { background: var(--background); text-decoration: none; }
.lp-nav-menu-ico {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--primary-ink); background: var(--primary-light); border: 1px solid var(--primary-border);
  transition: transform .3s var(--ease), background-color .3s ease, color .3s ease;
}
.lp-nav-menu-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.lp-nav-menu-ico svg * { transform-box: fill-box; transform-origin: center; }
.lp-nav-menu > a:hover .lp-nav-menu-ico { transform: translateY(-1px); background: var(--primary); color: var(--foreground); }
.lp-nav-menu > a:hover .lp-mi-spark { animation: lp-mi-twinkle 1.4s ease-in-out infinite; }
.lp-nav-menu > a:hover .lp-mi-check { stroke-dasharray: 12; animation: lp-mi-draw 1.4s ease-in-out infinite; }
.lp-nav-menu > a:hover .lp-mi-arrow { animation: lp-mi-shoot 1.4s cubic-bezier(.3, .7, .3, 1) infinite; }
.lp-nav-menu > a:hover .lp-mi-star { animation: lp-mi-spin 1.6s ease-in-out infinite; }
@keyframes lp-mi-twinkle { 50% { transform: scale(.7) rotate(45deg); } }
@keyframes lp-mi-draw { 0% { stroke-dashoffset: 12; } 50%, 100% { stroke-dashoffset: 0; } }
@keyframes lp-mi-shoot { 0% { transform: translate(5px, -5px); opacity: 0; } 40%, 100% { transform: none; opacity: 1; } }
@keyframes lp-mi-spin { 50% { transform: rotate(72deg) scale(1.15); } }
.lp-nav-menu-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lp-nav-menu-text b { font-size: 14px; font-weight: 700; color: var(--foreground); }
.lp-nav-menu-text small { font-size: 12px; color: var(--muted-foreground); line-height: 1.6; }
.lp-nav-menu-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; padding: 11px 12px; border-radius: 12px;
  background: var(--primary-light); font-size: 12.5px; color: var(--foreground);
}
.lp-nav-menu-foot a { color: var(--primary-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.lp-nav-menu-foot a:hover { color: var(--foreground); text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .lp-nav-menu, .lp-nav-drop-btn svg, .lp-nav-inner { transition: none; }
  .lp-nav-drop.is-open .lp-nav-menu > a, .lp-nav-menu > a:hover .lp-nav-menu-ico svg * { animation: none; }
}
.lp-nav-cta { flex: 0 0 auto; }
.lp-body .lp-nav-cta { border-radius: 12px; padding: 10px 20px; font-size: 14px; }
.lp-nav-toggle {
  display: none; flex: 0 0 auto; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--foreground); cursor: pointer; padding: 0;
}
.lp-nav-toggle svg { width: 20px; height: 20px; }

/* .btn's base style is a solid white fill, shared with the logged-in
   dashboard — overridden here, scoped to the public pages only, so the ghost
   button reads as a quiet outline, also on the charcoal bands. */
.lp-body .btn-ghost { background: rgba(255,255,255,.06); color: var(--ink); backdrop-filter: blur(8px); }
.lp-body .btn-ghost:hover { background: rgba(255,255,255,.1); }
/* A light sweep across primary buttons on hover — scoped to the public pages
   so the dashboard's own buttons (same .btn-primary class) are untouched. */
.lp-body .btn-primary { position: relative; overflow: hidden; }
.lp-body .btn-primary::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 66%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.lp-body .btn-primary:hover::before { transform: translateX(120%); }
@media (prefers-reduced-motion: reduce) { .lp-body .btn-primary::before { display: none; } }

.lp-section { max-width: 1160px; margin: 0 auto; padding: 70px 26px; }
.lp-section-head { text-align: center; max-width: 560px; margin: 0 auto 40px; }
.lp-section-head h2 { font-size: 28px; font-weight: 800; margin: 0 0 10px; }
.lp-section-head p { color: var(--muted); font-size: 15.5px; margin: 0; }

/* FAQ cards: var(--card) fill plus a blur, so on a charcoal band the glow
   behind each card bleeds through instead of being hidden by a flat panel. */
.lp-guide-item {
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
}


.lp-cta {
  position: relative; overflow: hidden;
  max-width: 1160px; margin: 0 auto 70px; padding: 60px 26px;
  background:
    radial-gradient(circle at 85% 0%, rgba(19, 163, 176, .45), transparent 55%),
    radial-gradient(circle at 10% 100%, rgba(19, 163, 176, .25), transparent 50%),
    var(--charcoal);
  border-radius: 28px; text-align: center; color: #fff;
  box-shadow: 0 40px 80px -30px rgba(37, 41, 43, .55);
}
.lp-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.16) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
          mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
}
.lp-cta > * { position: relative; }
.lp-cta h2 { font-size: 28px; font-weight: 800; margin: 0 0 10px; }
.lp-cta p { color: rgba(255,255,255,.85); margin: 0 0 26px; font-size: 15.5px; }
.lp-cta .btn-primary { background: var(--t-500); color: var(--charcoal-deep); font-size: 15.5px; padding: 13px 30px; }

.lp-footer {
  text-align: center; padding: 40px 26px 40px; color: var(--muted); font-size: 13px;
  background: var(--charcoal); border-top: 3px solid var(--t-500);
}
.lp-footer-logo { height: 64px; border-radius: 12px; background: #fff; padding: 8px 18px; margin-bottom: 12px; }
.lp-footer-contact {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  margin: 4px 0 14px; padding: 0; font-size: 13.5px;
}
.lp-footer-contact li { display: inline-flex; align-items: center; gap: 7px; }
.lp-footer-contact svg { width: 16px; height: 16px; flex: none; color: var(--lp-accent); }
.lp-footer-contact a { color: var(--ink); text-decoration: none; }
.lp-footer-contact a:hover { color: var(--lp-accent); }

@media (max-width: 980px) {

  .lp-nav-toggle { display: flex; }
  .lp-nav-cta { margin-inline-start: auto; }
  /* Phone/tablet menu: a white card that unfolds under the bar. */
  .lp-nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; inset-inline: 0; top: calc(100% + 8px);
    background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lift);
    padding: 6px 14px; max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-height .3s var(--ease), opacity .2s ease, visibility 0s linear .3s;
  }
  .lp-nav-links.is-open { max-height: calc(100svh - var(--lp-nav-h, 76px) - 24px); overflow-y: auto; opacity: 1; visibility: visible; transition-delay: 0s; }
  .lp-nav-links > a, .lp-nav-drop > a { padding: 14px 6px; min-height: 48px; border-radius: 0; font-size: 15px; color: var(--foreground); border-bottom: 1px solid var(--border); }
  .lp-nav-links > a:hover, .lp-nav-drop > a:hover { background: transparent; }
  .lp-nav-links > a::after, .lp-nav-drop > a::after { display: none; }
  .lp-nav-links > a:last-child { border-bottom: 0; }
  .lp-nav-links > a[aria-current="page"], .lp-nav-drop > a[aria-current="page"] { color: var(--primary-ink); }
  .lp-nav-drop { flex-wrap: wrap; }
  .lp-nav-drop > a { flex: 1; }
  .lp-nav-drop-btn { width: 48px; height: 48px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .lp-nav-menu {
    position: static; width: 100%; transform: none; display: none; opacity: 1; visibility: visible; transition: none;
    margin: 6px 0 8px; padding: 6px; background: var(--background); box-shadow: none;
  }
  .lp-nav-menu::before { display: none; }
  .lp-nav-drop.is-open .lp-nav-menu { display: grid; transform: none; }
  .lp-nav-menu-ico { width: 36px; height: 36px; border-radius: 11px; }
}
@media (max-width: 560px) {
  .lp-brand-logo { height: 34px; }
  .lp-nav { padding: 8px 10px 0; }
  .lp-nav-inner { gap: 8px; padding: 6px; padding-inline-start: 12px; border-radius: 16px; }
  .lp-body .lp-nav-cta { padding: 9px 12px; font-size: 13px; }

  .lp-section { padding: 50px 20px; }
  .lp-cta { border-radius: 20px; padding: 40px 20px; }
}
/* ---------- Landing top banner: five animated slides ---------- */

.lp-banner-circuit { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .55; }
.lp-banner-circuit path { fill: none; stroke: rgba(19, 180, 194, .16); stroke-width: 1.4; }
.lp-banner-circuit path.is-glow {
  stroke: #93dfe6; stroke-width: 2; stroke-dasharray: 60 640; stroke-dashoffset: 700;
  filter: drop-shadow(0 0 5px rgba(147, 223, 230, .9)); animation: lp-circuit-run 5s linear infinite;
}
@keyframes lp-circuit-run { to { stroke-dashoffset: 0; } }

/* In RTL the first grid column is on the right: text right, visual left, as in the promo video. */

/* Entrance: copy and cards rise in each time their slide becomes active. */

/* Slide 1: the tilted phone, fading into the background on its inner side, with light streaks. */

/* Never drawn taller than the 720px source, so a tall full-screen banner doesn't upscale (blur) it;
   when capped, its top/bottom edges fade into the background like the sides. */

/* Slide 2: one template turning into personal messages. */

/* Slide 3: a live report card. */

/* Slide 4: a voice message playing out — ripples round the mic, the waveform fills as it plays, calls land. */

/* Each bar breathes on its own phase; the colour sweep marks how much of the message has played. */

/* Slide 5: a Bale business chat — the panel types, the messages land and get read, the split floats beside. */

/* Read receipt: the second tick draws in and both turn teal. */

/* Each dot is a 24×24 target (WCAG 2.5.8); the visible dot is drawn by ::before. */

@media (prefers-reduced-motion: reduce) {

  .lp-banner-circuit path.is-glow { display: none; }
}

/* ---------- Landing hero: scroll progress + SMS-thread visual ---------- */
.lp-scroll-progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60;
  background: rgba(255,255,255,.1); transform-origin: 0 0;
}
.lp-scroll-progress-bar {
  height: 100%; width: 100%; background: var(--grad);
  transform: scaleX(0); transform-origin: inline-start; transition: transform .1s linear;
}

/* Hero visual: the 3D phone scene from the ELLSMS promo video as one still image, with the motion
   in CSS (envelopes flying off the phone, a comet on the orbit ring, a pulsing podium glow, rising
   sparks). All transforms/opacity only, so it stays on the compositor; paused off-screen
   (.is-paused) and still for prefers-reduced-motion. */

/* Gradient accent inside headings (about.php) and the rise-in used by about.css. */
.lp-heading-accent {
  background: linear-gradient(100deg, var(--t-ink), var(--t-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-contrast: more) { .lp-heading-accent { background: none; -webkit-text-fill-color: currentColor; color: inherit; } }
@keyframes lp-banner-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.lp-reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: calc(var(--i, 0) * 70ms);
}
.lp-reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .lp-reveal { transition-delay: 0s; } }

/* ---------- Landing hero video slider (reuses .lp-slider-full/.lp-slide from
   the image-slider block above — same full-bleed viewport, nav dots/arrows and
   caption, just with a <video> per slide instead of an <img>) ---------- */
.lp-slide video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, filter .5s ease; }
/* Hovering (or holding a finger on) a slide cross-fades its video to the
   poster image with a gentle zoom — a nicer still preview than a plain loop. */
.lp-video-hover-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06); transition: opacity .45s ease, transform .5s ease;
  pointer-events: none;
}
.lp-slide:hover video { transform: scale(1.04); filter: brightness(.75); }
.lp-slide:hover .lp-video-hover-image { opacity: 1; transform: scale(1); }
/* Shown instead of the <video> when playback fails and no poster/fallback image was set. */
.lp-slide--placeholder { display: flex; align-items: center; justify-content: center; background: var(--grad); }
.lp-slide--placeholder::before { content: "🎬"; font-size: 42px; opacity: .85; }
.lp-video-mute {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(15, 17, 19,.55); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease;
}
.lp-video-mute:hover { background: rgba(15, 17, 19,.75); }
.lp-slide-caption .btn-primary {
  padding: 9px 22px; font-size: 13.5px; border-radius: 10px;
  box-shadow: 0 10px 24px rgba(12, 97, 105,.35);
}

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

/* ---------- Contact page ---------- */
.lp-contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; align-items: start; }
.lp-contact-info h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.lp-contact-info p { color: var(--ink); font-size: 15px; line-height: 1.9; margin: 0; }
.lp-contact-form form { margin-top: 2px; }
.lp-contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lp-contact-list li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; }
.lp-contact-list li + li { border-top: 1px solid var(--line); }
.lp-contact-list li:first-child { padding-top: 0; }
.lp-contact-list li:last-child { padding-bottom: 0; }
.lp-contact-ico {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--lp-accent); background: var(--tint); border: 1px solid var(--line);
}
.lp-contact-ico svg { width: 22px; height: 22px; }
.lp-contact-list a { color: var(--ink); text-decoration: none; }
.lp-contact-list a:hover { color: var(--lp-accent); }
.lp-contact-phone { font-size: 20px !important; font-weight: 700; letter-spacing: .02em; }
.lp-contact-phone a { display: inline-block; direction: ltr; }
.lp-contact-more { display: inline-block; margin-top: 6px; font-size: 13.5px; color: var(--lp-accent) !important; }

/* Office map: a drawn placeholder; the Google Maps iframe replaces it only when the visitor asks. */
.lp-map { margin-top: 22px; padding: 0; overflow: hidden; }
.lp-map-head {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between;
  padding: 22px 24px 18px;
}
.lp-map-kicker {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--lp-accent);
  background: var(--tint); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}
.lp-map-head h3 { font-size: 19px; font-weight: 800; margin: 10px 0 4px; }
.lp-map-address { color: var(--muted); margin: 0; font-size: 14.5px; }
.lp-map-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-map-frame {
  position: relative; height: 380px; border-top: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(12, 97, 105, .16), rgba(14, 124, 133, .06) 60%, transparent), var(--canvas);
}
.lp-map-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-map-blocks rect { fill: rgba(255, 255, 255, .045); stroke: rgba(255, 255, 255, .06); }
.lp-map-roads path { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 14; stroke-linecap: round; }
.lp-map-roads path.minor { stroke: rgba(255, 255, 255, .08); stroke-width: 6; }
.lp-map-route { fill: none; stroke: var(--lp-accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; }
.lp-map-pin {
  position: absolute; top: 44%; left: 50%; width: 40px; height: 54px; transform: translate(-50%, -100%);
  filter: drop-shadow(0 10px 18px rgba(12, 97, 105, .55));
}
.lp-map-pin svg { position: relative; width: 100%; height: 100%; fill: var(--lp-accent); }
.lp-map-pulse {
  position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: var(--lp-accent); opacity: .5; animation: lp-map-pulse 2.2s ease-out infinite;
}
@keyframes lp-map-pulse {
  0%   { transform: scale(.6); opacity: .55; }
  100% { transform: scale(3.4); opacity: 0; }
}
.lp-map-consent {
  position: absolute; inset-inline: 16px; bottom: 18px; margin-inline: auto; max-width: 460px; text-align: center;
  padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(8, 9, 9, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lp-map-consent p { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.lp-map-consent a { color: var(--lp-accent); }
.lp-map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lp-map-frame.is-live { background: #e9e5dc; }
.lp-map-badge {
  position: absolute; inset-inline-start: 14px; top: 14px; display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 84px); padding: 9px 14px; border-radius: 12px; font-size: 13px; color: #f3f4fb;
  background: rgba(8, 9, 9, .82); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}
.lp-map-badge a { color: #9de2e8; white-space: nowrap; }
.lp-map-badge-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%; background: #48cbd7;
  box-shadow: 0 0 0 4px rgba(72, 203, 215, .22);
}
.lp-map-frame.is-loaded .lp-map-art,
.lp-map-frame.is-loaded .lp-map-pin,
.lp-map-frame.is-loaded .lp-map-consent { display: none; }
@media (prefers-reduced-motion: reduce) { .lp-map-pulse { animation: none; } }

@media (max-width: 900px) {
  .lp-contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lp-map-head { padding: 18px 16px 14px; }
  .lp-map-frame { height: 340px; }
  .lp-map-pin { top: 36%; }
}

/* ---------- Hero slider ---------- */
.lp-slider-full { position: relative; width: 100%; overflow: hidden; background: #0f1113; }
.lp-slider-viewport { position: relative; width: 100%; aspect-ratio: 21 / 7; }
.lp-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .6s ease;
}
.lp-slide.is-active { opacity: 1; visibility: visible; }
.lp-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-slide-caption {
  position: absolute; inset-inline: 0; bottom: 0; top: 0;
  display: flex; align-items: flex-end;
  background: linear-gradient(0deg, rgba(15, 17, 19,.75), rgba(15, 17, 19,.05) 55%, transparent 75%);
  color: #fff;
}
.lp-slide-caption-inner { max-width: 1160px; margin: 0 auto; width: 100%; padding: 0 26px 34px; text-align: right; }
.lp-slide-caption h3 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.lp-slide-caption p { font-size: 14.5px; margin: 0 0 14px; color: rgba(255,255,255,.85); max-width: 520px; }
.lp-slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(15, 17, 19,.45); color: #fff; font-size: 21px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease;
}
.lp-slider-nav:hover { background: rgba(15, 17, 19,.65); }
.lp-slider-prev { inset-inline-start: 18px; }
.lp-slider-next { inset-inline-end: 18px; }
.lp-slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.lp-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; }
.lp-dot.is-active { background: #fff; }

@media (max-width: 900px) {
  .lp-slider-viewport { aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  .lp-slider-viewport { aspect-ratio: 4 / 3; }
  .lp-slide-caption h3 { font-size: 18px; }
  .lp-slide-caption-inner { padding: 0 18px 22px; }
}

/* ---------- Customers: one rail of monochrome logos ---------- */
/* The rail runs edge to edge (full viewport width) with the ends faded out. The track holds the list
   twice and moves by -50%, so the loop has no seam. Without JS this CSS animation runs it and
   hover/focus pauses it; public/assets/js/landing-customers.js takes over when it loads (.is-live).
   Logos are quiet by default — a light monochrome mark straight on the page, no plate — and show their
   own colours on a white plate only when hovered or focused. */
.lp-customers { padding-bottom: 80px; }
.lp-marquee {
  --gap: 10px;
  width: 100vw; margin-inline: calc(50% - 50vw);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.lp-marquee-row { overflow: hidden; direction: ltr; padding-block: 14px; } /* room for the hover lift */
.lp-marquee-track {
  display: flex; width: max-content; position: relative;
  animation: lp-marquee 70s linear infinite reverse;
}
.lp-marquee:hover .lp-marquee-track,
.lp-marquee:focus-within .lp-marquee-track { animation-play-state: paused; }
@keyframes lp-marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.lp-marquee-set {
  list-style: none; margin: 0; padding: 0 var(--gap) 0 0;
  display: flex; gap: var(--gap);
}
.lp-bank {
  direction: rtl; flex: none; position: relative;
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 1px solid transparent; border-radius: 18px; padding: 10px 14px 10px 22px;
  transform: scale(var(--s, 1)); opacity: var(--o, 1);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease, translate .35s cubic-bezier(.2,.8,.2,1);
}
.lp-bank-logo {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 14px; padding: 6px;
  background: transparent;
  transition: background-color .35s ease, transform .4s cubic-bezier(.2,.8,.2,1);
}
.lp-bank-logo img {
  width: 100%; height: 100%; object-fit: contain;
  /* The files are full-colour on an opaque white square. #lp-logo-mono (an inline SVG filter in the
     section) paints every pixel charcoal and turns its darkness into opacity: the white square
     disappears and the logo remains as a grey mark on the white page. */
  filter: url(#lp-logo-mono);
  opacity: .7;
  transition: opacity .35s ease;
}
.lp-bank-mono {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border-radius: 12px; background: var(--tint); color: var(--muted);
  font-size: 24px; font-weight: 800;
  transition: background-color .35s ease, color .35s ease;
}
.lp-bank-name {
  font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--muted);
  transition: color .35s ease;
}
/* Hover / focus: the customer's own colours on a white plate, and the tile lifts. */
.lp-bank:hover, .lp-bank:focus-within {
  translate: 0 -4px; opacity: 1;
  background: var(--card); border-color: var(--line);
  box-shadow: 0 18px 40px rgba(37,41,43,.14);
}
.lp-bank:hover .lp-bank-logo, .lp-bank:focus-within .lp-bank-logo { background: #fff; transform: scale(1.06); }
.lp-bank:hover .lp-bank-logo img, .lp-bank:focus-within .lp-bank-logo img { filter: none; opacity: 1; }
.lp-bank:hover .lp-bank-mono, .lp-bank:focus-within .lp-bank-mono { background: var(--bank); color: #fff; }
.lp-bank:hover .lp-bank-name, .lp-bank:focus-within .lp-bank-name { color: var(--text); }
/* Driven by the script: the CSS animation steps aside, and the rail can be dragged. */
.lp-marquee.is-live .lp-marquee-track { animation: none; will-change: transform; }
.lp-marquee.is-live .lp-marquee-row { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.lp-marquee.is-live .lp-marquee-row.is-dragging { cursor: grabbing; }
.lp-marquee.is-live .lp-bank img { -webkit-user-drag: none; pointer-events: none; }
@media (max-width: 520px) {
  .lp-marquee { --gap: 6px; }
  .lp-bank { gap: 8px; padding: 8px 10px 8px 14px; border-radius: 14px; }
  .lp-bank-logo { width: 52px; height: 52px; border-radius: 12px; }
  .lp-bank-name { font-size: 13px; }
}
/* Touch screens have no hover: the logos are a little brighter there. */
@media (hover: none) { .lp-bank-logo img { opacity: .85; } }
/* Reduced motion: no rail — one still, wrapped list of every customer. */
@media (prefers-reduced-motion: reduce) {
  .lp-marquee { width: auto; margin-inline: 0; -webkit-mask-image: none; mask-image: none; }
  .lp-marquee-set[aria-hidden="true"] { display: none; }
  .lp-marquee-row { direction: rtl; }
  .lp-marquee-track { animation: none; width: auto; }
  .lp-marquee-set { flex-wrap: wrap; justify-content: center; padding: 0; }
  .lp-bank, .lp-bank:hover, .lp-bank-logo, .lp-bank-logo img { transition: none; transform: none; translate: none; }
}

/* ---------- Guide (public accordion) ---------- */
.lp-guide-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.lp-guide-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; transition: border-color .2s ease; }
.lp-guide-item:hover { border-color: rgba(157, 226, 232,.4); }
.lp-guide-item summary {
  padding: 16px 0; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.lp-guide-item summary::-webkit-details-marker { display: none; }
.lp-guide-item summary::after {
  content: "+"; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--tint); color: var(--lp-accent); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.lp-guide-item[open] summary::after { content: "−"; transform: rotate(180deg); }
.lp-guide-body { padding: 0 0 18px; color: var(--muted); font-size: 14.5px; line-height: 1.9; }

/* ---------- Financial commerce (FIN-11) — print-friendly invoice ---------- */
@media print {
  .topbar, .sidebar, .flash, .toolbar form, button, .btn { display: none !important; }
  .print-invoice { border: none !important; box-shadow: none !important; }
  body { background: #fff !important; }
}

/* Operator logos (app/OperatorLogos.php): height is set per use, width follows the image. */
.op-logo { width: auto; vertical-align: middle; object-fit: contain; flex: none; }
.op-label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.op-label .op-logo { min-width: 20px; }

/* Price matrix: gateway x operator x encoding (app/views/price_matrix.php). */
.price-matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.price-matrix th, .price-matrix td { padding: 5px 3px; text-align: center; border-bottom: 1px solid var(--border, #e6e8ee); }
.price-matrix thead th { font-weight: 600; white-space: nowrap; }
.price-matrix .pm-col-head { border-inline-start: 1px solid var(--border, #e6e8ee); }
.price-matrix .pm-col-head .op-label { justify-content: center; }
.price-matrix .pm-enc-head { font-size: .85em; font-weight: 500; color: var(--muted, #6b7280); }
.price-matrix .pm-gateway-head, .price-matrix .pm-gateway { text-align: start; white-space: nowrap; background: var(--surface-2, #f7f8fa); position: sticky; inset-inline-start: 0; z-index: 1; }
.price-matrix .pm-gateway { font-weight: 500; }
.price-matrix input { width: 62px; min-width: 0; padding: 5px 4px; text-align: center; margin: 0; font-size: .92em; }
.price-matrix .pm-fill { display: inline-flex; gap: 2px; align-items: center; }
.price-matrix .pm-fill input { width: 44px; }
.price-matrix .pm-fill .btn { padding: 4px 5px; line-height: 1; min-width: 0; }
.price-matrix tbody tr:hover td, .price-matrix tbody tr:hover th { background: #f3f6ff; }
.price-matrix input.is-default { color: #9aa1ad; background: #fafbfc; }
.price-matrix input:not(.is-default):not(:placeholder-shown) { font-weight: 600; }
.price-matrix tr.pm-default-row th, .price-matrix tr.pm-default-row td { background: #f2f4ff; border-bottom: 2px solid #c9cff5; }
.price-matrix tr.pm-default-row .pm-gateway { color: #3b3fc4; }
.price-matrix tr.pm-shared-row th, .price-matrix tr.pm-shared-row td { background: #f1faf4; }
.price-matrix tr.pm-shared-row .pm-gateway { color: #1d6b3a; }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* "پرش به محتوا": off-screen until focused with the keyboard. */
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000;
  padding: 10px 18px; border-radius: 10px; background: #fff; color: #0b1023; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); text-decoration: none;
}
.skip-link:focus { top: 12px; outline: 3px solid var(--blue); outline-offset: 2px; }
main:focus { outline: none; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 2px rgba(192, 34, 58, .25); }

/* Consent checkboxes (register, contact, buy credit). */
.consent-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; line-height: 1.9; cursor: pointer; }
.consent-check input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 5px 0 0; accent-color: var(--blue); }
.consent-check a { text-decoration: underline; text-underline-offset: 3px; }

/* Links to the legal pages in both footers. */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 13px; margin: 6px 0; }
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }

/* ---------- Legal pages (terms, privacy, refund) ---------- */
.lp-legal { max-width: 860px; line-height: 2; }
.lp-legal-head { text-align: center; margin-bottom: 28px; }
.lp-legal-head h1 { font-size: 30px; font-weight: 800; margin: 0 0 8px; }
.lp-legal-meta { color: var(--muted); font-size: 14px; margin: 0; }
.lp-legal section { margin-top: 34px; scroll-margin-top: 90px; }
.lp-legal h2 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.lp-legal p, .lp-legal li { font-size: 15.5px; }
.lp-legal ul, .lp-legal ol { padding-inline-start: 22px; margin: 8px 0; }
.lp-legal li { margin: 6px 0; }
.lp-legal a { color: #a5b4fc; text-decoration: underline; text-underline-offset: 3px; }
.lp-legal-toc { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 14px 22px; }
.lp-legal-toc ol { columns: 2; column-gap: 32px; margin: 0; }
.lp-legal-toc li { break-inside: avoid; font-size: 14.5px; margin: 2px 0; }
.lp-legal-identity { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 20px; }
.lp-legal-identity dt { color: var(--muted); font-size: 14px; }
.lp-legal-identity dd { margin: 0; font-size: 15px; }
.lp-legal-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lp-legal-table th, .lp-legal-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: start; vertical-align: top; }
.lp-legal-table th { background: var(--tint); font-weight: 700; }
@media (max-width: 640px) {
  .lp-legal-toc ol { columns: 1; }
  .lp-legal-identity { grid-template-columns: 1fr; }
  .lp-legal-identity dd { margin-bottom: 8px; }
}
/* ---------- Line forwarding to URL (public/number-forwards.php) ---------- */
.fwd-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--canvas); font-size: var(--fs-sm); }
.fwd-status.is-on { background: var(--ok-bg); border-color: #bfe8d0; color: var(--ok); }
.fwd-status.is-off { background: var(--err-bg); border-color: #f5c2cc; color: var(--err); }
.fwd-status .fwd-meta { color: var(--muted); font-weight: 400; margin-inline-start: auto; }
.fwd-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #c4c9d6; flex: 0 0 auto; }
.fwd-dot.is-on { background: #22a35a; box-shadow: 0 0 0 3px rgba(34,163,90,.15); }
.fwd-dot.is-warn { background: #e0a106; box-shadow: 0 0 0 3px rgba(224,161,6,.15); }
.fwd-dot.is-err { background: var(--err); box-shadow: 0 0 0 3px rgba(192,34,58,.14); }
.fwd-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fwd-line { border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; transition: box-shadow .15s ease, border-color .15s ease; }
.fwd-line:hover { box-shadow: 0 6px 18px rgba(11,16,35,.06); border-color: #d6d2f2; }
.fwd-line.is-editing { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(7,111,122,.12); }
.fwd-line-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.fwd-line-number { font-size: var(--fs-lg); font-weight: 800; }
.fwd-line-label { color: var(--muted); font-size: var(--fs-xs); }
.fwd-line-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px dashed var(--line); font-size: var(--fs-sm); }
.fwd-line-row .fwd-kind { font-weight: 700; min-width: 64px; }
.fwd-line-row .fwd-url { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; font-size: var(--fs-xs); }
.fwd-line-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; margin-top: auto; border-top: 1px solid var(--line); background: var(--canvas); border-radius: 0 0 14px 14px; font-size: var(--fs-xs); color: var(--muted); }
.fwd-url-input { font-family: var(--font-mono); font-size: var(--fs-sm); }
.fwd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; direction: ltr; }
.fwd-chip { border: 1px solid var(--line); background: var(--tint); color: var(--indigo); border-radius: 999px; padding: 2px 10px; font: 600 var(--fs-2xs)/1.8 var(--font-mono); cursor: pointer; direction: ltr; }
.fwd-chip:hover { background: #e2e7ff; }
.fwd-schedule { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fwd-schedule span { background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: var(--fs-2xs); }
/* An on/off switch drawn over a real checkbox (still a checkbox for forms, keyboards and screen readers). */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; font-weight: 700; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #d3d7e3; position: relative; cursor: pointer; transition: background .15s ease; flex: 0 0 auto; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(11,16,35,.2); transition: inset-inline-start .15s ease; }
.switch input:checked { background: var(--indigo); }
.switch input:checked::after { inset-inline-start: 21px; }
.switch input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled { opacity: .5; cursor: default; }
.switch .switch-sub { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }

/* Lazily loaded page parts (app/LazyParts.php, assets/js/lazy-parts.js). */
.lazy-part { display: flex; align-items: center; justify-content: center; margin: 18px 0; border: 1px dashed var(--line); border-radius: 18px; background: var(--card); }
.lazy-part-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 18px; }
.lazy-part-error { color: var(--err); }
.lazy-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--indigo); animation: lazy-spin .8s linear infinite; }
@keyframes lazy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lazy-spinner { animation-duration: 2.4s; } }
/* A live part (lazy_part_live_placeholder()) keeps its box once filled; a failed refresh dims it. */
.lazy-part.lazy-part-ready { display: block; margin: 0; border: 0; border-radius: 0; background: none; }
.lazy-part-stale { opacity: .55; transition: opacity .2s; }

/* Live queue monitor (public/queue-monitor.php). */
.qm-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.qm-live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); vertical-align: middle; margin-inline-end: 4px; animation: qm-pulse 1.6s ease-in-out infinite; }
@keyframes qm-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .qm-live-dot { animation: none; } }
.qm-delta { display: inline-block; margin-inline-start: 6px; font-size: var(--fs-xs); font-weight: 700; direction: rtl; }
.qm-delta.up { color: var(--err); }
.qm-delta.down { color: var(--ok); }
.stat-accent .qm-delta { color: inherit; opacity: .85; }
.qm-table .btn { white-space: nowrap; }
.qm-warn-text { color: var(--warn); }
.qm-row-warn td { background: var(--warn-bg); }
.qm-bar { height: 6px; min-width: 90px; border-radius: 999px; background: var(--line); overflow: hidden; }
.qm-bar > span { display: block; height: 100%; background: var(--indigo); }
.qm-providers { display: flex; flex-wrap: wrap; gap: 10px; }
.qm-provider { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-xs); }
.qm-footnote { text-align: center; margin: 4px 0 18px; }

/* Buying credit: payment-type tiles (public/buy-credit.php) and the «در انتظار بررسی» badge of a
   manual payment waiting for its review (app/ManualPayments.php). */
.badge-review { background: var(--tint); color: var(--indigo); white-space: nowrap; }
/* Layout: the steps on the right, a sticky summary + pay button on the left (RTL). */
.pay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; margin-bottom: var(--sp-5); }
.pay-main { display: grid; gap: var(--sp-4); min-width: 0; }
.panel .pay-main > .card, .panel .pay-summary, .pay-main > .card, .pay-summary { margin: 0; }
.pay-step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--sp-4) !important; }
.pay-step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--indigo);
  font-size: var(--fs-sm); font-weight: 800; flex: 0 0 auto; }
.pay-subtitle { margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-md); }

/* Step 1 — payment type tiles, right-aligned grid. */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pay-method { position: relative; margin: 0; cursor: pointer; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method-box { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font-weight: 600; font-size: var(--fs-sm); transition: border-color .15s, background .15s, box-shadow .15s; }
.pay-method-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--canvas); color: var(--muted);
  transition: background .15s, color .15s; }
.pay-method-icon svg { width: 22px; height: 22px; }
.pay-method:hover .pay-method-box { border-color: #a9dde2; }
.pay-method input:focus-visible + .pay-method-box { outline: 2px solid var(--blue); outline-offset: 2px; }
.pay-method input:checked + .pay-method-box { border-color: var(--indigo); background: var(--tint); box-shadow: 0 0 0 3px rgb(74 50 232 / 10%); color: var(--indigo); }
.pay-method input:checked + .pay-method-box .pay-method-icon { background: var(--indigo); color: #fff; }
.pay-admin-note { margin: var(--sp-4) 0 0; }

/* Step 2 — amount. */
.pay-packages { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-4); }
.pay-package { padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit;
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.pay-package small { font-weight: 500; color: var(--muted); }
.pay-package:hover { border-color: #a9dde2; }
.pay-package.is-on { border-color: var(--indigo); background: var(--tint); color: var(--indigo); }
.pay-amount { margin-bottom: var(--sp-1); max-width: 420px; }
.pay-amount-field { position: relative; display: block; margin-top: 6px; }
.pay-amount-field input { width: 100%; margin: 0; padding-inline-end: 56px; font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.pay-amount-unit { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-sm); font-weight: 500; pointer-events: none; }
.pay-amount-words { min-height: 22px; color: var(--indigo); font-size: var(--fs-sm); font-weight: 600; }
.pay-amount-hint { margin: var(--sp-1) 0 0; }

/* Step 3 — the online gateway. */
.pay-gateway { margin: 0; cursor: pointer; }
.pay-gateway input { position: absolute; opacity: 0; pointer-events: none; }
.pay-gateway-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--indigo); border-radius: 12px; background: var(--tint); }
.pay-gateway-logo { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 auto; border-radius: 12px; background: var(--card);
  color: var(--indigo); box-shadow: 0 1px 3px rgb(11 16 35 / 8%); overflow: hidden; }
.pay-gateway-logo svg { width: 28px; height: 28px; }
.pay-gateway-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pay-gateway-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pay-gateway-text strong { font-size: var(--fs-md); color: var(--ink); }
.pay-gateway-text span { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.pay-gateway-check { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: var(--indigo); position: relative; }
.pay-gateway-check::after { content: ''; position: absolute; inset: 6px 5px 7px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.pay-gateway-hint { margin: var(--sp-3) 0 0; }

/* Manual payment fields. */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; align-items: start; }
.pay-grid .pay-wide { grid-column: 1 / -1; }
.pay-callout { margin-bottom: var(--sp-4); }

/* Summary. */
.pay-summary { position: sticky; top: 16px; }
.pay-summary h2 { margin-bottom: var(--sp-4); }
.pay-balance { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--canvas);
  font-size: var(--fs-sm); color: var(--muted); }
.pay-balance strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-balance small, .pay-lines small { font-weight: 500; color: var(--muted); }
.pay-lines { margin: var(--sp-4) 0; }
.pay-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 0; font-size: var(--fs-sm); }
.pay-lines dt { color: var(--muted); }
.pay-lines dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-lines .pay-total { margin-top: 6px; padding: 14px; border-radius: 12px; background: var(--grad); color: #fff; }
.pay-lines .pay-total dt { color: #d8f3f5; font-weight: 600; }
.pay-lines .pay-total dd { font-size: var(--fs-xl); font-weight: 800; }
.pay-consent { margin: var(--sp-3) 0 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.9; text-align: center; }
.pay-consent a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pay-submit { width: 100%; min-height: 46px; font-size: var(--fs-md); }
.pay-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: var(--sp-3) 0 0; color: var(--muted); font-size: var(--fs-xs); }
.pay-secure svg { width: 14px; height: 14px; }

/* History. */
.pay-history td { vertical-align: middle; }
.pay-history td:first-child { min-width: 200px; }
.pay-ref { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-family: var(--mono); font-size: var(--fs-xs); }
.pay-none { color: var(--muted); }
.pay-actions { text-align: left !important; }
.pay-details th { width: 180px; }
@media (max-width: 1100px) { .pay-layout { grid-template-columns: 1fr; } .pay-summary { position: static; } }
@media (max-width: 560px) { .pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pay-method-box { flex-direction: column; text-align: center; gap: 8px; } }

/* Numbers list + «ویرایش شماره» (public/numbers.php): rows tinted by line status, like the legend. */
.num-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-3); }
.num-chip { display: inline-block; border-radius: 6px; padding: 3px 12px; font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.num-chip.is-current { outline: 2px solid var(--indigo); outline-offset: 1px; }
.num-st-active      { background: #dff6f3; }
.num-st-inactive    { background: #f3f3f5; }
.num-st-blocked     { background: #fff6e0; }
.num-st-deleted     { background: var(--err-bg); }
.num-st-transferred { background: #ffe9d6; }
.num-st-reserved    { background: #ebe9f7; }
.num-st-expired     { background: #fbe3e3; }
tr.num-row > td { background: inherit; }
.num-table td, .num-table th { vertical-align: middle; }
.num-table a.num-link { font-weight: 700; color: var(--indigo); text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.num-expired { color: var(--err); font-weight: 700; }
.num-soon { color: var(--warn); font-weight: 700; }
.num-kv { width: 100%; border-collapse: collapse; }
.num-kv th, .num-kv td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.num-kv th { width: 190px; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; white-space: normal; }
.num-kv tr:last-child > * { border-bottom: 0; }
.num-kv form { margin: 0; }
.num-kv input[type=text], .num-kv input[type=number], .num-kv select { margin: 0; }
.num-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--sp-3); }
.num-head h2 { margin: 0; }
@media (max-width: 760px) {
  .num-kv, .num-kv tbody, .num-kv tr, .num-kv th, .num-kv td { display: block; width: 100%; }
  .num-kv th { border-bottom: 0; padding-bottom: 2px; }
}
.num-status-note { font-size: var(--fs-2xs); color: var(--muted); font-weight: 400; margin-top: 2px; line-height: var(--lh-snug); }
.num-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.num-tools .ui-icon, .num-add .btn .ui-icon, .num-report .ui-icon, .num-head h2 .ui-icon { width: 16px; height: 16px; vertical-align: -3px; }
.num-head h2 .num-chip { margin-inline-start: 8px; vertical-align: middle; }

/* Row actions: an edit icon and a «…» menu of small icon forms. */
.num-ops { white-space: nowrap; }
.num-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; list-style: none; vertical-align: middle; }
.num-icon-btn:hover, .num-menu[open] > .num-icon-btn { border-color: var(--indigo); color: var(--indigo); background: var(--tint); }
.num-icon-btn .ui-icon { width: 18px; height: 18px; }
.num-menu { display: inline-block; margin-inline-start: 4px; }
.num-menu > summary::-webkit-details-marker { display: none; }
.num-menu-panel { position: fixed; z-index: 60; width: 270px; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 16, 35, .16); padding: 6px; }
.num-act { display: block; margin: 0; }
.num-act button, a.num-act { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer; text-decoration: none; }
.num-act button:hover, a.num-act:hover { background: var(--tint); color: var(--indigo); }
.num-act .ui-icon { width: 18px; height: 18px; flex: none; }
.num-act.is-danger button { color: var(--err); }
.num-act.is-danger button:hover { background: var(--err-bg); }
.num-act-reason { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.num-act-reason input { flex: 1 1 0; min-width: 0; margin: 0; padding: 6px 8px; font-size: var(--fs-xs); }
.num-act-reason button { width: auto; flex: none; }
/* The same actions as a toolbar on the edit page. */
.num-actbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-4); }
.num-actbar .num-act button { width: auto; border: 1px solid var(--line); background: var(--card); padding: 7px 12px; }
.num-actbar .num-act-reason { border: 1px solid var(--line); border-radius: 8px; padding: 2px 2px 2px 8px; }
.num-actbar .num-act-reason button { border: 0; }
.num-actbar .num-act-reason input { width: 150px; border: 0; }

/* «افزودن شماره»: method tabs; only the chosen method's fields show (with JS). */
.num-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-3); }
.num-tabs label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 700; font-size: var(--fs-sm); color: var(--muted); }
.num-tabs label:has(input:checked) { border-color: var(--indigo); color: var(--indigo); background: var(--tint); }
.num-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.num-tabs .ui-icon { width: 16px; height: 16px; }
.num-add[data-mode="single"] [data-mode]:not([data-mode="single"]),
.num-add[data-mode="range"] [data-mode]:not([data-mode="range"]),
.num-add[data-mode="file"] [data-mode]:not([data-mode="file"]) { display: none; }
.num-add a.hint { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--indigo); text-decoration: none; }
.num-report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--sp-3); padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }

/* Owner info: only the chosen person type's fields show (with JS). */
.num-owner-type { display: flex; gap: 18px; margin-bottom: var(--sp-3); }
.num-owner-type label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.num-owner[data-owner-type="real"] [data-for="legal"], .num-owner[data-owner-type="legal"] [data-for="real"] { display: none; }
.num-owner .field .jdate { display: flex; width: 100%; margin-top: var(--sp-1); }
.num-table td:has(> .num-status-note) { min-width: 170px; }

/* Icon-only row actions (users list): the label shows as a tooltip on hover / keyboard focus
   (panel.js «data-tip»), and is also the button's aria-label. */
.row-actions { white-space: nowrap; }
.row-actions > * { display: inline-flex; vertical-align: middle; margin: 0 2px; }
.row-actions form { margin: 0 2px; }
.icon-act { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; font: inherit; }
.icon-act .ui-icon { width: 18px; height: 18px; }
.icon-act:hover, .icon-act:focus-visible { border-color: var(--indigo); color: var(--indigo); background: var(--tint); }
.icon-act-primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.icon-act-primary:hover, .icon-act-primary:focus-visible { background: var(--indigo); color: #fff; filter: brightness(1.12); }
.icon-act-danger { background: var(--err-bg); border-color: #f4c9d1; color: var(--err); }
.icon-act-danger:hover, .icon-act-danger:focus-visible { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.ui-tip { position: fixed; z-index: 200; font-family: var(--font-ui); font-weight: 500; max-width: 240px; padding: 5px 10px; border-radius: 7px; background: #1d1b2f; color: #fff; font-size: var(--fs-sm); line-height: 1.6; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(11, 16, 35, .22); opacity: 0; transition: opacity .12s; }
.ui-tip.is-on { opacity: 1; }
.toolbar > .icon-act, .toolbar > form:has(> .icon-act) { align-self: center; }

/* «مدیریت اعتبار» on تاریخچه مالی (financial-log.php?user_id=…): customer header + native <dialog>. */
.credit-customer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.credit-customer h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.credit-customer h2 .ui-icon { width: 20px; height: 20px; color: var(--indigo); }
.credit-customer p { margin: 0; }
.credit-customer .btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.credit-customer .btn .ui-icon { width: 16px; height: 16px; flex: none; }
.credit-dialog { width: min(560px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: 0 24px 60px rgba(11, 16, 35, .28); }
.credit-dialog::backdrop { background: rgba(11, 16, 35, .5); backdrop-filter: blur(2px); }
.credit-dialog[open] { animation: modal-in .18s ease; }
.credit-form { display: grid; gap: 16px; padding: 0 22px 20px; }
.credit-dialog-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -22px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.credit-dialog-head h2 { margin: 0; font-size: var(--fs-lg, 1.1rem); }
.credit-figures { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; margin: 0; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.credit-figures dt { color: var(--muted); }
.credit-figures dd { margin: 0; font-weight: 700; }
.credit-figures dd small { font-weight: 400; color: var(--muted); }
.credit-figures dd.is-up { color: var(--ok); }
.credit-figures dd.is-down { color: var(--err); }
.credit-amount { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
.credit-amount > label { flex: 1 1 220px; margin: 0; }
.credit-direction { display: flex; gap: 16px; padding-bottom: 10px; }
.credit-direction label { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.credit-form textarea { width: 100%; resize: vertical; }
.credit-form .form-actions { margin: 0; justify-content: flex-start; }
