/* ===== Barqh — brand tokens ===== */
:root {
  --primary: #FF6A00;
  --secondary: #FFB800;
  --accent: #FFE8CC;
  --dark: #0D1321;
  --dark-gray: #1C2338;
  --light-gray: #F5F6FA;
  --gradient: linear-gradient(90deg, #FF6A00 0%, #FFB800 100%);
  --radius: 16px;
}

[data-theme="light"] {
  --bg: var(--light-gray);
  --surface: #FFFFFF;
  --text: var(--dark);
  --muted: #5A6172;
  --border: #E4E7EF;
  --accent-soft: var(--accent);
  --deep-orange: #C24E00; /* WCAG-safe orange for small text on light */
  --shadow: 0 10px 30px rgba(13, 19, 33, 0.07);
}

[data-theme="dark"] {
  --bg: var(--dark);
  --surface: var(--dark-gray);
  --text: var(--light-gray);
  --muted: #A9B1C6;
  --border: #2A3350;
  --accent-soft: rgba(255, 106, 0, 0.14);
  --deep-orange: #FFB84D;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ===== Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }

.container {
  width: min(1100px, 100% - 2.5rem);
  margin-inline: auto;
}

::selection { background: var(--secondary); color: var(--dark); }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--dark);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient);
  color: var(--dark);
  box-shadow: 0 6px 18px rgba(255, 106, 0, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(255, 106, 0, 0.45); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}
[data-theme="dark"] .btn-outline { border-color: #3A4468; }
.btn-outline:hover { border-color: var(--primary); color: var(--deep-orange); }

.btn-lg { font-size: 1.1rem; padding: 0.85rem 2.2rem; }
.btn-sm { font-size: 0.9rem; padding: 0.5rem 1.2rem; }
.btn-block { width: 100%; }

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.brand-name {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav-links > a:not(.btn) {
  text-decoration: none;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav-links > a:not(.btn):hover { color: var(--primary); }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Theme switch */
.theme-switch {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-switch svg {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.icon-sun { right: 8px; }
.icon-moon { left: 8px; }
.switch-knob {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient);
  transition: transform 0.2s ease;
}
[data-theme="light"] .switch-knob { transform: translateX(-24px); }

/* Burger (mobile) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
}

.nav-cta-mobile { display: none; }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
}
.hero::before {
  width: 420px;
  height: 420px;
  background: var(--primary);
  top: -160px;
  inset-inline-start: -120px;
}
.hero::after {
  width: 380px;
  height: 380px;
  background: var(--secondary);
  bottom: -140px;
  inset-inline-end: -100px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.3;
  max-width: 800px;
  margin-inline: auto;
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 640px;
  margin: 1.2rem auto 0;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* Mockup */
.mockup {
  position: relative;
  max-width: 400px;
  margin: 3.2rem auto 0;
}
.mockup-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: start;
}
.mockup-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  background: var(--gradient);
}
.bot-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dark);
  flex-shrink: 0;
}
.bot-meta strong { display: block; line-height: 1.3; }
.bot-meta small { opacity: 0.85; }

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem;
}
.msg {
  max-width: 82%;
  padding: 0.55rem 0.95rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.msg.user {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--text);
  border-start-start-radius: 4px;
}
.msg.bot {
  align-self: flex-end;
  background: var(--bg);
  border: 1px solid var(--border);
  border-start-end-radius: 4px;
}
.msg.result { font-weight: 700; color: var(--deep-orange); }

.settings-card {
  align-self: flex-end;
  width: 88%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.settings-card .row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
}
.settings-card .row span { color: var(--muted); }
.mockup-btn { margin-top: 0.35rem; }

.float-chip {
  position: absolute;
  bottom: -14px;
  inset-inline-start: -18px;
  background: var(--gradient);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: floaty 3.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ===== Sections ===== */
.section { padding: 4.5rem 0; }
.section-alt {
  background: color-mix(in srgb, var(--surface) 40%, var(--bg));
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 2.4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

/* Problem / Solution */
.ps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 2.2rem;
}
.ps-card p { font-size: 1.05rem; margin-top: 0.9rem; }

.chip {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.95rem;
  border-radius: 999px;
}
.chip-gray { background: var(--border); color: var(--muted); }
.chip-gradient { background: var(--gradient); color: var(--dark); }

.ps-card.before { opacity: 0.92; }
.ps-card.after {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient) border-box;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.4rem;
}
.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin: 1rem 0 0.4rem; }
.feature-card p { color: var(--muted); font-size: 0.97rem; }

