/* =================================================================
   ITC — Mobile Gateway — gateway.css
   Overlay de sélection de profil (uniquement mobile ≤ 768 px)
   Charte graphique : Navy #1E3A5F + Jaune #F2C94C · Montserrat
   ================================================================= */

/* ─── OVERLAY PRINCIPAL ────────────────────────────────────────── */
#mobile-gateway {
  display: none; /* masqué par défaut ; JS active sur mobile */
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(160deg, #0E1F3A 0%, #1E3A5F 55%, #122844 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);

  /* Animation d'entrée */
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-gateway.gw-visible {
  opacity: 1;
}

/* Respect de la préférence de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  #mobile-gateway,
  .gw-card,
  .gw-logo-wrap,
  .gw-heading,
  .gw-subtext {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ─── STRUCTURE INTERNE ────────────────────────────────────────── */
.gw-inner {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(env(safe-area-inset-top, 0px) + 48px, 56px) 20px 40px;
  gap: 0;
}

/* ─── LOGO ─────────────────────────────────────────────────────── */
.gw-logo-wrap {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.45s 0.08s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.45s 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-gateway.gw-visible .gw-logo-wrap {
  opacity: 1;
  transform: translateY(0);
}

.gw-logo-wrap .itc-logo-gw {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.gw-logo-svg {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.4));
}

.gw-logo-tagline {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 250, 246, 0.5);
  text-align: center;
}

/* ─── TITRES ────────────────────────────────────────────────────── */
.gw-heading {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  letter-spacing: -0.03em;
  color: #FBFAF6;
  text-align: center;
  line-height: 1.1;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.45s 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-gateway.gw-visible .gw-heading {
  opacity: 1;
  transform: translateY(0);
}

.gw-subtext {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(251, 250, 246, 0.65);
  text-align: center;
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto 36px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.45s 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-gateway.gw-visible .gw-subtext {
  opacity: 1;
  transform: translateY(0);
}

/* ─── CARTES ────────────────────────────────────────────────────── */
.gw-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

.gw-card {
  background: rgba(251, 250, 246, 0.06);
  border: 1px solid rgba(251, 250, 246, 0.12);
  border-radius: 20px;
  padding: 24px 20px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;

  /* Animation d'entrée décalée */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-card:nth-child(1) { transition-delay: 0.34s, 0.34s, 0s, 0s, 0s; }
.gw-card:nth-child(2) { transition-delay: 0.42s, 0.42s, 0s, 0s, 0s; }

#mobile-gateway.gw-visible .gw-card {
  opacity: 1;
  transform: translateY(0);
}

/* Hover / Focus */
@media (hover: hover) {
  .gw-card:hover {
    background: rgba(251, 250, 246, 0.11);
    border-color: rgba(242, 201, 76, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(242, 201, 76, 0.2);
  }
}

.gw-card:focus-visible {
  outline: 3px solid #F2C94C;
  outline-offset: 3px;
  background: rgba(251, 250, 246, 0.11);
  border-color: rgba(242, 201, 76, 0.45);
}

/* Clic / Tap */
.gw-card:active {
  transform: scale(0.97);
  background: rgba(242, 201, 76, 0.1);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icône */
.gw-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

/* Titre de la carte */
.gw-card-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
  color: #FBFAF6;
  margin-bottom: 6px;
}

/* Description */
.gw-card-desc {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(251, 250, 246, 0.6);
  line-height: 1.45;
  margin-bottom: 18px;
}

/* Bouton CTA dans la carte */
.gw-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F2C94C;
  color: #0E1620;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  width: 100%;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  /* min 44px touch target */
  min-height: 44px;
}

.gw-card:hover .gw-card-btn {
  background: #D9B03D;
  box-shadow: 0 4px 16px rgba(242, 201, 76, 0.3);
}

.gw-card-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── FOOTER GATEWAY ────────────────────────────────────────────── */
.gw-footer {
  margin-top: 32px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.45s 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-gateway.gw-visible .gw-footer {
  opacity: 1;
}

.gw-footer p {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.7rem;
  color: rgba(251, 250, 246, 0.35);
}

/* ─── BOUTON "CHANGER DE PROFIL" (pages internes) ───────────────── */
.gw-change-profile-btn {
  display: none; /* affiché via JS uniquement sur mobile */
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(251, 250, 246, 0.65);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.gw-change-profile-btn:hover,
.gw-change-profile-btn:focus-visible {
  border-color: rgba(242, 201, 76, 0.5);
  color: #F2C94C;
  background: rgba(242, 201, 76, 0.06);
  outline: none;
}

.gw-change-profile-btn:focus-visible {
  outline: 2px solid #F2C94C;
  outline-offset: 2px;
}

/* Sur mobile, afficher le bouton "Changer de profil" */
@media (max-width: 768px) {
  .gw-change-profile-btn {
    display: inline-flex;
  }
}
