/* موقع دايرتك. الألوان من palette.css (متولّد من app_colors.dart) بس.
   الموبايل الأول، والكمبيوتر من 760px. الوضع الداكن تلقائي حسب جهاز الزائر. */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/assets/fonts/plex-arabic-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/assets/fonts/plex-arabic-semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/assets/fonts/plex-arabic-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: var(--p-warmWhite);
  --card: var(--p-white);
  --alt: var(--p-sand);
  --text: var(--p-ink);
  --muted: var(--p-inkSoft);
  --border: var(--p-sandLine);
  --brand: var(--p-petrolDeep);
  --brand-text: var(--p-petrol);
  --tint: var(--p-petrolMist);
  --accent: var(--p-gold);
  --accent-text: var(--p-goldDark);
  --on-accent: var(--p-ink);
  --on-brand: var(--p-white);
  --danger: var(--p-danger);
  --success: var(--p-success);
  --logo-letter: var(--p-petrolDeep);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 8px 24px rgb(0 45 64 / 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--p-petrolNight);
    --card: var(--p-petrolNightCard);
    --alt: var(--p-petrolNightCard);
    --text: var(--p-inkNight);
    --muted: var(--p-inkNightSoft);
    --border: rgb(255 255 255 / 0.1);
    --brand-text: var(--p-petrolLight);
    --tint: var(--p-petrolNightRaised);
    --accent-text: var(--p-gold);
    --logo-letter: var(--p-white);
    --shadow: none;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-text);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.narrow {
  width: min(760px, 100% - 32px);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

.lead {
  font-size: 1.125rem;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -48px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* اللوجو */
.logo-letter {
  fill: var(--logo-letter);
  stroke: var(--logo-letter);
}

.logo-dot {
  fill: var(--p-gold);
}

.logo-lines {
  stroke: var(--p-gold);
  fill: none;
}

/* الهيدر */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link,
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  background: var(--tint);
}

.lang-switch {
  border: 1px solid var(--border);
}

/* زرار القايمة (☰) — للموبايل بس */
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

.menu-bars {
  display: grid;
  gap: 5px;
  width: 20px;
}

.menu-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded='true'] .menu-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] .menu-bars span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded='true'] .menu-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 759px) {
  .header-row {
    position: relative;
  }

  .menu-toggle {
    display: grid;
  }

  /* القايمة بتنزل تحت الهيدر بحركة ناعمة */
  .nav {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgb(0 0 0 / 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }

  .nav-link,
  .nav .lang-switch {
    min-height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-md);
  }

  .nav .lang-switch {
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    color: var(--brand-text);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav.is-open,
  .menu-bars span {
    transition: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* «بلّغني أول ما ينزل» */
.waitlist {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.14);
  max-width: 520px;
}

.waitlist-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--p-gold);
}

.waitlist-body {
  margin: 0 0 16px;
  color: rgb(255 255 255 / 0.85);
}

.waitlist-row {
  display: grid;
  gap: 12px;
}

@media (min-width: 480px) {
  .waitlist-row {
    grid-template-columns: 1fr auto;
  }
}

.waitlist input {
  background: var(--p-white);
  color: var(--p-ink);
  border-color: transparent;
  text-align: left;
}

.waitlist-row.has-error input {
  outline: 2px solid var(--p-danger);
}

.waitlist .form-message {
  margin-top: 12px;
  background: rgb(255 255 255 / 0.92);
  color: var(--p-ink);
}

.waitlist .form-message.is-success {
  color: var(--p-success);
}

.waitlist .form-message.is-error {
  color: var(--p-danger);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-xl);
  border: 0;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-gold {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-brand {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-store {
  background: var(--p-white);
  color: var(--p-ink);
  min-width: 160px;
}

.btn-store.is-soon {
  opacity: 0.85;
  cursor: default;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--brand-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-store .badge {
  background: var(--p-goldCream);
  color: var(--p-goldDark);
}

.badge-gold {
  background: var(--accent);
  color: var(--on-accent);
}

/* Hero */
.hero {
  background: var(--p-petrolDeep);
  color: var(--p-white);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 24px;
  padding-block: 48px 56px;
  align-items: center;
}

.hero .eyebrow {
  color: var(--p-gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero .lead {
  color: rgb(255 255 255 / 0.85);
  max-width: 34ch;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  order: -1;
}

.hero-art .logo {
  position: relative;
  width: 140px;
  height: 140px;
}

.hero-art .logo-letter {
  fill: var(--p-white);
  stroke: var(--p-white);
}

.hero-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(217 175 79 / 0.35), transparent 70%);
}

@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    padding-block: 80px;
  }

  .hero-art {
    order: 0;
  }

  .hero-art .logo {
    width: 220px;
    height: 220px;
  }

  .hero-glow {
    width: 420px;
    height: 420px;
  }
}

/* السكاشن */
.section {
  padding-block: 56px;
}

.section-alt {
  background: var(--alt);
}

.section-title {
  margin-bottom: 8px;
}

.section-lead {
  max-width: 60ch;
  margin-bottom: 32px;
}

.page-hero {
  padding-block: 48px 8px;
}

/* الأقسام */
.category-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
}

@media (min-width: 560px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.category {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.category img {
  width: min(112px, 100%);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* الخطوات */
.steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.step p {
  margin: 0;
}

/* العقارات */
.estate {
  display: grid;
  gap: 24px;
  align-items: center;
  background: var(--p-petrolDeep);
  color: var(--p-white);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
}

.estate .lead {
  color: rgb(255 255 255 / 0.85);
}

.estate-art {
  justify-self: center;
  width: 180px;
  border-radius: var(--radius-xl);
}

@media (min-width: 760px) {
  .estate {
    grid-template-columns: 1.5fr 1fr;
    padding: 48px;
  }

  .estate-art {
    width: 240px;
  }
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.checks li {
  position: relative;
  padding-inline-start: 28px;
  margin-bottom: 8px;
}

.checks li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 14px;
  height: 8px;
  /* علامة ✓ بحدود ثابتة (مش بتتقلب مع اتجاه اللغة). */
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}

/* للتجار */
.partner-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.partner-cta .section-lead {
  margin-bottom: 0;
}

/* الكروت والفورم */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-weight: 600;
}

.field-hint {
  font-size: 0.8125rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand-text);
  outline-offset: 0;
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}

.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-message {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--tint);
  font-weight: 600;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--success);
}

/* النصوص الطويلة */
.prose h2 {
  font-size: 1.25rem;
  margin-top: 32px;
}

.prose ul,
.prose ol {
  padding-inline-start: 24px;
}

[lang='ar'] .prose ol {
  list-style: arabic-indic;
}

.prose li {
  margin-bottom: 8px;
}

.prose .card h2 {
  margin-top: 0;
}

.not-found .logo {
  margin-bottom: 16px;
}

/* الفوتر */
.site-footer {
  background: var(--p-petrolDeep);
  color: rgb(255 255 255 / 0.85);
  padding-block: 40px 24px;
  margin-top: 0;
}

.site-footer a {
  color: var(--p-white);
  text-decoration: none;
  display: block;
  padding-block: 6px;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .brand {
  display: inline-flex;
  color: var(--p-white);
}

.site-footer .logo-letter {
  fill: var(--p-white);
  stroke: var(--p-white);
}

.site-footer .muted {
  color: rgb(255 255 255 / 0.7);
}

.footer-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-title {
  font-size: 1rem;
  color: var(--p-gold);
  margin-bottom: 8px;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / 0.15);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 0.875rem;
}

.not-found .btn {
  margin-bottom: 16px;
}
