/**
 * Portail marchés TSF — logo, visuels africains, fond animé
 */
*, *::before, *::after { box-sizing: border-box; }

.gateway-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: #061a33;
  color: #fff;
  overflow-x: hidden;
}

/* ——— Animated background ——— */
.mg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mg-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, rgba(6, 26, 51, .28) 0%, rgba(11, 58, 110, .22) 42%, rgba(29, 91, 184, .18) 100%);
  animation: mg-gradient-shift 18s ease-in-out infinite alternate;
}

@keyframes mg-gradient-shift {
  0% { filter: hue-rotate(0deg) brightness(1); }
  100% { filter: hue-rotate(8deg) brightness(1.06); }
}

.mg-bg-orbs {
  position: absolute;
  inset: 0;
}

.mg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  animation: mg-orb-float 14s ease-in-out infinite;
}

.mg-orb-1 {
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, rgba(245, 158, 11, .55), transparent 70%);
  animation-duration: 16s;
}

.mg-orb-2 {
  width: min(380px, 48vw);
  height: min(380px, 48vw);
  bottom: -10%;
  right: -5%;
  background: radial-gradient(circle, rgba(59, 130, 246, .5), transparent 70%);
  animation-duration: 20s;
  animation-delay: -4s;
}

.mg-orb-3 {
  width: min(280px, 38vw);
  height: min(280px, 38vw);
  top: 42%;
  left: 38%;
  background: radial-gradient(circle, rgba(16, 185, 129, .35), transparent 70%);
  animation-duration: 22s;
  animation-delay: -8s;
}

@keyframes mg-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(28px, -18px) scale(1.05); }
  66% { transform: translate(-20px, 22px) scale(.96); }
}

.mg-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3Cpath d='M20 20l40 40M60 20L20 60'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  animation: mg-pattern-drift 40s linear infinite;
}

@keyframes mg-pattern-drift {
  from { background-position: 0 0; }
  to { background-position: 160px 160px; }
}

.mg-bg-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: .38;
  pointer-events: none;
  mix-blend-mode: screen;
}

.mg-bg-gradient {
  z-index: 2;
}

.mg-bg-orbs,
.mg-bg-pattern,
.mg-bg-shimmer {
  z-index: 3;
}

.mg-bg-shimmer {
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, .04) 50%,
    transparent 58%
  );
  animation: mg-shimmer 8s ease-in-out infinite;
}

@keyframes mg-shimmer {
  0% { transform: translateX(-30%) rotate(8deg); }
  100% { transform: translateX(30%) rotate(8deg); }
}

/* ——— Shell ——— */
.mg-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding:
    clamp(1rem, 2.5vh, 1.75rem)
    clamp(1rem, 3vw, 2.5rem)
    clamp(1.25rem, 3vh, 2rem)
    clamp(1rem, 6vw, 2rem);
}

.mg-content {
  position: relative;
  width: min(920px, 100%);
  margin-left: auto;
  padding: clamp(1.15rem, 2.4vw, 1.85rem);
  border-radius: 22px;
  background: linear-gradient(
    145deg,
    rgba(6, 26, 51, .52) 0%,
    rgba(11, 58, 110, .38) 100%
  );
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: mg-brand-rise .75s ease both;
}

.mg-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .55), transparent);
  opacity: .7;
}

.mg-content-head {
  margin-bottom: 1.15rem;
  padding-left: .65rem;
}

.mg-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  margin-bottom: 1rem;
}

.mg-brand-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.35rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, .97);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, .22),
    0 0 0 1px rgba(255, 255, 255, .35);
  animation: mg-brand-rise .7s ease both;
}

@keyframes mg-brand-rise {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.mg-brand-logo {
  display: block;
  width: min(280px, 72vw);
  height: auto;
  max-height: 82px;
  object-fit: contain;
}

.mg-brand-tagline {
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}

.mg-intro {
  text-align: left;
  max-width: 34rem;
  margin: 0;
  animation: mg-brand-rise .7s .12s ease both;
}

.mg-intro-kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
}

.mg-intro h1 {
  margin: 0 0 .45rem;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .25);
}

.mg-intro p {
  margin: 0;
  opacity: .9;
  font-size: .95rem;
  line-height: 1.5;
  max-width: 32ch;
}

.mg-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
  width: 100%;
  margin: 0;
}

