/* Concept: every listing is a door. Arched thresholds, a Majorelle-blue night hero with a saffron sun, key-tag price flags, masonry of arches. */
:root {
  --bg: #f2f5fa; --surface: #ffffff; --ink: #0c1530; --muted: #58627f; --line: #dde3ef;
  --blue: #1c3fd0; --blue-soft: #e6ebff; --sun: #ffb81c; --sun-ink: #1d1400; --coral: #e8502f; --ok: #0f7a58;
  --hero-a: #1a3ccc; --hero-b: #0a1773; --shadow: 0 24px 50px -28px rgba(12, 21, 48, .45);
  --display: "Reem Kufi", "Cairo", "Segoe UI", sans-serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090f21; --surface: #111a34; --ink: #eef1fb; --muted: #9aa6c6; --line: #202b4d;
    --blue: #7d97ff; --blue-soft: #18244d; --coral: #ff7a59; --ok: #3fd19c; --shadow: 0 24px 50px -28px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090f21; --surface: #111a34; --ink: #eef1fb; --muted: #9aa6c6; --line: #202b4d;
  --blue: #7d97ff; --blue-soft: #18244d; --coral: #ff7a59; --ok: #3fd19c; --shadow: 0 24px 50px -28px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.7; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.2; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }

/* demo notice */
.notice { background: var(--sun); color: var(--sun-ink); font-size: 14px; font-weight: 500; }
.notice .wrap { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-block: 6px; }
.notice button { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 2px 8px; }

/* header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.5rem; }
.brand svg { width: 30px; height: 36px; flex: none; }
.site-head nav { display: flex; gap: 22px; margin-inline-start: auto; font-weight: 500; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 600; text-decoration: none; background: var(--blue); color: #fff; }
:root[data-theme="dark"] .btn { color: #07102b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #07102b; } }
.btn.sun { background: var(--sun); color: var(--sun-ink) !important; }
.btn.ghost { background: transparent; color: var(--ink) !important; border: 1.5px solid var(--line); }
.btn.small { padding: 7px 14px; font-size: 14px; }
@media (max-width: 860px) { .site-head nav { display: none; } }

/* hero */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(170deg, var(--hero-a), var(--hero-b)); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='white' stroke-width='1.4'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E"); }
.orb { position: absolute; left: 50%; bottom: -22%; width: min(78vw, 640px); aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%); background: var(--sun); box-shadow: 0 0 0 28px rgba(255, 184, 28, .16), 0 0 0 64px rgba(255, 184, 28, .08); }
.hero .wrap { position: relative; padding-block: 56px 54px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--sun); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { font-size: clamp(3.4rem, 11vw, 8.2rem); font-weight: 700; margin-block: 10px 14px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--sun); }
.hero .lead { max-width: 34ch; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: rgba(255, 255, 255, .86); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.doors { border-bottom: 3px solid rgba(255, 255, 255, .28); display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 1.6vw, 20px); margin-top: 40px; padding-bottom: 0; }
.door { --k: 1; position: relative; flex: 1 1 0; max-width: 200px; height: calc(var(--k) * clamp(210px, 33vw, 400px)); border: 0; padding: 0; background: none; border-radius: 999px 999px 0 0; overflow: hidden; transition: transform .35s cubic-bezier(.2, .8, .2, 1); animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; box-shadow: 0 -6px 0 rgba(255, 255, 255, .15) inset; }
.door:nth-child(2) { animation-delay: .06s; } .door:nth-child(3) { animation-delay: .12s; } .door:nth-child(4) { animation-delay: .18s; } .door:nth-child(5) { animation-delay: .24s; } .door:nth-child(6) { animation-delay: .3s; }
.door:hover, .door:focus-visible { transform: translateY(-14px); }
.door svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.door .cap { position: absolute; inset: auto 0 0 0; padding: 36px 8px 14px; text-align: center; background: linear-gradient(transparent, rgba(8, 14, 50, .88)); font-family: var(--display); font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.2; }
.door .cap small { display: block; font-family: var(--body); font-size: .78rem; opacity: .8; margin-top: 2px; }
@keyframes rise { from { transform: translateY(70px); } to { transform: none; } }
@media (max-width: 700px) {
  .doors { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 2px; margin-inline: -16px; padding-left: 16px; padding-right: 16px; }
  .door { flex: 0 0 148px; scroll-snap-align: start; }
}

