/* Haseen Plus landing — Sky Trust. Logical properties keep RTL (ar) and LTR (en) correct.
   Tokens are the DESIGN.md authority values. */

/* Thmanyah Sans (خط ثمانية الرقمي) — free for commercial use: https://font.thmanyah.com/ */
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah-sans-700.woff2") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("fonts/thmanyah-sans-900.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
:root {
  --bg: #FBF4E4;
  --tint: #F1E2C0;
  --bubble: #EAF1FA;
  --accent: #2E86E0;
  --accent-dark: #1B5FB8;
  --navy: #14304E;
  --ink: #233240;
  --safe: #1F9D55;
  --warn: #E8A23D;
  --danger: #D64545;
  --danger-text: #B93838;
  --danger-bg: #FBE9E9;
  --warn-bg: #FAF0DC;
  --safe-bg: #E4F4EB;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(27, 95, 184, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Thmanyah Sans", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}

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

.container { max-width: 1000px; margin-inline: auto; padding-inline: 20px; }

/* --- Nav --- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 14px; gap: 12px;
}
.nav-logo { font-weight: 800; font-size: 1.25rem; color: var(--navy); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-logo img { width: 26px; height: 26px; display: block; }
.nav-links { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }
.nav-links a { text-decoration: none; opacity: 0.75; }
.nav-links a:hover { opacity: 1; }

.btn {
  display: inline-block; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 10px 24px; font-weight: 700;
  text-decoration: none; border: none; font-size: 1rem;
}
.btn:hover { filter: brightness(1.08); }
.btn-nav { padding: 8px 18px; font-size: 0.85rem; opacity: 1; }

/* --- Hero --- */
.hero { text-align: center; padding-block: 48px 64px; }
.hero-title { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; line-height: 1.3; color: var(--navy); }
.accent { color: var(--accent); }
.hero-sub { max-width: 560px; margin: 12px auto 28px; opacity: 0.8; font-size: 1.05rem; }

/* --- Chat mock --- */
.chat {
  background: #fff; border: 1px solid var(--tint); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; max-width: 420px;
  margin: 0 auto 28px; text-align: start; font-size: 0.95rem;
}
.msg { width: fit-content; max-width: 90%; padding: 9px 14px; margin-block-end: 10px; }
.msg-user {
  background: var(--accent); color: #fff;
  border-radius: 14px 14px 14px 14px;
  border-end-end-radius: 4px;
  margin-inline-start: auto;
}
.msg-bot { background: var(--bubble); border-radius: 14px; border-end-start-radius: 4px; }
.typing { letter-spacing: 3px; opacity: 0.5; }

.card-title { font-weight: 800; }
.card-meta { font-size: 0.8rem; opacity: 0.7; }
.card-actions { display: flex; gap: 8px; margin-block-start: 10px; }
.chip {
  border-radius: 999px; padding: 5px 16px; font-size: 0.8rem; font-weight: 700;
  background: var(--tint); color: var(--ink);
}
.chip-solid { background: var(--accent); color: #fff; }

/* --- Verdict card (the signature visual: bot's security report) --- */
.verdict-card {
  background: #fff; border: 1px solid var(--tint); border-radius: 12px;
  padding: 12px; margin-block-start: 10px; color: var(--ink);
}
.v-chip {
  display: inline-block; border-radius: 999px; padding: 4px 13px;
  font-size: 0.8rem; font-weight: 700;
}
.v-chip-danger { background: var(--danger-bg); color: var(--danger-text); }
.v-chip-warn   { background: var(--warn-bg);   color: #8a5a10; }
.v-chip-safe   { background: var(--safe-bg);   color: #14683c; }
.v-finding { font-size: 0.85rem; opacity: 0.85; margin-block-start: 8px; }
.scorebar {
  height: 8px; border-radius: 999px; background: var(--tint);
  margin-block-start: 10px; overflow: hidden;
}
.scorebar > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--danger); width: 22%;
  transition: width 0.4s ease, background-color 0.4s ease;
}
.scorebar > i.bar-warn-48 { width: 48%; background: var(--warn); }
.score-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; opacity: 0.8; margin-block-start: 6px;
}
.score-label b { font-weight: 800; }

/* --- Stats strip: three facts instead of Aref's single number --- */
.stats-grid { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.stats-grid .stat {
  background: #fff; border: 1px solid var(--tint); border-radius: 14px;
  padding: 12px 26px; min-width: 130px;
}

/* --- Store badges --- */
.badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge img { height: 52px; width: auto; aspect-ratio: 300 / 89; }
.store-note { font-size: 0.8rem; opacity: 0.55; margin-block-start: 10px; }

/* --- Stats strip --- */
.stats { text-align: center; padding-block: 8px 16px; }
.stat-num { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat-label { opacity: 0.75; font-size: 1rem; }

/* --- Sections --- */
.section { padding-block: 56px; }
.section-title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; text-align: center; margin-block-end: 32px; color: var(--navy); }
.section-sub { text-align: center; opacity: 0.75; max-width: 560px; margin: -18px auto 32px; }

/* --- "How it works" steps --- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step {
  position: relative; background: #fff; border: 1px solid var(--tint);
  border-radius: var(--radius); padding: 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  margin-block-end: 12px;
}
.step-title { font-size: 1.05rem; margin-block-end: 6px; }
.step-text { font-size: 0.92rem; opacity: 0.8; }

/* Step mini-mockups — the hero's components, scaled down. */
.step-mock {
  background: var(--bg); border: 1px solid var(--tint); border-radius: 12px;
  padding: 10px; margin-block-end: 14px; min-height: 88px;
  display: flex; align-items: center; justify-content: center;
}
.mock-app { flex-direction: column; gap: 6px; }
.mock-app-icon {
  width: 44px; height: 44px; border-radius: 12px; display: block;
  box-shadow: 0 4px 10px rgba(27, 95, 184, 0.25);
}
.mock-app-name { font-size: 0.72rem; font-weight: 700; opacity: 0.7; }
.mock-msg { margin-block: 0; font-size: 0.8rem; padding: 6px 12px; }

/* Rotating message word in the step-2 mock (hero.js swaps text every 3s). */
.rot-msg { display: inline-block; transition: opacity 0.3s ease, transform 0.3s ease; }
.rot-msg.rot-out { opacity: 0; transform: translateY(-6px); }
.mock-chat { flex-direction: column; align-items: stretch; gap: 6px; }
.mock-card { margin-block-start: 0; padding: 8px 10px; width: 100%; font-size: 0.8rem; }
.mock-card .card-actions { margin-block-start: 6px; }
.mock-card .chip { padding: 3px 10px; font-size: 0.7rem; }

/* Feature mini-mockups — same components as the steps. */
.feature-mock {
  background: var(--bg); border: 1px solid var(--tint); border-radius: 12px;
  padding: 10px; margin-block: 10px 12px; min-height: 76px;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}

/* Connector arrows between steps — only when they fit side by side. */
@media (min-width: 732px) {
  .step:not(:last-child)::after {
    content: "→";
    position: absolute; inset-inline-end: -21px; top: 50%;
    transform: translateY(-50%); line-height: 1;
    color: var(--accent); opacity: 0.45; font-weight: 800; font-size: 1.2rem;
    pointer-events: none;
  }
  [dir="rtl"] .step:not(:last-child)::after { content: "←"; }
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { background: #fff; border: 1px solid var(--tint); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin-block-end: 6px; font-size: 1.05rem; }
.feature p { font-size: 0.92rem; opacity: 0.8; }

.community { background: var(--tint); border-radius: var(--radius); padding: 32px; text-align: center; }
.community h2 { font-size: 1.4rem; margin-block-end: 8px; }
.community p { max-width: 640px; margin-inline: auto; opacity: 0.85; }

.download { text-align: center; }

/* --- Hero tagline (old slogan, demoted above the H1) --- */
.hero-tagline { font-weight: 700; color: var(--accent-dark); font-size: 1.05rem; margin-block-end: 6px; }

/* --- "What is Haseen Plus" --- */
.about-lead { max-width: 720px; margin: 0 auto; font-size: 1.1rem; opacity: 0.9; text-align: center; }
.about-note { text-align: center; opacity: 0.6; font-size: 0.85rem; margin-block-start: 20px; }

/* --- "Ask for any service" --- */
.examples-label { text-align: center; opacity: 0.6; font-size: 0.9rem; margin-block-end: 10px; }
.service-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 640px; margin-inline: auto; }
.cities-note { text-align: center; opacity: 0.75; margin-block-start: 18px; font-size: 0.95rem; }

/* --- FAQ --- */
.faq { max-width: 720px; margin-inline: auto; display: grid; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--tint); border-radius: 12px; padding: 14px 18px; }
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item p { margin-block-start: 8px; font-size: 0.92rem; opacity: 0.85; }
.faq-item a { color: var(--accent); }

/* --- Legal / policy pages --- */
.legal { max-width: 720px; margin-inline: auto; padding-block: 40px 64px; }
.legal h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; margin-block-end: 8px; }
.legal .updated { font-size: 0.85rem; opacity: 0.6; margin-block-end: 28px; }
.legal h2 { font-size: 1.15rem; font-weight: 800; margin-block: 24px 8px; }
.legal p, .legal li { font-size: 0.95rem; opacity: 0.85; }
.legal ul { padding-inline-start: 22px; margin-block: 8px; }
.legal li { margin-block-end: 4px; }
.legal a { color: var(--accent); }

/* --- Footer --- */
.footer { background: var(--ink); color: var(--bg); padding-block: 32px; margin-block-start: 56px; }
.footer .container { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.85rem; }
.footer-links a { opacity: 0.8; text-decoration: none; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* --- Hero animation + steps reveal (only active when hero.js adds .js to <html>) --- */
.js [data-anim] { opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.45s ease; }
.js [data-anim].step-visible { opacity: 1; transform: none; }
.js [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}
.js [data-reveal]:not(.step-visible):nth-child(2) { transition-delay: 0.12s; }
.js [data-reveal]:not(.step-visible):nth-child(3) { transition-delay: 0.24s; }
.js [data-reveal].step-visible { opacity: 1; transform: none; }
.js [data-reveal].step-visible:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-anim], .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
