:root {
  --primary: #1B6B5E;
  --primary-dark: #145249;
  --primary-light: #E8F4F2;
  --secondary: #F5F0E8;
  --accent: #C8A97E;
  --text: #1A1A2E;
  --text-light: #5A5A7A;
  --text-muted: #8A8AA0;
  --bg: #FFFFFF;
  --bg-alt: #FAF8F5;
  --border: #E2DDD5;
  --error: #DC2626;
  --success: #16A34A;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --font: 'Tajawal', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
  --header-h: 72px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Header & Nav ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { font-size: 1.5rem; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); padding: 8px; }
.lang-toggle {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lang-toggle:hover { background: var(--primary); color: #fff; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #145249 50%, #0D3B33 100%);
  color: #fff;
  padding: 80px 0 64px;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; line-height: 1.3; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 680px; margin: 0 auto 32px; line-height: 1.8; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: var(--text); }
.btn-primary:hover { background: #B8945E; color: var(--text); transform: translateY(-1px); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-green { background: var(--primary); color: #fff; }
.btn-green:hover { background: var(--primary-dark); color: #fff; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.section-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 40px;
  max-width: 600px;
}

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg);
  padding: 32px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2rem; margin-bottom: 16px; display: block; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-light); font-size: 0.95rem; line-height: 1.7; }

/* ===== Examples Grid ===== */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.example-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--primary);
}
.example-card h4 { font-size: 1rem; margin-bottom: 8px; color: var(--primary); }
.example-detail { font-size: 0.9rem; color: var(--text-light); margin-bottom: 4px; }
.example-result {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===== Calculator Page ===== */
.calc-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.calc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.calc-card h2 { font-size: 1.3rem; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  direction: rtl;
  background: var(--bg);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.result-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  text-align: center;
  display: none;
}
.result-box.show { display: block; }
.result-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.result-label { color: var(--text-light); font-size: 0.9rem; margin-bottom: 4px; }
.result-breakdown { font-size: 0.9rem; color: var(--text-light); margin-top: 8px; }
.result-notice {
  margin-top: 16px;
  padding: 16px;
  background: #FFF8E1;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #8D6E00;
}

/* ===== Disclaimer Banner ===== */
.disclaimer {
  background: #FFF8E1;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #8D6E00;
  margin-bottom: 24px;
  border-right: 4px solid #FFC107;
}

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  padding: 18px 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  transition: background var(--transition);
  user-select: none;
}
.faq-q:hover { background: var(--bg-alt); }
.faq-q .icon { font-size: 1.2rem; transition: transform var(--transition); }
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-light);
  line-height: 1.8;
}
.faq-item.open .faq-a {
  max-height: 600px;
  padding: 0 24px 18px;
}

/* ===== Content Pages (Guide, About, Legal) ===== */
.content-page { padding: 48px 0; }
.content-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.content-page .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.content-page h2 {
  font-size: 1.4rem;
  margin: 32px 0 12px;
  color: var(--primary);
}
.content-page h3 {
  font-size: 1.15rem;
  margin: 24px 0 8px;
}
.content-page p, .content-page li {
  color: var(--text-light);
  line-height: 1.9;
  margin-bottom: 12px;
}
.content-page ul, .content-page ol { padding-right: 24px; margin-bottom: 16px; }
.content-page blockquote {
  border-right: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.legal-section { margin-bottom: 32px; }
.legal-section h2 { font-size: 1.2rem; margin-bottom: 12px; }
.legal-section p { margin-bottom: 12px; }

/* ===== Blog / Features ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 32px 0;
}
.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.blog-card-img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-body { padding: 20px; }
.blog-card-body h3 { font-size: 1.05rem; margin-bottom: 8px; }
.blog-card-body h3 a { color: var(--text); }
.blog-card-body h3 a:hover { color: var(--primary); }
.blog-card-body p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 12px; line-height: 1.6; }
.blog-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin: 32px 0;
}
.feature-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
}
.feature-card .icon { font-size: 2.2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { color: var(--text); }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.contact-info h3 { margin-bottom: 8px; font-size: 1.1rem; }
.contact-info p { color: var(--text-light); margin-bottom: 16px; }

/* ===== Footer ===== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.8);
  padding: 48px 0 24px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer p { font-size: 0.9rem; line-height: 1.8; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .section { padding: 40px 0; }
  .section-title { font-size: 1.4rem; }

  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 12px 16px; }
  .nav-toggle { display: block; }

  .calc-wrap { grid-template-columns: 1fr; }
  .calc-card { position: static; }

  .examples-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.4rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .calc-card { padding: 20px; }
}
