/* ============================================================
   توکن‌های طراحی
   پالت رنگ برگرفته از دنیای مهندسی برق: مس (سیم‌پیچ)، سبز اسیلوسکوپ،
   و کاغذ طرح مداری (شماتیک) به‌جای رنگ‌های کلیشه‌ای وب‌سایت‌های عمومی.
   ============================================================ */
:root {
  --ink: #161A20;
  --paper: #F4F5F2;
  --paper-dim: #E7E9E4;
  --copper: #C97A3E;
  --copper-dark: #A8622E;
  --trace: #2E6B63;
  --muted: #6B7178;
  --white: #FFFFFF;
  --line: rgba(22, 26, 32, 0.14);
  --radius: 3px;
}

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

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

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

/* ---------------- Header ---------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark { color: var(--copper); display: inline-flex; }
.main-nav { display: flex; align-items: center; gap: 22px; font-size: 0.95rem; }
.main-nav a:hover { color: var(--copper-dark); }
.inline-form { display: inline; }
.link-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; color: var(--muted); padding: 0;
}
.link-btn:hover { color: var(--copper-dark); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--copper); border-color: var(--copper); color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-full { width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 84px 0 96px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  color: var(--copper-dark);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.3;
  margin: 0 0 20px;
  font-weight: 800;
  max-width: 16ch;
}
.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 46ch;
  margin: 0 0 30px;
}
.hero-schematic { width: 100%; height: auto; color: var(--copper); }
.hero-schematic .trace-alt { color: var(--trace); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-schematic { max-width: 320px; margin: 0 auto; }
}

/* ---------------- Course grid ---------------- */
.section { padding: 64px 0; }
.section-head { margin-bottom: 34px; }
.section-head h2 { font-size: 1.6rem; margin: 0 0 8px; font-weight: 800; }
.section-head p { color: var(--muted); margin: 0; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.course-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.course-thumb {
  aspect-ratio: 16/9;
  background: var(--ink);
  border-bottom: 3px solid var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-dim);
  background-size: cover;
  background-position: center;
}
.course-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.course-desc { color: var(--muted); font-size: 0.92rem; margin: 0; flex: 1; }

.spec-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 0.85rem;
}
.spec-item { display: flex; flex-direction: column; gap: 2px; }
.spec-label { color: var(--muted); }
.spec-value { font-weight: 700; }

.course-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 800; font-size: 1.05rem; }
.price small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------------- Course detail ---------------- */
.course-detail { padding: 56px 0; display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 40px; align-items: start; }
.course-detail h1 { font-size: 1.9rem; margin: 0 0 16px; }
.video-frame {
  aspect-ratio: 16/9;
  background: var(--ink);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--paper-dim);
  margin-bottom: 22px;
  overflow: hidden;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.locked-note { padding: 24px; text-align: center; }

.spec-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px;
  position: sticky;
  top: 90px;
}
.spec-sheet .price { font-size: 1.6rem; display: block; margin-bottom: 18px; }
.spec-sheet dl { margin: 0 0 20px; }
.spec-sheet .row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.spec-sheet .row:first-child { border-top: none; }
.spec-sheet dt { color: var(--muted); }
.spec-sheet dd { margin: 0; font-weight: 700; }

@media (max-width: 860px) {
  .course-detail { grid-template-columns: 1fr; }
  .spec-sheet { position: static; }
}

/* ---------------- Forms ---------------- */
.form-page { max-width: 420px; margin: 64px auto; }
.form-page h1 { font-size: 1.5rem; margin-bottom: 6px; }
.form-page .sub { color: var(--muted); margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }
.form-error {
  background: #FBEAE4;
  border: 1px solid var(--copper);
  color: var(--copper-dark);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.form-footnote { margin-top: 18px; font-size: 0.9rem; color: var(--muted); }

/* ---------------- Dashboard / tables ---------------- */
.page-head { padding: 44px 0 8px; }
.page-head h1 { font-size: 1.7rem; margin: 0; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
}
.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.table th { background: var(--paper-dim); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag-paid { background: #E3EFEC; color: var(--trace); }
.tag-pending { background: #FBF0DE; color: #96690F; }
.tag-failed { background: #FBEAE4; color: var(--copper-dark); }

.admin-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.row-actions { display: flex; gap: 10px; }
.row-actions form { display: inline; }
.text-btn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--copper-dark); font-size: 0.88rem; padding: 0;
}

/* ---------------- Checkout / result ---------------- */
.checkout-box, .result-box {
  max-width: 480px;
  margin: 64px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--white);
  text-align: center;
}
.result-box.success { border-top: 4px solid var(--trace); }
.result-box.failed { border-top: 4px solid var(--copper); }
.checkout-summary { text-align: right; margin: 24px 0; }
.checkout-summary .row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.checkout-summary .row:first-child { border-top: none; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 0.88rem; color: var(--muted); }
.footer-contact { display: flex; gap: 18px; }
.footer-contact a:hover { color: var(--copper-dark); }
.muted { color: var(--muted); }

/* ---------------- Tutor / About ---------------- */
.tutor-hero { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: center; }
.tutor-photo-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  border-top: 4px solid var(--copper);
}
.tutor-photo-frame img { width: 100%; display: block; }
.tutor-hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 6px; font-weight: 800; }
.tutor-role { color: var(--copper-dark); font-weight: 600; margin: 0 0 16px; }
.tutor-hero p.intro { color: var(--muted); font-size: 1.05rem; max-width: 52ch; margin: 0 0 26px; }

@media (max-width: 860px) {
  .tutor-hero { grid-template-columns: 1fr; }
  .tutor-photo-frame { max-width: 320px; margin: 0 auto; }
}

.about-section { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.credential-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.credential-list li { display: flex; gap: 12px; padding-inline-start: 0; font-size: 0.98rem; }
.credential-list .bullet { color: var(--copper); flex-shrink: 0; margin-top: 2px; }
.about-photo { border-radius: var(--radius); overflow: hidden; border-top: 4px solid var(--trace); border: 1px solid var(--line); }
.about-photo img { width: 100%; display: block; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; margin: 0 auto; order: -1; }
}

.tutor-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--white);
  margin-top: 22px;
}
.tutor-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.tutor-card .name { font-weight: 700; font-size: 0.95rem; }
.tutor-card .role { color: var(--muted); font-size: 0.82rem; }

.btn-telegram { background: var(--trace); border-color: var(--trace); }
.btn-telegram:hover { background: #24534C; border-color: #24534C; }
