:root {
  --mw-navy-950: #060f1f;
  --mw-navy-900: #0b1f3a;
  --mw-navy-800: #123a63;
  --mw-blue-600: #1a5490;
  --mw-cyan-400: #3fa9ff;
  --mw-cyan-300: #7fd0ff;
  --mw-white: #ffffff;
  --mw-ink-muted: #b7c6dd;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Cairo", Arial, sans-serif;
  background: var(--mw-navy-950);
  color: var(--mw-white);
  overflow-x: hidden;
}

[dir="rtl"] body {
  font-family: "Cairo", "Segoe UI", Arial, sans-serif;
}

a {
  text-decoration: none;
}

/* ===== Navbar ===== */
.mw-navbar {
  background: rgba(6, 15, 31, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(63, 169, 255, 0.18);
}

.mw-brand {
  color: var(--mw-white);
  letter-spacing: 0.5px;
}

.mw-logo {
  filter: drop-shadow(0 0 10px rgba(63, 169, 255, 0.55));
}

.btn-mw-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--mw-white);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-mw-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--mw-cyan-400);
  color: var(--mw-white);
}

.btn-mw-primary {
  background: var(--mw-cyan-400);
  border: none;
  color: var(--mw-navy-950);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-mw-primary:hover {
  color: var(--mw-navy-950);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(63, 169, 255, 0.4);
}

/* ===== Hero ===== */
.mw-hero {
  position: relative;
  min-height: 100vh;
  /* Fallback JPEG (compat. universelle) puis WebP (~95% plus leger, voir
     img/auth_background_4k.webp) via image-set() pour les navigateurs qui le
     supportent - la ligne du dessus est ignoree des qu'ils comprennent
     image-set(), donc aucun double chargement. */
  background-image: url("img/auth_background_4k.jpg");
  background-image: image-set(
    url("img/auth_background_4k.webp") type("image/webp"),
    url("img/auth_background_4k.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding-top: 96px;
}

.mw-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 30%, rgba(63, 169, 255, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(6, 15, 31, 0.55) 0%, rgba(6, 15, 31, 0.82) 55%, var(--mw-navy-950) 100%);
}

.mw-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 169, 255, 0.45);
  background: rgba(63, 169, 255, 0.08);
  color: var(--mw-cyan-300);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.mw-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.mw-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--mw-ink-muted);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.mw-subtitle-left {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.btn-mw-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, var(--mw-cyan-400), var(--mw-blue-600));
  color: var(--mw-white);
  font-weight: 700;
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(26, 84, 144, 0.55), 0 0 0 1px rgba(63, 169, 255, 0.35) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-mw-cta:hover {
  color: var(--mw-white);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(63, 169, 255, 0.55), 0 0 0 1px rgba(63, 169, 255, 0.5) inset;
}

.mw-cta-icon {
  font-size: 1.4rem;
  line-height: 1;
}

[dir="rtl"] .mw-cta-icon {
  transform: scaleX(-1);
}

.mw-scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  animation: mw-bounce 2s infinite;
}

@keyframes mw-bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
  50% { transform: translate(-50%, 10px); opacity: 1; }
}

/* ===== Points forts ===== */
.mw-features {
  background:
    radial-gradient(50% 40% at 15% 0%, rgba(63, 169, 255, 0.08), transparent 60%),
    var(--mw-navy-950);
}

.mw-section-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.mw-section-subtitle {
  color: var(--mw-ink-muted);
}

.mw-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mw-card:hover {
  transform: translateY(-6px);
  border-color: rgba(63, 169, 255, 0.5);
  box-shadow: 0 20px 45px rgba(6, 15, 31, 0.55), 0 0 30px rgba(63, 169, 255, 0.15);
}

.mw-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
  color: var(--mw-navy-950);
  background: linear-gradient(135deg, var(--mw-cyan-300), var(--mw-cyan-400));
  box-shadow: 0 8px 20px rgba(63, 169, 255, 0.35);
}

.mw-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.mw-card p {
  color: var(--mw-ink-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ===== Application mobile (mockups telephone en CSS pur) ===== */
.mw-mobile {
  background:
    radial-gradient(45% 35% at 85% 15%, rgba(63, 169, 255, 0.1), transparent 60%),
    var(--mw-navy-950);
}

.mw-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mw-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--mw-ink-muted);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.mw-check-list i {
  color: var(--mw-cyan-400);
  font-size: 1.15rem;
  margin-top: 0.1rem;
}

.mw-phones {
  position: relative;
  height: 480px;
  max-width: 420px;
  margin: 0 auto;
}

.mw-phone {
  position: absolute;
  width: 220px;
  height: 452px;
  background: linear-gradient(160deg, #101c33, #060f1f);
  border-radius: 34px;
  padding: 10px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(63, 169, 255, 0.25);
}

.mw-phone-back {
  top: 0;
  left: 0;
  transform: rotate(-8deg);
  opacity: 0.85;
  filter: saturate(0.85);
}

.mw-phone-front {
  top: 26px;
  left: 150px;
  transform: rotate(6deg);
}

.mw-phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 16px;
  background: #060f1f;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.mw-phone-screen {
  width: 100%;
  height: 100%;
  background: #f4f7fb;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--mw-navy-900);
}

.mw-screen-header {
  background: linear-gradient(135deg, var(--mw-navy-800), var(--mw-blue-600));
  color: var(--mw-white);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding: 18px 10px 10px;
}

.mw-screen-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #eaf1fb;
  font-size: 0.7rem;
  font-weight: 600;
  color: #7c8aa0;
}

