/* SarafSho — dark & gold theme */
:root {
  --bg: #070d1a;
  --bg-2: #0c1730;
  --panel: #101e3a;
  --line: rgba(212, 175, 55, 0.28);
  --gold: #d4af37;
  --gold-2: #f3d97a;
  --gold-3: #a8841c;
  --text: #eef1f7;
  --muted: #a9b3c7;
  --radius: 16px;
  --font-fa: "Vazirmatn", "Noto Naskh Arabic", Tahoma, sans-serif;
  --font-latin: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-latin);
  background: radial-gradient(1200px 600px at 50% -10%, #12264f 0%, var(--bg) 60%) fixed;
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[lang^="fa"] body, html[lang="ar"] body { font-family: var(--font-fa); }
html[lang="zh"] body { font-family: var(--font-zh); }

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }

.container { width: min(1120px, 92%); margin-inline: auto; }

.gold-text {
  background: linear-gradient(90deg, var(--gold-3), var(--gold-2), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 13, 26, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); object-fit: cover; }
.brand span { font-weight: 800; font-size: 1.1rem; letter-spacing: .3px; }

.nav {
  display: flex; gap: 4px; margin-inline: auto;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); padding: 6px 9px; border-radius: 999px;
  font-size: .86rem; white-space: nowrap; transition: .2s;
}
.nav a:hover, .nav a.active { color: var(--bg); background: linear-gradient(90deg, var(--gold-2), var(--gold)); }

