/* ==========================================================================
   OPALS Maroc — Feuille de style
   Agence Mediacal
   ========================================================================== */

:root{
  --blue: #0072CE;
  --blue-2: #0284C7;
  --blue-dark: #045386;
  --red: #E52320;
  --red-2: #DC2626;
  --soft: #DCEEFB;
  --soft-2: #F0F7FF;
  --ink: #0B2239;
  --ink-soft: #4A5C70;
  --gray-border: #E3EBF2;
  --white: #FFFFFF;

  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;

  --shadow-sm: 0 2px 10px rgba(11,34,57,.06);
  --shadow-md: 0 12px 30px rgba(11,34,57,.10);
  --shadow-lg: 0 24px 60px rgba(11,34,57,.14);

  --header-h: 84px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body{
  margin:0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5{
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5em;
}
p{ margin: 0 0 1em; color: var(--ink-soft); line-height: 1.7; }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
ul{ list-style: none; margin:0; padding:0; }
button{ font-family: inherit; cursor: pointer; }
input, select, textarea{ font-family: inherit; font-size: 1rem; }

.container{
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}
.icon{ width: 1.2em; height: 1.2em; fill: currentColor; flex-shrink:0; }

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

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 26px;
  border-radius: 100px;
  font-weight: 600;
  font-size: .96rem;
  border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0); }
.btn-lg{ padding: 16px 32px; font-size: 1.02rem; }
.btn-block{ width:100%; }

