/* Charte Tittawin : terre cuite des ksour de Tataouine, bleu de la source. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.ttf") format("truetype"); }

:root {
  --primary: #c2410c;
  --primary-strong: #9a3412;
  --primary-soft: #fff7ed;
  --accent: #0284c7;
  --accent-soft: #f0f9ff;
  --bg: #fdfaf6;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --on-primary: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 16px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #fb923c;
    --primary-strong: #fdba74;
    --primary-soft: #431407;
    --accent: #38bdf8;
    --accent-soft: #082f49;
    --bg: #140c08;
    --surface: #1f140e;
    --border: #3b2a20;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --on-primary: #140c08;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }
a:hover { color: var(--primary-strong); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

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

/* En-tête */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand svg { width: 32px; height: 32px; flex: none; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; top: 64px; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.site-nav ul { list-style: none; margin: 0; padding: 8px 16px 16px; }
.site-nav a { display: block; padding: 12px 8px; color: var(--text); text-decoration: none; font-weight: 600; border-radius: 8px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; background: none; border: 0; box-shadow: none; }
  .site-nav ul { display: flex; gap: 4px; padding: 0; }
  .site-nav a { padding: 8px 14px; font-size: .95rem; }
}

/* Boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); color: var(--on-primary); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */

section { padding: 64px 0; }
@media (min-width: 720px) { section { padding: 96px 0; } }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }

.hero { padding: 72px 0 64px; }
@media (min-width: 720px) { .hero { padding: 112px 0 96px; } }
.hero h1 { max-width: 820px; }
.hero .lead { max-width: 640px; margin-bottom: 32px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.2fr 1fr; } }

.hero-visual {
  border-radius: 24px; padding: 32px; aspect-ratio: 4 / 3;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.hero-visual svg { width: 100%; height: 100%; }

/* Cartes */

.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }

.product-card { display: flex; flex-direction: column; gap: 16px; }
.product-card .product-top { display: flex; align-items: center; gap: 16px; }
.product-card .product-icon { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.product-card .actions { margin-top: auto; padding-top: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--primary-soft); color: var(--primary);
}
.badge-soon { background: var(--accent-soft); color: var(--accent); }

.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 16px;
}
.icon-tile svg { width: 22px; height: 22px; }

.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2410c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.steps { counter-reset: step; }
.steps .card { position: relative; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 16px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700;
}

.cta {
  border-radius: 24px; padding: 40px 28px; text-align: center;
  background: var(--primary); color: var(--on-primary);
}
.cta h2 { color: inherit; }
.cta p { opacity: .9; max-width: 560px; margin: 0 auto 24px; }
.cta .btn-primary { background: var(--on-primary); color: var(--primary); }
.cta .btn-primary:hover { opacity: .92; }
.cta .actions { justify-content: center; }

/* Formulaires */

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--muted); }
.form .consent input { width: auto; margin-top: 4px; }
.hidden { display: none; }

/* Texte long (mentions légales) */

.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }

/* Pied de page */

.site-footer { border-top: 1px solid var(--border); padding: 48px 0 32px; font-size: .95rem; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* Sélecteur de langue (en-tête, aussi dans le menu mobile) */

.site-nav .lang-item { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.site-nav a.lang-switch {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .9rem; line-height: 1.2;
}
.site-nav a.lang-switch:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.site-nav a.lang-switch:lang(ar) { font-family: "Cairo", "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; }
@media (min-width: 820px) {
  .site-nav ul { align-items: center; }
  .site-nav .lang-item { margin: 0 0 0 8px; padding: 0; border: 0; }
  .site-nav a.lang-switch { min-height: 36px; padding: 4px 14px; }
}

/* Version arabe (de droite à gauche) */

[lang="ar"] body, body:lang(ar) {
  font-family: "Cairo", "Noto Kufi Arabic", "Noto Sans Arabic", "Inter", system-ui, Tahoma, sans-serif;
  line-height: 1.8;
}
/* L'espacement des lettres casse les liaisons de l'écriture arabe. */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] .eyebrow, [lang="ar"] .site-footer h3 { letter-spacing: 0; text-transform: none; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { line-height: 1.4; }
[lang="ar"] .eyebrow { font-size: .9rem; }

[dir="rtl"] body { text-align: right; }
[dir="rtl"] .skip-link { left: auto; right: -9999px; }
[dir="rtl"] .skip-link:focus { right: 16px; left: auto; }

@media (min-width: 820px) {
  [dir="rtl"] .site-nav .lang-item { margin: 0 8px 0 0; }
}

[dir="rtl"] .check-list li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .check-list li::before { left: auto; right: 0; }

[dir="rtl"] .form input[type="email"],
[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .form input[type="email"] { text-align: right; }

[dir="rtl"] .hero-grid > *, [dir="rtl"] .grid > * { min-width: 0; }
[dir="rtl"] .cta { text-align: center; }
