/* ============================================================
   Guide Maroc Télécom — feuille de style principale
   Palette : bleu institutionnel, sable/marine, orange accent.
   Aucune police distante, aucun framework : chargement rapide.
   ============================================================ */

:root {
  --blue: #0b4ea2;
  --blue-deep: #082f63;
  --blue-soft: #e8f0fb;
  --accent: #e8842c;
  --accent-dark: #c96b18;
  --ink: #16233c;
  --muted: #52627e;
  --bg: #f6f8fc;
  --card: #ffffff;
  --border: #dde5f0;
  --ok: #177245;
  --warn-bg: #fff7ec;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(9, 43, 89, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-text-size-adjust: 100%;
}

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

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: #fff; padding: .6rem 1rem; z-index: 99;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- En-tête ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 68px;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--blue-deep);
  font-size: 1.12rem; letter-spacing: -.01em;
}
.brand-text b { color: var(--blue); font-weight: 700; }
.brand-mark { display: grid; place-items: center; }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: .45rem .6rem; color: var(--blue-deep); cursor: pointer;
}

.main-nav { margin-left: auto; }
.main-nav ul {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  display: inline-block;
  padding: .55rem .8rem;
  color: var(--ink); text-decoration: none;
  border-radius: 9px; font-weight: 500; font-size: .98rem;
}
.main-nav a:hover { background: var(--blue-soft); color: var(--blue-deep); }
.main-nav li[aria-current] > a,
.main-nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }

.has-sub { position: relative; }
.sub-toggle svg { margin-left: .25rem; opacity: .6; }
.submenu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 260px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: .4rem;
  display: none; flex-direction: column; z-index: 40;
}
.has-sub:hover .submenu,
.has-sub:focus-within .submenu,
.has-sub.sub-open .submenu { display: flex; }
.submenu a { display: block; padding: .5rem .7rem; border-radius: 8px; font-size: .95rem; }

/* ---------- Fil d'Ariane ---------- */

.breadcrumbs { padding-top: 1.1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: #b4c0d4; }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- Typographie / prose ---------- */

.prose { max-width: 780px; }
.prose h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.2; margin: .2rem 0 .8rem; letter-spacing: -.02em; }
.prose h2 { font-size: 1.45rem; margin: 2.2rem 0 .7rem; letter-spacing: -.01em; color: var(--blue-deep); }
.prose h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; color: var(--ink); }
.prose p { margin: .7rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: .7rem 0; }
.prose li { margin: .3rem 0; }
.prose a { color: var(--blue); }
.prose .lead { font-size: 1.13rem; color: #33445f; }
.updated { color: var(--muted); font-size: .9rem; margin-bottom: 1.6rem; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-block; padding: .72rem 1.35rem;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; text-decoration: none;
  cursor: pointer; transition: transform .06s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(11, 78, 162, .25); }
.btn-primary:hover { background: #0d57ba; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--blue-deep); border-color: var(--border); }
.btn-ghost:hover { background: var(--blue-soft); }

/* ---------- Sections génériques ---------- */

.section { padding: 2.6rem 0; }
.section-tight { padding: 1.4rem 0; }

.grid { display: grid; gap: 1.1rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin: .2rem 0 .5rem; font-size: 1.12rem; color: var(--blue-deep); }
.card p { margin: .4rem 0; color: var(--muted); font-size: .97rem; }
.card a.more { display: inline-block; margin-top: .5rem; font-weight: 600; color: var(--blue); text-decoration: none; }
.card a.more:hover { text-decoration: underline; }

.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blue-soft); display: grid; place-items: center;
  margin-bottom: .8rem; color: var(--blue);
}

.callout {
  background: var(--warn-bg); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: .97rem;
}
.callout-blue { background: var(--blue-soft); border-left-color: var(--blue); }