.btn-primary{ background: linear-gradient(135deg, var(--blue), var(--blue-2)); color:#fff; box-shadow: 0 10px 24px rgba(0,114,206,.28); }
.btn-primary:hover{ box-shadow: 0 14px 30px rgba(0,114,206,.38); }

.btn-urgent{ background: linear-gradient(135deg, var(--red), var(--red-2)); color:#fff; box-shadow: 0 10px 24px rgba(229,35,32,.3); font-size:.88rem; padding: 11px 20px; }
.btn-urgent:hover{ box-shadow: 0 14px 30px rgba(229,35,32,.4); }

.btn-outline{ border-color: var(--blue); color: var(--blue); background: #fff; }
.btn-outline:hover{ background: var(--soft-2); }

.btn-ghost{ background: rgba(255,255,255,.14); color:#fff; border-color: rgba(255,255,255,.5); backdrop-filter: blur(6px); }
.btn-ghost:hover{ background: rgba(255,255,255,.24); }

.btn-call{ font-size:.88rem; padding: 11px 18px; }

/* ---------- Header ---------- */
.site-header{
  position: fixed; top:0; left:0; right:0; z-index: 500;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.scrolled{
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  height: var(--header-h);
  gap: 20px;
}
.brand{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.brand-logo{ height: 46px; width:auto; }
.brand-text{ display:flex; flex-direction:column; font-family: var(--font-head); font-size:1.05rem; line-height:1.15; color: var(--blue-dark); }
.brand-text strong{ color: var(--blue); }
.brand-text small{ font-family: var(--font-body); font-weight:500; font-size:.66rem; color: var(--ink-soft); letter-spacing:.02em; }

.main-nav ul{ display:flex; gap: 30px; }
.nav-link{
  font-weight: 600; font-size: .96rem; color: var(--ink); position:relative; padding: 6px 0;
}
.nav-link::after{
  content:""; position:absolute; left:0; bottom:0; width:0; height:2px;
  background: var(--blue); transition: width .2s ease;
}
.nav-link:hover::after, .nav-link.active::after{ width:100%; }
.nav-link:hover{ color: var(--blue); }

.header-actions{ display:flex; align-items:center; gap:12px; flex-shrink:0; }

.hamburger{
  display:none; flex-direction:column; justify-content:center; gap:5px;
  width:44px; height:44px; border:none; background:transparent; border-radius: 10px;
}
.hamburger span{ width:24px; height:2px; background: var(--ink); margin:0 auto; transition: transform .25s ease, opacity .25s ease; }
.hamburger[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.hamburger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-backdrop{
  position: fixed; inset:0; background: rgba(11,34,57,.4); z-index: 460;
  opacity:0; pointer-events:none; transition: opacity .25s ease;
}
.mobile-nav-backdrop.active{ opacity:1; pointer-events:auto; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding: calc(var(--header-h) + 70px) 0 90px;
  overflow: hidden;
  background: linear-gradient(160deg, #063E6B 0%, var(--blue) 46%, var(--blue-2) 100%);
  isolation: isolate;
}
.hero-decor{
  position:absolute; inset:0; z-index:-1;
  background-image:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.14), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.10), transparent 40%);
}
.hero-decor::after{
  content:""; position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.18) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  opacity:.35;
}
.hero-inner{
  display:grid; grid-template-columns: 1.15fr .85fr; align-items:center; gap: 50px;
}
.eyebrow{
  display:inline-block; color:#D9ECFF; font-weight:600; font-size:.82rem;
  background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25);
  padding:7px 16px; border-radius:100px; margin-bottom:20px;
}
.hero h1{
  color:#fff; font-size: clamp(2.1rem, 4.2vw, 3.4rem); font-weight:700; letter-spacing:-.01em; margin-bottom:18px;
}
.hero-subtitle{ color: #DCEEFB; font-size: 1.12rem; max-width: 560px; margin-bottom:32px; }
.hero-ctas{ display:flex; flex-wrap:wrap; gap:16px; margin-bottom: 44px; }

.trust-badges{ display:flex; flex-wrap:wrap; gap: 28px; }
.trust-badges li{ display:flex; flex-direction:column; color:#fff; }
.trust-badges strong{ font-family: var(--font-head); font-size:1.3rem; }
.trust-badges span{ font-size:.8rem; color:#CFE6FA; }

.hero-visual{ position:relative; height: 420px; display:none; }
.hero-orb{ position:absolute; border-radius:50%; filter: blur(2px); }
.hero-orb-1{ width:280px; height:280px; background: rgba(255,255,255,.08); top:0; right:20px; }
.hero-orb-2{ width:180px; height:180px; background: rgba(220,238,251,.16); bottom:20px; left:0; }
.hero-card{
  position:absolute; background: rgba(255,255,255,.95); color: var(--ink);
  border-radius: var(--radius-md); padding:18px 20px; box-shadow: var(--shadow-lg);
  display:flex; align-items:center; gap:12px; font-weight:600; font-size:.9rem; max-width:230px;
  animation: float 5s ease-in-out infinite;
}
.hero-card .icon{ color: var(--blue); width:1.6em; height:1.6em; }
.hero-card-1{ top: 30px; left: 10px; animation-delay: 0s; }
.hero-card-2{ bottom: 30px; right: 0; animation-delay: 1.2s; }
@keyframes float{ 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-14px);} }

.scroll-cue{
  position:absolute; left:50%; bottom: 22px; transform: translateX(-50%);
  color: rgba(255,255,255,.8); animation: bounce 2s infinite;
}
@keyframes bounce{ 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,8px);} }

/* ---------- Sections generic ---------- */
.section{ padding: 96px 0; }
.section-soft{ background: var(--soft-2); }
.section-head{ max-width: 720px; margin: 0 auto 56px; text-align:center; }
.tag{
  display:inline-block; color: var(--blue); font-weight:700; font-size:.8rem;
  letter-spacing:.06em; text-transform:uppercase; background: var(--soft);
  padding: 6px 16px; border-radius:100px; margin-bottom:16px;
}
.tag-light{ background: var(--soft-2); }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom:14px; }
.lead{ font-size:1.08rem; }

.muted{ color: var(--ink-soft); font-size:.95rem; }
.muted-small{ display:block; color: var(--ink-soft); font-size:.8rem; margin-top:2px; }

.check-list li{
  position: relative; padding-left: 32px; margin-bottom:12px; color: var(--ink); font-weight:500;
}
.check-list li::before{
  content:""; position:absolute; left:0; top:2px; width:20px; height:20px; border-radius:50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/12px no-repeat;
}
.check-list-alt li::before{ background-color: var(--red); }

/* ---------- About ---------- */
.about-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items:center; margin-bottom: 90px;
}
.about-text h3{ font-size:1.4rem; margin-bottom:14px; }
.about-gallery{
  display:grid; grid-template-columns: 1fr 1fr; gap:16px;
}
.about-gallery img{
  width:100%; height: 160px; object-fit: cover; border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease;
}
.about-gallery img:hover{ transform: translateY(-6px); box-shadow: var(--shadow-md); }
.about-gallery img:nth-child(1){ border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 6px; }

/* ---------- Timeline ---------- */
.timeline-title{ text-align:center; font-size:1.5rem; margin-bottom: 40px; }
.timeline-track{
  display:flex; justify-content:space-between; align-items:center; position:relative;
  max-width: 760px; margin: 0 auto 40px; padding: 0 10px;
}
.timeline-track::before{
  content:""; position:absolute; left:6%; right:6%; top:9px; height:3px; background: var(--gray-border); z-index:0;
}
.timeline-point{
  position:relative; z-index:1; background:none; border:none; display:flex; flex-direction:column; align-items:center; gap:10px;
  color: var(--ink-soft); font-weight:700;
}
.timeline-point .dot{
  width:20px; height:20px; border-radius:50%; background:#fff; border:3px solid var(--gray-border); transition: all .25s ease;
}
.timeline-point.active .dot{ background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 6px var(--soft); }
.timeline-point.active{ color: var(--blue); }
.timeline-point:hover .dot{ border-color: var(--blue-2); }

