/* ─── Tokens ─────────────────────────────────────────── */
:root {
  /* Gold accent ramp */
  --gold-50:  oklch(97% 0.02 78);
  --gold-100: oklch(92% 0.06 78);
  --gold-200: oklch(85% 0.10 78);
  --gold-400: oklch(74% 0.14 76);
  --gold-500: oklch(66% 0.16 72);
  --gold-700: oklch(50% 0.14 68);
  --gold-900: oklch(32% 0.09 68);

  /* Neutral ramp */
  --n-0:   oklch(98% 0.005 78);
  --n-100: oklch(93% 0.008 78);
  --n-200: oklch(87% 0.010 76);
  --n-400: oklch(65% 0.010 76);
  --n-600: oklch(44% 0.008 76);
  --n-800: oklch(24% 0.008 76);
  --n-900: oklch(16% 0.006 76);

  /* Semantic roles */
  --surface:        var(--n-0);
  --surface-raised: #fff;
  --border:         var(--n-200);
  --text-body:      var(--n-800);
  --text-muted:     var(--n-600);
  --text-inverse:   var(--n-0);
  --accent:         var(--gold-500);
  --accent-hover:   var(--gold-700);
  --accent-light:   var(--gold-50);

  /* Space (8px rhythm) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;

  /* Type scale */
  --text-sm:  0.875rem;
  --text-md:  1rem;
  --text-lg:  1.125rem;
  --text-xl:  1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* Radii & elevation */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 3px oklch(0% 0 0 / 0.08), 0 1px 2px oklch(0% 0 0 / 0.06);
  --shadow-md: 0 4px 12px oklch(0% 0 0 / 0.10), 0 1px 4px oklch(0% 0 0 / 0.06);
  --shadow-lg: 0 8px 24px oklch(0% 0 0 / 0.12);
}

/* ─── Dark mode ──────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --surface:        var(--n-900);
    --surface-raised: var(--n-800);
    --border:         oklch(30% 0.01 76);
    --text-body:      oklch(90% 0.01 78);
    --text-muted:     oklch(60% 0.01 76);
    --text-inverse:   var(--n-900);
    --accent:         var(--gold-400);
    --accent-hover:   var(--gold-200);
    --accent-light:   oklch(24% 0.04 74);
  }
}

/* ─── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  direction: rtl;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
  background: var(--surface);
  color: var(--text-body);
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

/* ─── Top-bar ────────────────────────────────────────── */
.topbar {
  background: var(--gold-900);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  padding-block: var(--sp-2);
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.topbar-trading {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--gold-500);
  color: var(--n-900);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-sm);
  transition: background 160ms ease;
}
.topbar-trading:hover {
  background: var(--gold-400);
  color: var(--n-900);
}
.topbar-info { opacity: .85; }

/* ─── Header / Nav ───────────────────────────────────── */
.site-header {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-4);
  gap: var(--sp-6);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-body);
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gold-500);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.logo-text strong {
  display: block;
  font-size: var(--text-lg);
  line-height: 1.2;
  color: var(--gold-700);
}
.logo-text span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--sp-2);
}
.site-nav a {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--text-body);
  font-size: var(--text-md);
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
}
.site-nav a:hover,
.site-nav a.active {
  background: var(--accent-light);
  color: var(--gold-700);
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--text-body);
}
.menu-toggle svg { display: block; }

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(160deg, oklch(20% 0.06 72 / .96) 0%, oklch(14% 0.04 68 / .98) 100%),
    url("https://images.unsplash.com/photo-1610375461246-83df859d849d?w=1600&q=80") center/cover no-repeat;
  color: var(--text-inverse);
  padding-block: var(--sp-24);
  text-align: center;
}
.hero-label {
  display: inline-block;
  background: var(--gold-500);
  color: var(--n-900);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-4);
  border-radius: 100px;
  margin-bottom: var(--sp-4);
  letter-spacing: 0.04em;
}
.hero h1 {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  line-height: 1.3;
  margin-bottom: var(--sp-4);
}
.hero h1 em {
  font-style: normal;
  color: var(--gold-400);
}
.hero p {
  font-size: var(--text-lg);
  opacity: .85;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--sp-8);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--r-sm);
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 160ms ease, transform 120ms ease;
}
.btn:active { transform: scale(.97); }
.btn-gold   { background: var(--gold-500); color: var(--n-900); }
.btn-gold:hover { background: var(--gold-700); color: var(--text-inverse); }
.btn-outline {
  background: transparent;
  color: var(--text-inverse);
  border: 2px solid oklch(100% 0 0 / .4);
}
.btn-outline:hover { background: oklch(100% 0 0 / .1); color: var(--text-inverse); }
.hero-actions { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; }