.mw-screen-tabs span {
  padding: 4px 10px;
  border-radius: 999px;
}

.mw-screen-tabs span.active {
  background: var(--mw-blue-600);
  color: var(--mw-white);
}

.mw-screen-body {
  flex: 1;
  padding: 10px;
  overflow: hidden;
}

.mw-screen-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mw-tile {
  background: var(--mw-white);
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--mw-navy-800);
}

.mw-tile i {
  font-size: 1.1rem;
  color: var(--mw-blue-600);
}

.mw-tile-active {
  background: linear-gradient(135deg, var(--mw-cyan-300), var(--mw-cyan-400));
  border-color: transparent;
  color: var(--mw-navy-950);
}

.mw-tile-active i {
  color: var(--mw-navy-950);
}

.mw-screen-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mw-msg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mw-white);
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  padding: 8px;
}

.mw-msg-unread {
  border-color: var(--mw-cyan-400);
  box-shadow: 0 0 0 1px rgba(63, 169, 255, 0.25);
}

.mw-msg-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mw-cyan-300), var(--mw-cyan-400));
  color: var(--mw-navy-950);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
}

.mw-msg-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mw-msg-text strong {
  font-size: 0.72rem;
}

.mw-msg-text span {
  font-size: 0.65rem;
  color: #7c8aa0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[dir="rtl"] .mw-phone-back {
  transform: rotate(8deg);
}

[dir="rtl"] .mw-phone-front {
  left: auto;
  right: 150px;
  transform: rotate(-6deg);
}

@media (max-width: 991px) {
  .mw-phones {
    height: 420px;
    transform: scale(0.9);
  }
}

/* ===== Acces (cartes Fournisseur / Administration) ===== */
.mw-access-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  padding: 2.5rem 2rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--mw-white);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mw-access-card:hover {
  color: var(--mw-white);
  transform: translateY(-8px);
  border-color: rgba(63, 169, 255, 0.55);
  box-shadow: 0 25px 55px rgba(6, 15, 31, 0.6), 0 0 40px rgba(63, 169, 255, 0.18);
}

.mw-access-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.3rem;
  color: var(--mw-navy-950);
  background: linear-gradient(135deg, var(--mw-cyan-300), var(--mw-cyan-400));
  box-shadow: 0 10px 26px rgba(63, 169, 255, 0.4);
}

.mw-access-card-admin .mw-access-icon {
  background: linear-gradient(135deg, #ffd27f, #ff9f3f);
  box-shadow: 0 10px 26px rgba(255, 159, 63, 0.4);
}

.mw-access-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.mw-access-card p {
  color: var(--mw-ink-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  min-height: 3rem;
}

.mw-access-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--mw-cyan-400), var(--mw-blue-600));
  color: var(--mw-white);
  box-shadow: 0 0 0 1px rgba(63, 169, 255, 0.35) inset;
}

.mw-access-card-admin .mw-access-cta {
  background: linear-gradient(135deg, #ffd27f, #ff9f3f);
  color: var(--mw-navy-950);
}

/* ===== Contact / demande de demo ===== */
.mw-contact {
  background: var(--mw-navy-950);
}

.mw-alert {
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  font-size: 0.95rem;
  text-align: center;
}

.mw-alert-success {
  background: rgba(63, 169, 255, 0.12);
  border: 1px solid rgba(63, 169, 255, 0.4);
  color: var(--mw-cyan-300);
}

.mw-alert-error {
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #ff9aa5;
}

.mw-contact-form .mw-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mw-ink-muted);
  margin-bottom: 0.35rem;
}

.mw-contact-form .mw-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--mw-white);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}

.mw-contact-form .mw-input::placeholder {
  color: rgba(183, 198, 221, 0.55);
}

.mw-contact-form .mw-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--mw-cyan-400);
  color: var(--mw-white);
  box-shadow: 0 0 0 3px rgba(63, 169, 255, 0.2);
}

/* ===== Footer ===== */
.mw-footer {
  background: var(--mw-navy-950);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mw-footer-text {
  color: var(--mw-ink-muted);
  font-size: 0.9rem;
}

@media (max-width: 767px) {
  .mw-hero {
    background-attachment: scroll;
  }
}