.mg-panel {
  position: relative;
  display: flex;
  min-height: 240px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(145deg, rgba(11, 58, 110, .85), rgba(6, 26, 51, .9));
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  animation: mg-panel-in .65s ease both;
}

.mg-panel:nth-child(1) { animation-delay: .15s; }
.mg-panel:nth-child(2) { animation-delay: .25s; }
.mg-panel:nth-child(3) { animation-delay: .35s; }
.mg-panel:nth-child(4) { animation-delay: .45s; }

@keyframes mg-panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.mg-panel:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(255, 255, 255, .32);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .32);
}

.mg-panel-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform .55s ease;
}

.mg-panel:hover .mg-panel-bg {
  transform: scale(1.1);
}

.mg-panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 26, 51, .15) 0%,
    rgba(6, 26, 51, .35) 35%,
    rgba(6, 26, 51, .82) 100%
  );
  pointer-events: none;
  transition: background .35s ease;
}

.mg-panel:hover .mg-panel-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 26, 51, .08) 0%,
    rgba(6, 26, 51, .28) 35%,
    rgba(6, 26, 51, .78) 100%
  );
}

.mg-panel--ML .mg-panel-overlay {
  background: linear-gradient(180deg, rgba(180, 83, 9, .12), rgba(6, 26, 51, .78));
}

.mg-panel--GN .mg-panel-overlay {
  background: linear-gradient(180deg, rgba(22, 163, 74, .12), rgba(6, 26, 51, .8));
}

.mg-panel--CI .mg-panel-overlay {
  background: linear-gradient(180deg, rgba(234, 88, 12, .1), rgba(6, 26, 51, .8));
}

.mg-panel--SN .mg-panel-overlay {
  background: linear-gradient(180deg, rgba(37, 99, 235, .12), rgba(6, 26, 51, .8));
}

.mg-panel-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .25rem;
  padding: 1.15rem 1.2rem;
  width: 100%;
  min-height: 240px;
}

.mg-panel-flag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .35rem;
  padding: .22rem .5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
}

.mg-panel-flag-svg,
.mg-panel-flag-img {
  display: block;
  width: 28px;
  height: 19px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  overflow: hidden;
}

.mg-panel-flag-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.mg-panel-flag-code {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: .9;
}

.mg-panel-country {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.mg-panel-sub {
  margin: 0;
  font-size: .78rem;
  opacity: .88;
}

.mg-panel-slogan {
  margin: .35rem 0 .55rem;
  font-size: .82rem;
  line-height: 1.4;
  opacity: .94;
  max-width: 28ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}

.mg-enter {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .15rem;
}

.mg-enter-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: #0b3a6e;
  font-size: 1rem;
  transition: transform .25s ease;
}

.mg-panel:hover .mg-enter-btn {
  transform: translateX(3px);
}

.mg-enter-label {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mg-panel-hint {
  margin: .45rem 0 0;
  font-size: .72rem;
  opacity: .78;
}

@media (min-width: 900px) {
  .mg-shell {
    padding-left: clamp(8rem, 26vw, 22rem);
  }

  .mg-content {
    width: min(900px, calc(100vw - clamp(10rem, 28vw, 24rem) - 2.5rem));
  }
}

@media (min-width: 1200px) {
  .mg-shell {
    padding-left: clamp(12rem, 30vw, 26rem);
  }
}

@media (max-width: 720px) {
  .mg-shell {
    justify-content: center;
    padding-left: clamp(1rem, 4vw, 1.25rem);
    padding-right: clamp(1rem, 4vw, 1.25rem);
  }

  .mg-content {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 18px;
  }

  .mg-content::before {
    display: none;
  }

  .mg-content-head {
    padding-left: 0;
  }

  .mg-brand {
    align-items: center;
  }

  .mg-intro {
    text-align: center;
  }

  .mg-intro p {
    max-width: none;
    margin-inline: auto;
  }

  .mg-grid {
    grid-template-columns: 1fr;
  }
  .mg-panel,
  .mg-panel-content {
    min-height: 200px;
  }
  .mg-brand-logo {
    width: min(240px, 85vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-bg-gradient,
  .mg-orb,
  .mg-bg-pattern,
  .mg-bg-shimmer,
  .mg-panel,
  .mg-brand-card {
    animation: none !important;
  }
  .mg-panel-bg,
  .mg-panel:hover .mg-panel-bg {
    transform: none;
  }
}