.lang-wrap { flex-shrink: 0; }
.lang-select {
  background: var(--panel); color: var(--gold-2);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; font: inherit; font-size: .85rem; cursor: pointer;
}
.lang-select:focus { outline: 2px solid var(--gold); }

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 0; padding-bottom: 4px; }
  .lang-wrap { margin-inline-start: auto; }
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; text-align: center; }
.hero-logo {
  width: clamp(170px, 28vw, 260px); margin: 0 auto 26px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(212, 175, 55, .18);
}
.eyebrow { color: var(--gold); font-size: .95rem; letter-spacing: .6px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); line-height: 1.35; margin-bottom: 14px; }
.hero p.lead { color: var(--muted); max-width: 720px; margin: 0 auto 28px; font-size: 1.05rem; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font: inherit; font-weight: 700;
  border: 1px solid var(--gold); cursor: pointer; transition: .2s;
}
.btn-gold { background: linear-gradient(90deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); color: #1a1403; }
.btn-gold:hover { transform: translateY(-2px); color: #1a1403; box-shadow: 0 10px 28px rgba(212, 175, 55, .35); }
.btn-ghost { background: transparent; color: var(--gold-2); }
.btn-ghost:hover { background: rgba(212, 175, 55, .12); }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Sections ---------- */
section { padding: 46px 0; }
.section-title { text-align: center; font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.divider { width: 90px; height: 3px; margin: 10px auto 22px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--gold); }
.card h3 { color: var(--gold-2); margin-bottom: 8px; font-size: 1.12rem; }
.card p { color: var(--muted); font-size: .95rem; }
.icon-badge {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  display: grid; place-items: center; font-weight: 800; color: #1a1403;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
}

.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } }
.founder { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.founder .name { font-size: 1.3rem; font-weight: 800; }
.founder .latin { color: var(--muted); direction: ltr; }
.founder .role { color: var(--gold); font-size: .9rem; }

/* Social widgets */
.social-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.social-card .net { font-weight: 800; color: var(--gold-2); }
.social-card .handle { color: var(--muted); font-size: .85rem; direction: ltr; unicode-bidi: plaintext; }

/* Form */
.form-card { max-width: 720px; margin-inline: auto; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .88rem; color: var(--gold-2); }
.field input, .field select, .field textarea {
  background: #0a1429; color: var(--text); font: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.field textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: .93rem; display: none; }
.form-msg.ok { display: block; background: rgba(46, 160, 100, .15); border: 1px solid rgba(46, 160, 100, .5); }
.form-msg.err { display: block; background: rgba(210, 70, 70, .15); border: 1px solid rgba(210, 70, 70, .5); }
.small { font-size: .8rem; color: var(--muted); }

/* Floating live support */
.live-support {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: #1a1403; font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.live-support:hover { color: #1a1403; transform: translateY(-2px); }
.live-support .dot { width: 10px; height: 10px; border-radius: 50%; background: #18a558; box-shadow: 0 0 0 0 rgba(24, 165, 88, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(24, 165, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 165, 88, 0); } }

/* Footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 28px 0 90px; background: rgba(5, 9, 18, .8); }
.footer-grid { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.footer-grid h4 { color: var(--gold-2); margin-bottom: 8px; }
.footer-grid ul { list-style: none; }
.footer-grid li { font-size: .9rem; color: var(--muted); direction: ltr; text-align: start; }
.copy { text-align: center; margin-top: 22px; color: var(--muted); font-size: .82rem; }

/* Coming soon */
.coming { flex: 1; display: grid; place-items: center; text-align: center; padding: 70px 0; }
.coming .box {
  max-width: 620px; padding: 44px 30px; border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.coming img { width: 120px; margin: 0 auto 18px; border-radius: 50%; }
.coming h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 6px; }
.badge { display: inline-block; padding: 5px 16px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-2); margin: 10px 0 16px; font-weight: 700; }
.coming p { color: var(--muted); margin-bottom: 24px; }

/* ---------- Member portal & admin ---------- */
.nav a.nav-cta { color: #1a1403; background: linear-gradient(90deg, var(--gold-2), var(--gold)); font-weight: 700; }
.nav a.nav-cta:hover { filter: brightness(1.08); }

.portal { padding: 40px 0 70px; flex: 1; }
.narrow { max-width: 520px; margin-inline: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #0a1429; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; padding: 9px; border-radius: 999px; cursor: pointer; }
.tabs button.on { background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: #1a1403; }
.stack { display: grid; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.check input { margin-top: 5px; accent-color: var(--gold); }
.code-box { text-align: center; padding: 18px; margin: 14px 0; border: 1px dashed var(--gold); border-radius: 14px; background: rgba(212,175,55,.06); }
.code-box .code { font-family: ui-monospace, Consolas, monospace; font-size: 1.9rem; letter-spacing: 2px; color: var(--gold-2); direction: ltr; }
.dash-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.dash-head .code { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; color: var(--gold-2); direction: ltr; display: inline-block; }
.dash-grid { display: grid; gap: 18px; margin-top: 18px; }
.dash-grid h2 { color: var(--gold-2); font-size: 1.2rem; margin-bottom: 10px; }
.badge.st-approved, .badge.st-completed { border-color: #2ea064; color: #7be0a8; }
.badge.st-rejected { border-color: #d24646; color: #ff9b9b; }
.badge.st-more_info { border-color: #e0a030; color: #ffd28a; }
.badge.st-pending, .badge.st-in_review, .badge.st-none { border-color: var(--gold); color: var(--gold-2); }
.dash-head .badge, table.t .badge, .kv .badge { margin: 0; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 9px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--gold-2); font-weight: 600; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: rgba(212,175,55,.07); }
.msgcell { color: var(--muted); max-width: 320px; }
.warn { padding: 10px 14px; border-radius: 10px; font-size: .88rem; background: rgba(224,160,48,.12); border: 1px solid rgba(224,160,48,.45); }
.field input[type=file] { padding: 8px; }
[hidden] { display: none !important; }
.steps { counter-reset: s; }

/* admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; }
.admin-bar .btn { padding: 8px 18px; font-size: .9rem; }
.admin-bar .btn.on { background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: #1a1403; }
.admin-bar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters input, .filters select { background: #0a1429; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { overflow-wrap: anywhere; }
.docs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.docs figure { border: 1px solid var(--line); border-radius: 12px; padding: 8px; max-width: 320px; }
.docs img { max-width: 100%; border-radius: 8px; }
.docs figcaption { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.secret { font-family: ui-monospace, Consolas, monospace; direction: ltr; word-break: break-all; background: #0a1429; padding: 10px; border-radius: 8px; border: 1px solid var(--line); user-select: all; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: plaintext; }
.admin-wrap { direction: ltr; text-align: left; }
.admin-wrap .field label { text-align: left; }

.nav a.nav-cta { margin-inline-start: 4px; flex-shrink: 0; }

.narrow-wide { max-width: 900px; margin-inline: auto; }

/* keep the sign-in button always fully visible, even when the menu scrolls */
.nav { min-width: 0; }
.nav a.nav-cta { position: sticky; inset-inline-end: 0; box-shadow: 0 0 0 6px var(--bg); }
.nav a { padding: 6px 8px; font-size: .84rem; }

/* ---------- Mobile bottom tab bar (icons + labels, no swiping) ---------- */
.tabbar { display: none; }
.footer-links { text-align: center; margin-top: 16px; font-size: .88rem; }
.footer-links a { color: var(--gold-2); }
@media (max-width: 860px) {
  .site-header .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; inset-inline: 0; z-index: 70;
    background: rgba(7, 13, 26, .97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; color: var(--muted); font-size: .7rem; line-height: 1.2; text-align: center; border-radius: 10px; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--gold-2); background: rgba(212, 175, 55, .1); }
  body { padding-bottom: 68px; }
  .live-support { bottom: 82px; }
  .site-footer { padding-bottom: 30px; }
}

.wiz { display: flex; justify-content: space-between; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.wiz li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); }
.wiz li b { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 4px; border-radius: 50%; border: 1px solid var(--muted); }
.wiz li.on { color: var(--gold-2); }
.wiz li.on b { border-color: var(--gold); background: rgba(212,175,55,.15); }