.badge {
  display: inline-block; font-size: .76rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--blue-soft); color: var(--blue-deep);
  border-radius: 999px; padding: .28rem .7rem; margin-bottom: .6rem;
}

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.8rem 0; }
.fact {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.fact b { display: block; font-size: 1.5rem; color: var(--blue); letter-spacing: -.02em; }
.fact span { color: var(--muted); font-size: .9rem; }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(232, 132, 44, .28), transparent 60%),
    linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 62%, #1467bf 100%);
  color: #fff;
  padding: 3.4rem 0 3.8rem;
}
.hero .container {
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 2rem; align-items: center;
}
.hero-kicker {
  display: inline-block; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; letter-spacing: .05em;
  margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.18; margin: 0 0 1rem; letter-spacing: -.02em; }
.hero p { font-size: 1.08rem; color: #dbe7f7; margin: 0 0 1.6rem; max-width: 560px; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-art { display: grid; place-items: center; }
.hero-disclaimer { font-size: .85rem; color: #b9cbe6; margin-top: 1.4rem; }

/* ---------- Tableaux ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
table.data { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data thead th { background: #f2f6fc; color: var(--blue-deep); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data caption { caption-side: top; text-align: left; padding: .9rem 1rem .2rem; font-weight: 700; color: var(--blue-deep); }

/* ---------- Accordéons FAQ ---------- */

details.faq {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.2rem; margin: .7rem 0; box-shadow: var(--shadow);
}
details.faq summary {
  cursor: pointer; font-weight: 600; color: var(--blue-deep);
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; font-weight: 700; color: var(--accent); font-size: 1.2rem; line-height: 1;
}
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { margin-top: .6rem; color: #38496a; }

/* ---------- Étapes numérotées ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1rem 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 1.2rem 3.1rem; margin: 0;
  border-left: 2px dashed var(--border); margin-left: 1.1rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: .2rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: -1.25rem; top: -.15rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: .95rem;
}

/* ---------- Formulaires ---------- */

.form-card { max-width: 660px; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%; padding: .7rem .85rem;
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(11, 78, 162, .35); border-color: var(--blue);
}
.honey { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.consent { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.consent input { margin-top: .3rem; }
.flash { border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-size: .97rem; }
.flash-ok { background: #e9f7ee; border: 1px solid #bfe5cc; color: var(--ok); }
.flash-err { background: #fdf0ee; border: 1px solid #f2cbc3; color: #a3402a; }

/* ---------- Pied de page ---------- */

.site-footer {
  background: var(--blue-deep); color: #cddcf0;
  margin-top: 3rem; padding: 2.6rem 0 1.2rem; font-size: .93rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.footer-brand { color: #fff; font-size: 1.15rem; margin: 0 0 .5rem; }
.footer-brand b { color: #9cc3f5; }
.footer-title { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .8rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: .35rem 0; }
.footer-col a { color: #cddcf0; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-contact a { color: #ffd9ae; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2rem; padding-top: 1.1rem; }
.footer-bottom p { margin: 0; color: #9db4d4; font-size: .85rem; }

/* ---------- Bandeau cookies ---------- */

.cookie-bar {
  position: fixed; inset: auto 1rem 1rem 1rem; z-index: 60;
  max-width: 720px; margin-inline: auto;
  background: #fff; color: var(--ink);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(9, 43, 89, .22);
  padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  font-size: .93rem;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { flex: 1 1 320px; margin: 0; }
.cookie-actions { display: flex; gap: .6rem; }

/* ---------- Accessibilité / divers ---------- */

:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; border-radius: 4px; }

@media (max-width: 960px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: .8rem 4%;
  }
  .site-header.nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a { padding: .8rem .6rem; display: flex; justify-content: space-between; }
  .submenu {
    position: static; display: none; box-shadow: none; border: none;
    padding-left: 1rem; background: var(--blue-soft); border-radius: 10px;
  }
  .has-sub.sub-open .submenu { display: block; }
}

@media (max-width: 620px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  .hero { padding: 2.4rem 0 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