/* finder */
.finder { position: relative; z-index: 2; margin-top: -40px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; border: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
select, input[type=text], input[type=number], textarea { font: inherit; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.finder .btn { height: 46px; justify-content: center; }
@media (max-width: 960px) { .finder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .finder .btn { grid-column: 1 / -1; } }

/* sections */
section { padding-block: 72px 8px; }
.sec-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.sec-head .kicker { color: var(--blue); font-weight: 600; font-size: 14px; }
.sec-head h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-top: 4px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tools select { width: auto; padding-block: 8px; }
.pill { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { color: var(--muted); font-weight: 500; }

/* cards */
.grid { columns: 3 290px; column-gap: 22px; }
.card { break-inside: avoid; margin-bottom: 26px; position: relative; }
.card .open { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 0; }
.arch { position: relative; aspect-ratio: var(--ar, 4 / 5); border-radius: 999px 999px 18px 18px; overflow: hidden; background: var(--blue-soft); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; }
.arch svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .arch { transform: translateY(-6px); box-shadow: var(--shadow); }
.card:hover .arch svg { transform: scale(1.06); }
.price-tag { position: absolute; bottom: 18px; inset-inline-start: 0; background: var(--sun); color: var(--sun-ink); padding: 8px 18px 8px 28px; font-weight: 700; font-size: 1.05rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
.flag { position: absolute; bottom: 24px; inset-inline-end: 14px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.card .body { padding: 14px 6px 0; }
.card .meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.card h3 { font-size: 1.3rem; margin-top: 2px; }
.specs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.specs span { display: inline-flex; align-items: center; gap: 5px; }
.specs svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.heart { position: absolute; top: 44%; inset-inline-start: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); z-index: 3; }
.heart svg { width: 20px; height: 20px; stroke: #c9213f; fill: none; stroke-width: 2; }
.heart[aria-pressed="true"] svg { fill: #c9213f; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 20px; }

/* areas */
.areas { border-top: 1px solid var(--line); }
.area { display: flex; align-items: baseline; gap: 18px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; text-align: start; transition: padding .3s, color .3s; }
.area:hover { padding-inline-start: 22px; color: var(--blue); }
.area b { font-family: var(--display); font-size: clamp(1.8rem, 5.5vw, 3.6rem); font-weight: 600; line-height: 1.1; }
.area .types { margin-inline-start: auto; color: var(--muted); font-size: 14px; }
.area .n { min-width: 2.4em; text-align: center; background: var(--blue-soft); color: var(--blue); border-radius: 999px; font-weight: 700; padding: 2px 10px; }

/* finance */
.finance { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(18px, 4vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; box-shadow: var(--shadow); }
.finance h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.calc-inputs { display: grid; gap: 16px; }
.rng { display: grid; gap: 4px; }
.rng .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); font-weight: 600; }
.rng .row output { color: var(--ink); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.out { background: linear-gradient(170deg, var(--hero-a), var(--hero-b)); color: #fff; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; }
.out .big { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 700; color: var(--sun); line-height: 1.1; }
.bar { height: 14px; border-radius: 999px; overflow: hidden; display: flex; background: rgba(255, 255, 255, .2); }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.legend b { color: #fff; }
.fine { font-size: 13px; color: var(--muted); }
.out .fine { color: rgba(255, 255, 255, .7); }
@media (max-width: 820px) { .finance { grid-template-columns: minmax(0, 1fr); } }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; position: relative; }
.steps::before { content: ""; position: absolute; top: 28px; inset-inline: 8%; border-top: 2px dashed var(--line); }
.step { position: relative; text-align: center; padding-inline: 6px; }
.step .dot { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 999px 999px 8px 8px; background: var(--blue); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 1.4rem; font-weight: 700; position: relative; }
:root[data-theme="dark"] .step .dot { color: #07102b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step .dot { color: #07102b; } }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--muted); font-size: 14px; margin-top: 4px; }
@media (max-width: 760px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps::before { display: none; } }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; }
.contact .info { display: grid; gap: 16px; align-content: start; }
.contact .info h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.tel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tel .phone { font-family: var(--display); font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; user-select: all; color: var(--blue); }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .contact { grid-template-columns: minmax(0, 1fr); } .form .two { grid-template-columns: minmax(0, 1fr); } }
footer { margin-top: 80px; background: var(--ink); color: var(--bg); padding-block: 28px; font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* detail sheet */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(6, 10, 30, .7); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: max(16px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.sheet { position: relative; width: min(1000px, 100%); margin-block: auto; background: var(--surface); border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); animation: pop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); font-size: 22px; line-height: 1; }
.d-media { position: relative; min-height: 300px; background: var(--blue-soft); }
.d-media .arch { height: calc(100% - 32px); margin: 32px 24px 0; aspect-ratio: auto; min-height: 420px; border-radius: 999px 999px 0 0; }
.d-media .arch svg { transition: none; }
.d-body { padding: 28px 28px 24px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.d-body h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); padding-inline-end: 40px; }
.d-price { font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--blue); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fact { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.fact small { display: block; color: var(--muted); font-size: 12px; }
.fact b { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 14px; }
.d-body details { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; }
.d-body summary { cursor: pointer; font-weight: 700; }
.d-body details .calc-inputs { margin-top: 12px; }
.d-body details .out { margin-top: 14px; padding: 16px; }
.d-body details .out .big { font-size: 2rem; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 800px) { .sheet { grid-template-columns: minmax(0, 1fr); } .d-media .arch { min-height: 300px; height: 340px; } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-weight: 600; z-index: 100; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

html[lang="fr"], html[lang="es"], html[lang="en"] { --display: "Bricolage Grotesque", "Segoe UI", sans-serif; --body: "IBM Plex Sans", "Segoe UI", sans-serif; }
html:not([lang="ar"]) .eyebrow, html:not([lang="ar"]) .sec-head .kicker { letter-spacing: .06em; text-transform: uppercase; }
html:not([lang="ar"]) .hero h1 { font-size: clamp(2.7rem, 7.6vw, 6.2rem); letter-spacing: -.02em; max-width: 11ch; line-height: 1.02; }
html:not([lang="ar"]) .hero .lead { max-width: 44ch; }
html:not([lang="ar"]) .area b { letter-spacing: -.01em; }
[dir="ltr"] .price-tag { padding: 8px 28px 8px 18px; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%); }
.brand span { direction: ltr; }
.lang { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.site-head .lang { margin-inline-start: 0; }
@media (max-width: 860px) { .site-head .lang { margin-inline-start: auto; } .site-head .btn { margin-inline-start: 0; } }
@media (max-width: 560px) { .site-head .wrap { gap: 6px; } .brand { font-size: .95rem; white-space: nowrap; gap: 6px; } .lang { padding: 2px; } .lang button { padding: 4px 6px; font-size: 12px; } .site-head .btn { display: none; } }
.ph { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .arch .ph { transform: scale(1.06); }
.d-media .ph { transition: none; }
.logo-mark { height: 40px; width: auto; background: #fff; border-radius: 10px; padding: 3px 7px; display: block; flex: none; }
.logo-full { background: #fff; border-radius: 14px; padding: 8px; display: block; height: auto; }
.card-logo { width: 150px; border: 1px solid var(--line); }
.foot-brand { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.foot-brand .logo-full { width: 96px; }
@media (max-width: 560px) { .logo-mark { height: 30px; padding: 2px 5px; border-radius: 8px; } }
.thumbs { display: flex; gap: 8px; padding: 10px 0 0; overflow-x: auto; }
.thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Photos des biens : cadre carré aux coins légèrement arrondis (les portes de catégories gardent la forme d'arc) */
.arch, .card .arch { aspect-ratio: 1 / 1; border-radius: 16px; }
.d-media .arch { aspect-ratio: 1 / 1; height: auto; min-height: 0; margin: 24px; border-radius: 16px; }
@media (max-width: 800px) { .d-media .arch { height: auto; min-height: 0; margin: 20px 16px 0; } }
.door img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.staff-link { color: var(--sun-ink); background: var(--sun); border-radius: 999px; padding: 4px 16px; font-weight: 700; text-decoration: none; }
.staff-top { display: none; border: 1.5px solid var(--line); color: var(--ink); border-radius: 999px; padding: 5px 14px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (min-width: 1180px) { .staff-top { display: inline-block; } }