.feature-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--primary);
}
[data-theme="dark"] .feature-icon { color: var(--secondary); }
.feature-icon svg { width: 26px; height: 26px; }

/* How it works */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-top: 2.6rem;
  counter-reset: step;
}
.step {
  position: relative;
  text-align: center;
  padding-top: 2.4rem;
}
.step-num {
  position: absolute;
  top: -24px;
  right: 50%;
  transform: translateX(50%);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--dark);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.35);
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

.steps-wrap-none { display: none; }

/* Pricing */
.pricing-toggle {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 auto 2.6rem;
  width: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
}
.toggle-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.4rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.toggle-btn small { font-weight: 500; }
.toggle-btn.active {
  background: var(--gradient);
  color: var(--dark);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
}
.pricing-card h3 { font-size: 1.25rem; font-weight: 800; }
.pricing-card.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient) border-box;
  transform: scale(1.03);
  z-index: 1;
}
.ribbon {
  position: absolute;
  top: -14px;
  right: 50%;
  transform: translateX(50%);
  white-space: nowrap;
  background: var(--gradient);
  color: var(--dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 1rem;
  border-radius: 999px;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 1.1rem 0 0.4rem;
}
.amount { font-size: 2.3rem; font-weight: 800; line-height: 1; }
.currency { font-weight: 700; color: var(--muted); }
.period { color: var(--muted); font-size: 0.95rem; }

.save-chip {
  display: none;
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  background: var(--accent-soft);
  color: var(--deep-orange);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
}
[data-billing="annual"] .save-chip { display: inline-flex; }

.plan-features {
  list-style: none;
  text-align: start;
  margin: 1.3rem 0 1.6rem;
  flex-grow: 1;
}
.plan-features li {
  position: relative;
  padding-inline-start: 1.7rem;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.plan-features li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.32em;
  width: 17px;
  height: 17px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23FF6A00" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>') center/contain no-repeat;
}

.pricing-note {
  text-align: center;
  margin-top: 2.2rem;
  font-size: 1.05rem;
}
.pricing-note a {
  color: var(--deep-orange);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.pricing-update {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* For who */
.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.4rem;
}
.who-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 0.4rem; }
.who-card p { color: var(--muted); font-size: 0.97rem; }

/* FAQ */
.faq-container { max-width: 780px; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.2s ease;
}
.faq-item[open] .chevron { transform: rotate(180deg); }
.faq-item p {
  padding: 0 1.3rem 1.15rem;
  color: var(--muted);
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--light-gray);
  padding-top: 3.2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2.5rem;
  padding-bottom: 2.2rem;
}
.brand-footer { color: var(--light-gray); }
.tagline { color: #A9B1C6; margin-top: 0.5rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}
.footer-links a {
  text-decoration: none;
  color: #A9B1C6;
  font-weight: 500;
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--secondary); }

.footer-bottom {
  border-top: 1px solid rgba(245, 246, 250, 0.12);
  padding-block: 1.1rem;
  text-align: center;
  font-size: 0.88rem;
  color: #A9B1C6;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: 68px;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.3rem;
    display: none;
    box-shadow: var(--shadow);
  }
  .navbar.open .nav-links { display: flex; }
  .nav-links > a:not(.btn) {
    padding: 0.55rem 0.2rem;
    font-size: 1.05rem;
  }
  .nav-cta-mobile { display: inline-flex; margin-top: 0.5rem; }
  .nav-burger { display: flex; }
  .nav-cta-desktop { display: none; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.6rem; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .pricing-card.featured { transform: none; }
  .who-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; place-items: center; gap: 1.8rem; }
}

@media (max-width: 600px) {
  .section { padding: 3.4rem 0; }
  .hero { padding: 3.4rem 0 4rem; }
  .hero-ctas .btn { width: 100%; }
  .ps-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .float-chip { inset-inline-start: 50%; transform: translateX(50%); animation: none; }
  .mockup { max-width: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