/* ─── Live Rates ─────────────────────────────────────── */
.rates-section {
  background: var(--surface-raised);
  padding-block: var(--sp-12);
}
.section-title {
  text-align: center;
  margin-bottom: var(--sp-8);
}
.section-title h2 {
  font-size: var(--text-2xl);
  color: var(--text-body);
  margin-bottom: var(--sp-2);
}
.section-title p {
  color: var(--text-muted);
  font-size: var(--text-md);
}
.section-title .divider {
  width: 56px;
  height: 3px;
  background: var(--gold-500);
  border-radius: 2px;
  margin: var(--sp-3) auto 0;
}

.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.rate-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.rate-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.rate-card::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--gold-500);
}
.rate-card-icon {
  font-size: 1.8rem;
  margin-bottom: var(--sp-3);
  line-height: 1;
}
.rate-card-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.rate-card-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-body);
  font-variant-numeric: tabular-nums;
}
.rate-card-change {
  font-size: var(--text-sm);
  margin-top: var(--sp-1);
  font-weight: 600;
}
.rate-card-change.up   { color: oklch(52% 0.16 145); }
.rate-card-change.down { color: oklch(52% 0.18 25);  }
.rate-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--sp-3);
}
.rate-loading {
  display: inline-block;
  width: 60px;
  height: 20px;
  background: var(--n-200);
  border-radius: var(--r-sm);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%,100% { opacity: .5; }
  50%      { opacity: 1;  }
}

/* ─── Services ───────────────────────────────────────── */
.services-section {
  padding-block: var(--sp-16);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-6);
  margin-top: var(--sp-8);
}
.service-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.service-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-light);
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 0 auto var(--sp-4);
}
.service-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--sp-2);
  color: var(--text-body);
}
.service-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.8;
}

/* ─── Trust bar ──────────────────────────────────────── */
.trust-bar {
  background: var(--gold-900);
  color: var(--text-inverse);
  padding-block: var(--sp-12);
}
.trust-bar .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-8);
  text-align: center;
}
.trust-item strong {
  display: block;
  font-size: var(--text-2xl);
  color: var(--gold-400);
  line-height: 1.2;
}
.trust-item span {
  font-size: var(--text-sm);
  opacity: .8;
}

/* ─── Page hero (inner pages) ────────────────────────── */
.page-hero {
  background: linear-gradient(160deg, var(--gold-900) 0%, oklch(22% 0.07 72) 100%);
  color: var(--text-inverse);
  padding-block: var(--sp-16);
  text-align: center;
}
.page-hero h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-3);
}
.page-hero p { opacity: .8; font-size: var(--text-lg); }

/* ─── About content ──────────────────────────────────── */
.about-section { padding-block: var(--sp-16); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: center;
}
.about-grid img {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.about-content h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-4);
}
.about-content p {
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  line-height: 1.9;
}
.values-list {
  list-style: none;
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.values-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--text-md);
}
.values-list li::before {
  content: '✦';
  color: var(--gold-500);
  flex-shrink: 0;
  margin-top: 4px;
}

