:root {
  --navy: #071528;
  --gold: #d4af37;
  --gold2: #f0d78c;
  --cream: #f7f1e3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--cream);
  background: #071528;
  display: flex;
  flex-direction: column;
}
#fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(212,175,55,.18), transparent 55%),
    linear-gradient(180deg, transparent 40%, rgba(7,21,40,.75) 100%);
}
.top, main, .panel, .floor { position: relative; z-index: 2; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 3.5vw;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(212,175,55,.18);
}
.brand { display: flex; gap: 10px; align-items: center; }
.logo { width: 36px; height: 36px; object-fit: contain; }
.brand strong { display: block; font-family: "Playfair Display", serif; font-size: 1.05rem; }
.brand em { font-style: normal; font-size: .75rem; color: var(--gold2); }
.tag { font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.lang-switch { display: flex; gap: 4px; margin-inline-start: 10px; }
.lang-btn {
  border: 1px solid rgba(212,175,55,.4); background: transparent; color: var(--cream);
  border-radius: 999px; padding: .2rem .55rem; cursor: pointer; font: inherit; font-size: .72rem;
}
.lang-btn.on { background: #c9a227; color: #071528; font-weight: 700; }
.top-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
body.rtl { font-family: Cairo, "Source Sans 3", sans-serif; }
body.rtl .hero { direction: rtl; }
body.rtl .grande { direction: rtl; }
@font-face {
  font-family: "Noto Sans Tifinagh";
  src: url("NotoSansTifinagh-Regular.ttf") format("truetype");
  font-display: swap;
}
main { flex: 1; min-height: 0; display: flex; }
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  padding: 0.5rem 3.5vw 0.3rem;
  width: 100%;
  min-height: 0;
  align-items: stretch;
}
.hero-copy { min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.kicker { letter-spacing: .28em; text-transform: uppercase; font-size: .62rem; color: var(--gold); }
h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  line-height: 1.08; margin: .2rem 0 .35rem; font-weight: 600;
}
h1 span {
  background: linear-gradient(90deg, var(--gold), var(--gold2), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { opacity: .88; font-size: 0.86rem; line-height: 1.35; }
.stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin-top: 0.5rem; }
.stats div { min-width: 5.5rem; padding-bottom: .15rem; border-bottom: 1px solid rgba(212,175,55,.25); }
.stats b { display: block; font-family: "Playfair Display", serif; font-size: 1.15rem; color: var(--gold); }
.stats span { font-size: .62rem; opacity: .65; text-transform: uppercase; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0.55rem 0 0; }
.door {
  text-align: left; cursor: pointer; color: inherit;
  border: 1px solid rgba(212,175,55,.28);
  background: linear-gradient(165deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border-radius: 14px; padding: 0.65rem 0.75rem;
}
.door:hover { border-color: var(--gold); }
.door-ar { display: block; color: var(--gold); margin-bottom: .2rem; font-size: .9rem; }
.door strong { display: block; font-family: "Playfair Display", serif; font-size: 1.02rem; }
.door em { display: block; margin-top: .15rem; font-style: normal; opacity: .68; font-size: .75rem; }
.grande {
  background: #fff;
  color: #1b365d;
  border-radius: 16px;
  padding: 0.45rem 0.65rem;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.armes { height: 40px; width: auto; object-fit: contain; }
.mamlaka { display: block; height: 20px; width: auto; max-width: 90%; margin: 0.15rem auto 0; object-fit: contain; }
.royaume, .tifinagh { margin-top: 0.08rem; font-size: 0.8rem; font-weight: 600; color: #1a4a7a; }
.tifinagh { font-family: "Noto Sans Tifinagh", sans-serif; font-weight: 400; }
.grande-logo { display: block; width: min(26vh, 150px); height: auto; margin: 0.2rem auto 0; }
.promo-banner { margin: 0.25rem 0 0; padding: 0.3rem 0.45rem; border-radius: 10px; background: #1b365d; color: #fff; font-size: 0.65rem; line-height: 1.25; }
.promo-banner strong { display: block; color: #c9a227; font-size: 0.8rem; }
.manassa { margin-top: 0.2rem; font-size: 1.1rem; font-weight: 700; color: #c9a227; font-family: Cairo, "Playfair Display", serif; }
.smart-ar { margin-top: 0.08rem; font-size: 0.78rem; font-weight: 600; color: #1b365d; font-family: Cairo, serif; }
.smart-fr, .conforme { font-size: 0.66rem; color: #1b365d; }
.copy-block { margin-top: 0.2rem; display: flex; flex-direction: column; align-items: center; gap: 0.05rem; }
.cat-logo { width: 20px; height: 20px; border-radius: 4px; }
.copy, .tel-link { font-size: 0.6rem; font-weight: 600; color: inherit; text-decoration: none; }
.floor { flex-shrink: 0; padding: 0.2rem 3.5vw; font-size: 0.65rem; opacity: 0.5; text-align: center; }
.reveal { animation: up .7s cubic-bezier(.2,.7,.2,1) both; }
.delay1 { animation-delay: .08s; } .delay2 { animation-delay: .16s; }
.delay3 { animation-delay: .24s; } .delay4 { animation-delay: .32s; } .delay5 { animation-delay: .4s; }
@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel {
  position: fixed; z-index: 20; top: 0; right: 0; height: 100%;
  width: min(460px, 100%);
  background: linear-gradient(180deg, #0d2748 0%, #071528 100%);
  padding: 1.2rem 1.25rem 2rem;
  border-left: 1px solid rgba(212,175,55,.25);
  overflow: auto;
}
.panel-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: start; margin-bottom: 1.1rem; }
.panel-logo { width: 48px; height: 48px; object-fit: contain; }
.panel h2 { font-family: "Playfair Display", serif; font-size: 1.35rem; }
.hint { font-size: .82rem; opacity: .75; margin-top: .2rem; }
.close { background: none; border: 0; color: var(--cream); font-size: 1.15rem; cursor: pointer; }
.search, .reg { display: grid; gap: .65rem; }
input, .search button, .reg > button[type="submit"] {
  font: inherit; border-radius: 12px; padding: .78rem .95rem;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: var(--cream);
}
.search { grid-template-columns: 1fr auto; margin-bottom: 1rem; }
.search button, .reg > button[type="submit"] {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #071528; border: 0; font-weight: 600; cursor: pointer;
}
.hits { display: grid; gap: .5rem; }
.hit {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border-radius: 12px; padding: .75rem .85rem;
  border: 1px solid rgba(212,175,55,.22);
  background: rgba(255,255,255,.04); color: inherit;
}
.hit b { display: block; }
.hit small { opacity: .7; display: block; }
.or { margin: 1rem 0; }
.or button { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; font: inherit; }
.mob span { display: block; font-size: .78rem; margin-bottom: .3rem; opacity: .8; }
.tel { display: flex; }
.tel em {
  font-style: normal; display: flex; align-items: center;
  padding: 0 .75rem; border: 1px solid rgba(255,255,255,.14); border-right: 0;
  border-radius: 12px 0 0 12px; background: rgba(212,175,55,.12); color: var(--gold);
}
.tel input { border-radius: 0 12px 12px 0; flex: 1; }
.tiny { font-size: .75rem; opacity: .65; }
.err { color: #ffb4b4; font-size: .85rem; }
input::placeholder { color: rgba(247,241,227,.4); }
#aide-btn {
  position: fixed; z-index: 40; right: 1rem; bottom: 1rem;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #f0d78c, #c9a227); color: #071528; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
#aide-box {
  position: fixed; z-index: 41; right: 1rem; bottom: 4.2rem;
  width: min(340px, calc(100vw - 2rem)); height: min(380px, 55vh);
  background: #0d2748; border: 1px solid rgba(212,175,55,.35); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
#aide-box[hidden] { display: none !important; }
#aide-box header { padding: .55rem .75rem; font-size: .78rem; color: #c9a227; border-bottom: 1px solid rgba(255,255,255,.1); }
#aide-box .log { flex: 1; overflow: auto; padding: .6rem .75rem; font-size: .8rem; }
#aide-box .log .me { text-align: right; color: #f0d78c; margin: .35rem 0; }
#aide-box .log .bot { color: #f7f1e3; margin: .35rem 0; opacity: .95; }
#aide-box form { display: grid; grid-template-columns: 1fr auto; gap: .35rem; padding: .5rem; }
#aide-box input { border-radius: 10px; padding: .45rem .55rem; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; font: inherit; }
#aide-box form button { border: 0; border-radius: 10px; padding: .45rem .7rem; background: #c9a227; color: #071528; font-weight: 700; cursor: pointer; }
@media (max-width: 900px) {
  html, body { overflow: auto; height: auto; max-height: none; }
  .hero { grid-template-columns: 1fr; }
}