.timeline-panels{ position:relative; max-width: 640px; margin: 0 auto; text-align:center; }
.timeline-panel{
  display:none; background: var(--soft-2); border: 1px solid var(--gray-border);
  border-radius: var(--radius-md); padding: 30px 36px; animation: fadeUp .35s ease;
}
.timeline-panel.active{ display:block; }
.timeline-panel h4{ color: var(--blue-dark); font-size:1.15rem; }
@keyframes fadeUp{ from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform: translateY(0);} }

/* ---------- Services ---------- */
.services-grid{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 70px;
}
.service-card{
  background:#fff; border: 1px solid var(--gray-border); border-radius: var(--radius-lg);
  padding: 34px 26px; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover{ transform: translateY(-8px); box-shadow: var(--shadow-md); }
.service-icon{
  width:56px; height:56px; border-radius: 16px; margin-bottom:20px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  display:flex; align-items:center; justify-content:center;
}
.service-icon svg{ width:28px; height:28px; fill:#fff; }
.service-card h3{ font-size:1.12rem; margin-bottom:10px; }
.service-card p{ font-size:.94rem; margin:0; }

.prevention-panel{
  display:grid; grid-template-columns: 1fr .8fr; gap: 50px; align-items:center;
  background:#fff; border-radius: var(--radius-lg); padding: 46px; box-shadow: var(--shadow-md);
}
.prevention-text h3{ font-size:1.5rem; margin-bottom:18px; }
.prevention-image{ border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

/* ---------- Reseau ---------- */
.network-grid{
  display:grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items:center;
}
.network-image{ border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.network-cities{ display:flex; flex-wrap:wrap; gap:14px; }
.city-chip{
  background: var(--soft); color: var(--blue-dark); font-weight:700; font-size:.92rem;
  padding: 12px 22px; border-radius: 100px; box-shadow: var(--shadow-sm);
}
.city-chip-main{ background: linear-gradient(135deg, var(--blue), var(--blue-2)); color:#fff; }

/* ---------- Forms ---------- */
.rdv-wrapper{ max-width: 780px; margin: 0 auto; position:relative; }
.card-form{
  background:#fff; border: 1px solid var(--gray-border); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-md);
}
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap:20px; }
.form-field{ margin-bottom: 20px; }
.form-field label{ display:block; font-weight:600; font-size:.9rem; margin-bottom:8px; }
.form-field input, .form-field select, .form-field textarea{
  width:100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-border);
  background: var(--soft-2); transition: border-color .2s ease, background .2s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus{
  outline:none; border-color: var(--blue); background:#fff;
}
.form-field textarea{ resize: vertical; }
.field-error{ display:none; color: var(--red-2); font-size:.8rem; margin-top:6px; font-weight:600; }
.form-field.invalid input, .form-field.invalid select, .form-field.invalid textarea{ border-color: var(--red-2); }
.form-field.invalid .field-error{ display:block; }

.checkbox-field{
  display:flex; align-items:flex-start; gap:10px; font-size:.86rem; color: var(--ink-soft);
  margin-bottom: 8px; cursor:pointer;
}
.checkbox-field input{ margin-top:3px; width:18px; height:18px; accent-color: var(--blue); flex-shrink:0; }
.field-error-checkbox{ margin-bottom:20px; margin-top:-4px; }
.checkbox-field.invalid + .field-error-checkbox{ display:block; }

.rdv-success{
  background:#fff; border-radius: var(--radius-lg); padding: 60px 40px; text-align:center;
  box-shadow: var(--shadow-md); animation: fadeUp .4s ease;
}
.success-check{ margin: 0 auto 24px; width:88px; height:88px; }
.success-check svg{ width:100%; height:100%; }
.success-check circle{ stroke: var(--blue); stroke-width:2; stroke-dasharray:166; stroke-dashoffset:166; animation: circle .5s ease forwards; }
.success-check path{ stroke: var(--blue); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:48; stroke-dashoffset:48; animation: check .3s .5s ease forwards; }
@keyframes circle{ to{ stroke-dashoffset:0; } }
@keyframes check{ to{ stroke-dashoffset:0; } }
.rdv-success h3{ font-size:1.4rem; }

.form-note-success{
  background: var(--soft); color: var(--blue-dark); font-weight:600; padding: 14px 18px;
  border-radius: var(--radius-sm); margin-top:16px; animation: fadeUp .3s ease; text-align:center;
}

/* ---------- Contact ---------- */
.contact-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items:start; }
.contact-info{ display:flex; flex-direction:column; gap:16px; }
.info-card{
  display:flex; align-items:flex-start; gap:16px; background:#fff; border:1px solid var(--gray-border);
  border-radius: var(--radius-md); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.info-card .icon{ width:26px; height:26px; color: var(--blue); flex-shrink:0; margin-top:2px; }
.info-card h4{ font-size:.98rem; margin-bottom:4px; }
.info-card a{ color: var(--blue-dark); font-weight:600; }

.contact-info .card-form{ margin-top: 8px; padding: 30px; }

.map-wrapper{
  position:relative; width:100%; padding-bottom: 105%; border-radius: var(--radius-lg);
  overflow:hidden; box-shadow: var(--shadow-md); border: 1px solid var(--gray-border);
}
.map-wrapper iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* ---------- Footer ---------- */
.site-footer{ background: #06182B; color: #B8C7D6; }
.footer-inner{
  display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 50px; padding: 70px 0 40px;
}
.footer-brand img{ height:44px; margin-bottom:16px; filter: brightness(0) invert(1); opacity:.92; }
.footer-brand p{ color:#8DA0B4; font-size:.9rem; max-width:320px; }
.footer-col h5{ color:#fff; font-size:1rem; margin-bottom:18px; }
.footer-col ul li{ margin-bottom:12px; }
.footer-col a{ color:#B8C7D6; font-size:.92rem; transition: color .2s ease; }
.footer-col a:hover{ color:#fff; }
.footer-col span{ font-size:.92rem; }

.footer-bottom{ border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
  padding: 20px 0; font-size:.82rem; color:#7C90A5;
}
.signature strong{ color:#B8C7D6; }

/* ---------- Back to top ---------- */
.back-to-top{
  position: fixed; right: 24px; bottom: 24px; z-index: 400;
  width: 48px; height:48px; border-radius:50%; border:none;
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); color:#fff;
  box-shadow: var(--shadow-md); display:flex; align-items:center; justify-content:center;
  transition: transform .2s ease, opacity .2s ease;
}
.back-to-top:hover{ transform: translateY(-4px); }
.back-to-top .icon{ width:22px; height:22px; }
.back-to-top[hidden]{ display: none; }

/* ---------- Reveal on scroll ---------- */
[data-reveal]{ opacity:0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in-view{ opacity:1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 900px){
  .hero-visual{ display:block; }
}

@media (max-width: 1024px){
  .about-grid{ grid-template-columns: 1fr; gap:40px; }
  .network-grid{ grid-template-columns: 1fr; }
  .prevention-panel{ grid-template-columns: 1fr; }
  .prevention-image{ order:-1; max-height: 320px; width:100%; object-fit:cover; }
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
  .contact-grid{ grid-template-columns: 1fr; }
  .map-wrapper{ padding-bottom: 60%; }
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; }
}

@media (max-width: 860px){
  .main-nav, .header-actions{ display:none; }
  .hamburger{ display:flex; }

  .main-nav{
    display:flex; position: fixed; top: var(--header-h); right:0; height: calc(100vh - var(--header-h));
    width: min(320px, 82vw); background:#fff; flex-direction:column; padding: 30px 28px;
    box-shadow: -12px 0 40px rgba(11,34,57,.18); transform: translateX(100%); transition: transform .3s ease;
    z-index: 480; overflow-y:auto;
  }
  .main-nav.open{ transform: translateX(0); }
  .main-nav ul{ flex-direction:column; gap:6px; margin-bottom: 24px; }
  .main-nav .nav-link{ display:block; padding: 14px 4px; font-size:1.05rem; border-bottom:1px solid var(--gray-border); }
  .main-nav::after{ content:""; }

  .mobile-nav-inline-actions{ display:flex; }
}

@media (max-width: 640px){
  .container{ padding: 0 18px; }
  .section{ padding: 64px 0; }
  .hero{ padding: calc(var(--header-h) + 40px) 0 60px; text-align:left; }
  .hero-ctas{ flex-direction:column; align-items:stretch; }
  .hero-ctas .btn{ width:100%; }
  .trust-badges{ gap:20px; }
  .services-grid{ grid-template-columns: 1fr; }
  .about-gallery{ grid-template-columns: 1fr 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  .card-form{ padding: 26px; }
  .timeline-track{ overflow-x:auto; justify-content:flex-start; gap: 34px; padding-bottom: 6px; }
  .timeline-track::before{ left:20px; right:20px; }
  .timeline-panel{ padding: 24px; }
  .footer-inner{ grid-template-columns: 1fr; padding: 50px 0 30px; }
  .footer-bottom-inner{ flex-direction:column; text-align:center; }
  .brand-text small{ display:none; }
}