/* ─── Contact ────────────────────────────────────────── */
.contact-section { padding-block: var(--sp-16); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--sp-10);
}
.contact-info h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-6);
}
.contact-item {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  align-items: flex-start;
}
.contact-item-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-item-text strong {
  display: block;
  font-size: var(--text-md);
  margin-bottom: var(--sp-1);
  color: var(--text-body);
}
.contact-item-text span {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.contact-form-wrap {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-md);
}
.contact-form-wrap h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-6);
}
.form-group {
  margin-bottom: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-body);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-body);
  font-family: inherit;
  font-size: var(--text-md);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  outline: none;
  direction: rtl;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px oklch(74% 0.14 76 / .18);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group input.error,
.form-group textarea.error { border-color: oklch(52% 0.18 25); }
.form-error-msg {
  font-size: var(--text-sm);
  color: oklch(52% 0.18 25);
  display: none;
}
.form-group.has-error .form-error-msg { display: block; }
.form-success {
  display: none;
  background: oklch(95% 0.06 145);
  color: oklch(35% 0.12 145);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  text-align: center;
  font-weight: 600;
  margin-top: var(--sp-4);
}

/* Map embed */
.map-wrap {
  margin-top: var(--sp-10);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.map-wrap iframe {
  width: 100%;
  height: 320px;
  display: block;
  border: none;
}

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--n-900);
  color: oklch(80% 0.01 76);
  padding-block: var(--sp-12) var(--sp-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-10);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid oklch(30% 0.008 76);
  margin-bottom: var(--sp-6);
}
.footer-brand .logo-icon  { background: var(--gold-700); margin-bottom: var(--sp-3); }
.footer-brand .logo-text strong { color: var(--gold-400); }
.footer-brand .logo-text span   { color: oklch(60% 0.01 76); }
.footer-brand p {
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  line-height: 1.9;
  opacity: .75;
}
.footer-col h4 {
  font-size: var(--text-md);
  color: var(--gold-400);
  margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; display: grid; gap: var(--sp-2); }
.footer-col ul a {
  font-size: var(--text-sm);
  color: oklch(70% 0.01 76);
  transition: color 140ms ease;
}
.footer-col ul a:hover { color: var(--gold-400); }
.footer-col p {
  font-size: var(--text-sm);
  opacity: .75;
  line-height: 1.8;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  opacity: .6;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ─── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin-inline: var(--sp-2); }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4);
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-header { position: relative; }
  .header-inner { position: relative; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid img { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 520px) {
  .trust-bar .container { grid-template-columns: 1fr 1fr; }
  .topbar .container { flex-direction: column; text-align: center; }
}

/* ─── Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Membership Section ── */
.membership-section {
  padding: 4rem 1.5rem;
  background: oklch(97% 0.01 80);
  text-align: center;
}

.membership-card {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid oklch(88% 0.02 80);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 2px 12px oklch(50% 0.03 80 / 0.08);
}

.membership-card h2 {
  font-size: 1.5rem;
  color: oklch(35% 0.06 50);
  margin-bottom: 0.5rem;
}

.membership-card p {
  color: oklch(55% 0.04 50);
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  flex-direction: row-reverse; /* RTL */
}

#phoneInput {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid oklch(82% 0.03 80);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  direction: ltr;
  transition: border-color 0.15s;
}

#phoneInput:focus {
  outline: none;
  border-color: oklch(68% 0.15 55); /* accent gold */
}

#submitBtn {
  padding: 0.75rem 1.5rem;
  background: oklch(72% 0.14 55);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
  min-width: 44px;
  min-height: 44px;
}

#submitBtn:hover { background: oklch(65% 0.14 55); }
#submitBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-hint {
  font-size: 0.8rem;
  color: oklch(65% 0.03 80);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.form-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.form-message.success { color: oklch(45% 0.15 145); }
.form-message.error   { color: oklch(45% 0.2 25); }

@media (max-width: 480px) {
  .input-group { flex-direction: column; }
}
