/* ============================================================
   Tawazon (توازن) — standalone public website
   Brand: violet #7A4FCB + pink #EE5C9D on lavender surfaces.
   RTL-first; flips to LTR when <html dir="ltr">.
   ============================================================ */

:root {
  --violet: #7A4FCB;
  --violet-deep: #5A2CA0;
  --indigo: #2E1A63;
  --pink: #EE5C9D;
  --pink-deep: #DC3F86;
  --lavender: #F4F0FB;
  --lavender-2: #EBE3F8;
  --ink: #241b3a;
  --muted: #6b6480;
  --line: #e6ddf5;
  --white: #ffffff;
  --radius: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 10px rgba(46, 26, 99, .06);
  --shadow: 0 14px 40px rgba(90, 44, 160, .14);
  --maxw: 1120px;
  --grad: linear-gradient(135deg, #7A4FCB 0%, #9B6BE0 45%, #EE5C9D 100%);
  --grad-soft: linear-gradient(135deg, #F4F0FB 0%, #FCE9F2 100%);
  --font: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--violet-deep); text-decoration: none; }
a:hover { color: var(--pink-deep); }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font);
  font-size: 15px;
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(122, 79, 203, .35); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 30px rgba(238, 92, 157, .4); }
.btn-ghost { background: #fff; color: var(--violet-deep); border: 1.5px solid var(--line); }
.btn-ghost:hover { color: var(--pink-deep); border-color: var(--pink); }
.btn-lg { padding: 15px 30px; font-size: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .mark-wrap { display: inline-flex; flex: 0 0 auto; }
.brand .mark { width: 42px; height: 42px; flex: 0 0 auto; }
.brand .brand-text { display: inline-flex; flex-direction: column; justify-content: center; }
.brand .logo-ar { height: 48px; width: auto; display: block; }
.brand .brand-text-ar .brand-sub { margin-top: 4px; }
.brand .brand-name { font-size: 26px; font-weight: 800; color: var(--indigo); line-height: 1.05; }
.brand .brand-sub { display: block; font-size: 11px; color: var(--violet); font-weight: 500; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav a {
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.nav a:hover { background: var(--lavender); color: var(--violet-deep); }
.nav a.cta { background: var(--grad); color: #fff; font-weight: 700; }
.nav a.cta:hover { color: #fff; }

.lang-wrap { position: relative; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--violet-deep);
  border-radius: 999px;
  padding: 8px 32px 8px 14px;
  font-weight: 700;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
html[dir="rtl"] .lang-select { padding: 8px 14px 8px 32px; }
.lang-wrap::after {
  content: "▾";
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--violet);
  font-size: 11px;
}
.lang-select:hover { border-color: var(--pink); color: var(--pink-deep); }

.menu-btn {
  display: none;
  margin-inline-start: auto;
  background: var(--lavender);
  border: 0;
  width: 42px; height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
  color: var(--violet-deep);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--grad-soft);
  overflow: hidden;
  padding: 72px 0 86px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .5;
  z-index: 0;
}
.hero::before { width: 320px; height: 320px; background: radial-gradient(circle, #EE5C9D55, transparent 70%); top: -80px; inset-inline-start: -60px; }
.hero::after { width: 380px; height: 380px; background: radial-gradient(circle, #7A4FCB44, transparent 70%); bottom: -120px; inset-inline-end: -80px; }
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--indigo);
  font-weight: 800;
}
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.hero-art .orb {
  width: 78%;
  max-width: 340px;
  background: #fff;
  border-radius: 40px;
  box-shadow: var(--shadow);
  padding: 30px;
  transform: rotate(-3deg);
}
.hero-art .orb img { width: 100%; height: auto; display: block; }

/* ---------- Store badges ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--indigo);
  color: #fff;
  border-radius: 14px;
  padding: 10px 18px;
  min-width: 165px;
  transition: transform .15s ease, box-shadow .2s;
}
.store-badge:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.store-badge svg { width: 26px; height: 26px; flex: 0 0 auto; }
.store-badge .t { line-height: 1.15; }
.store-badge .t small { display: block; font-size: 11px; opacity: .8; }
.store-badge .t b { font-size: 16px; font-weight: 700; }
.store-badge[hidden] { display: none; }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pink-deep);
  background: #FCE9F2;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(26px, 3.5vw, 36px); color: var(--indigo); margin: 0 0 12px; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ic {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--grad-soft);
  margin-bottom: 18px;
  font-size: 26px;
}
.feature h3 { margin: 0 0 8px; font-size: 19px; color: var(--indigo); }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Portals band ---------- */
.portals { background: var(--grad); color: #fff; border-radius: var(--radius-lg); padding: 42px 38px; }
.portals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.portal-card {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal-card h3 { margin: 0; font-size: 21px; }
.portal-card p { margin: 0 0 16px; opacity: .9; font-size: 15px; }
.portal-card .btn { margin-top: auto; align-self: flex-start; background: #fff; color: var(--violet-deep); }

/* ---------- Story ---------- */
.story { background: var(--grad-soft); }
.story-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: center; }
.story-art { display: grid; place-items: center; }
.story-art img { width: 220px; height: auto; filter: drop-shadow(0 18px 40px rgba(90,44,160,.2)); }
.story h2 { font-size: clamp(26px, 3.5vw, 34px); color: var(--indigo); margin: 0 0 16px; font-weight: 800; }
.story p { font-size: 17px; color: #43395f; margin: 0 0 16px; }
.story .quote {
  font-size: 19px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Closing banner ---------- */
.closing { text-align: center; padding: 64px 0; }
.closing p.c1 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; color: var(--indigo); margin: 0 0 8px; }
.closing p.c2 { font-size: 18px; color: var(--pink-deep); font-weight: 700; margin: 0; }

/* ---------- Content / legal pages ---------- */
.page-hero {
  background: var(--grad-soft);
  padding: 54px 0 46px;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 42px); color: var(--indigo); }
.page-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.content-wrap { max-width: 820px; margin-inline: auto; padding: 48px 20px 72px; }
.content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px 40px;
  box-shadow: var(--shadow-sm);
}
.legal-content { font-size: 16px; color: #3a3350; }
.legal-content h1, .legal-content h2, .legal-content h3 { color: var(--indigo); margin-top: 1.6em; }
.legal-content h1:first-child, .legal-content h2:first-child { margin-top: 0; }
.legal-content a { color: var(--violet); text-decoration: underline; }
.legal-content ul, .legal-content ol { padding-inline-start: 1.4em; }
.legal-content img { border-radius: 10px; margin: 1em 0; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.legal-content td, .legal-content th { border: 1px solid var(--line); padding: 8px 12px; }

.loading, .empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--lavender-2);
  border-top-color: var(--violet);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Steps (delete account) ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li {
  counter-increment: s;
  position: relative;
  background: var(--lavender);
  border-radius: var(--radius);
  padding: 18px 22px 18px 64px;
}
html[dir="rtl"] .steps li { padding: 18px 64px 18px 22px; }
.steps li::before {
  content: counter(s);
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  background: var(--grad);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
}
.steps li b { color: var(--indigo); }
.notice {
  margin-top: 24px;
  border-inline-start: 4px solid var(--pink);
  background: #FCE9F2;
  border-radius: 12px;
  padding: 16px 20px;
  color: #6b2a4c;
  font-size: 15px;
}

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 14px; color: var(--indigo); }
.field input, .field textarea {
  font-family: var(--font);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(122, 79, 203, .15);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-msg { padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 16px; display: none; }
.form-msg.ok { display: block; background: #e4f6ec; color: #1f7a48; }
.form-msg.err { display: block; background: #fbe4e4; color: #b23030; }

.contact-aside { display: grid; gap: 14px; align-content: start; }
.contact-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--lavender);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.contact-item .ic { font-size: 22px; }
.contact-item b { display: block; color: var(--indigo); }
.contact-item a, .contact-item span { color: var(--muted); font-size: 15px; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer { background: var(--indigo); color: #cfc6e6; padding: 56px 0 26px; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
.site-footer .brand .brand-name { color: #fff; }
.site-footer .brand .brand-sub { color: #b9a9e6; }
.footer-about { margin: 16px 0 18px; font-size: 15px; max-width: 38ch; color: #b7adcf; }
.footer-col h4 { color: #fff; font-size: 16px; margin: 0 0 16px; }
.footer-col a { display: block; color: #cfc6e6; padding: 5px 0; font-size: 15px; }
.footer-col a:hover { color: var(--pink); }
.socials { display: flex; gap: 10px; margin-top: 6px; }
.socials a {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  display: grid; place-items: center;
}
.socials a:hover { background: var(--pink); }
.socials svg { width: 18px; height: 18px; fill: #fff; }
.socials a[hidden] { display: none; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: #a99fca;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .story-grid { grid-template-columns: 1fr; gap: 24px; }
  .story-art img { width: 150px; }
  .portals-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .nav {
    position: fixed;
    inset-block: 72px auto;
    inset-inline: 12px;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .menu-btn { display: block; }
}
@media (max-width: 520px) {
  .content-card { padding: 26px 20px; }
  .portals { padding: 28px 22px; }
}
