/* ==================================================================
   OtomiaPay — Application MOBILE (frontend-mobile/)
   S'appuie sur les variables et composants de assets/css/style.css.
   ================================================================== */
html, body.m-body { background: #E9EAEF; }
body.m-body { min-height: 100dvh; overscroll-behavior-y: none; }
.m-app {
  position: relative; max-width: 480px; margin: 0 auto; min-height: 100dvh; overflow-x: hidden;
  background: var(--bg);
}
@media (min-width: 520px) { .m-app { box-shadow: 0 0 60px rgba(17, 24, 39, .12); } }
.m-body input, .m-body select, .m-body textarea { font-size: 16px !important; } /* évite le zoom iOS */

/* Contenu applicatif */
.m-content { padding: calc(.75rem + env(safe-area-inset-top)) 1rem calc(var(--nav-h) + 2.5rem + env(safe-area-inset-bottom)); }
.m-content.home { background: linear-gradient(180deg, #FDF1F2 0, var(--bg) 520px); min-height: 100dvh; }
.m-page-head { padding-top: .25rem; }

/* Navigation basse & bouton support : toujours visibles, quelle que soit la largeur d'écran
   (style.css les masque au-delà de 992 px pour la version web). */
.m-body .bottom-nav.m-nav { display: flex !important; width: min(92%, 420px); }
.m-body .support-fab.m-fab { right: max(16px, calc(50% - 240px + 16px)); bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }

/* Messages */
.m-alert { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px; font-weight: 500; font-size: .92rem; margin-bottom: 1rem; }
.m-alert i { margin-top: .15rem; }
.m-alert-danger { background: var(--red-light); color: var(--red-dark); }
.m-alert-success { background: var(--success-bg); color: #126C34; }
.m-alert-warning { background: var(--warning-bg); color: #8A4B00; }
.m-alert-info { background: #E8F1FF; color: #1D4ED8; }

/* ==================================================================
   ÉCRAN DE DÉMARRAGE (splash)
   ================================================================== */
.m-splash {
  position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; overflow: hidden; text-align: center; padding: 2rem;
  background: radial-gradient(circle at 25% 15%, #FF4049 0, transparent 45%),
              radial-gradient(circle at 85% 90%, #7A0009 0, transparent 50%),
              linear-gradient(160deg, #F0111C 0%, var(--red) 40%, var(--red-dark) 100%);
}
.m-splash::before, .m-splash::after { content: ''; position: absolute; border-radius: 50%; border: 50px solid rgba(255, 255, 255, .06); }
.m-splash::before { width: 420px; height: 420px; top: -160px; right: -190px; }
.m-splash::after { width: 340px; height: 340px; bottom: -150px; left: -170px; }
.m-splash .logo-wrap {
  width: 120px; height: 120px; border-radius: 34px; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 50px rgba(80, 0, 6, .35), 0 0 0 12px rgba(255, 255, 255, .1);
  animation: splashPop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}
.m-splash .logo-wrap img { width: 84px; height: 84px; }
.m-splash h1 { font-weight: 800; font-size: 2.2rem; letter-spacing: -.5px; margin: 1.6rem 0 .35rem; animation: fadeUp .6s .25s both; }
.m-splash p { opacity: .85; margin: 0; animation: fadeUp .6s .4s both; }
.m-splash .loader { position: absolute; bottom: calc(4.5rem + env(safe-area-inset-bottom)); display: flex; gap: .5rem; }
.m-splash .loader span { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: dotPulse 1.1s infinite ease-in-out; }
.m-splash .loader span:nth-child(2) { animation-delay: .15s; }
.m-splash .loader span:nth-child(3) { animation-delay: .3s; }
.m-splash .by { position: absolute; bottom: calc(1.8rem + env(safe-area-inset-bottom)); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; font-weight: 600; }
.m-splash.leaving { animation: splashOut .35s ease-in forwards; }
@keyframes splashPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes dotPulse { 0%, 80%, 100% { transform: scale(.55); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes splashOut { to { opacity: 0; transform: scale(1.04); } }

/* ==================================================================
   BIENVENUE (onboarding)
   ================================================================== */
.m-onboard { min-height: 100dvh; display: flex; flex-direction: column; background: #fff; padding-bottom: env(safe-area-inset-bottom); }
.m-onboard .top { display: flex; justify-content: space-between; align-items: center; padding: calc(1rem + env(safe-area-inset-top)) 1.25rem .5rem; }
.m-onboard .top img { width: 40px; height: 40px; }
.m-onboard .skip { font-weight: 700; color: var(--muted); }
.m-slides { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.m-slides::-webkit-scrollbar { display: none; }
.m-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 2rem; text-align: center; }
.m-illus { position: relative; width: 240px; height: 240px; margin-bottom: 2rem; }
.m-illus .disc { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #FFE5E8, #FFD0D5); }
.m-illus .ring { position: absolute; inset: -18px; border-radius: 50%; border: 2px dashed #FBC3C9; animation: spin 30s linear infinite; }
.m-illus .main {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 120px; height: 120px; border-radius: 34px;
  background: linear-gradient(135deg, #FF2B36, var(--red-dark)); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; box-shadow: 0 18px 36px rgba(229, 9, 20, .35);
}
.m-illus .chip {
  position: absolute; width: 56px; height: 56px; border-radius: 18px; background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: 0 10px 24px rgba(17, 24, 39, .12); animation: float 4s ease-in-out infinite;
}
.m-illus .chip.c1 { top: 8px; right: 14px; color: #16A34A; }
.m-illus .chip.c2 { bottom: 18px; left: 4px; color: #D2861A; animation-delay: 1.2s; }
.m-illus .chip.c3 { bottom: 4px; right: 30px; color: #1E7BE0; animation-delay: 2.1s; }
.m-slide h2 { font-weight: 800; color: var(--navy); font-size: 1.6rem; line-height: 1.2; margin-bottom: .6rem; }
.m-slide h2 em { font-style: normal; color: var(--red); }
.m-slide p { color: var(--muted); font-size: 1rem; max-width: 320px; }
.m-onboard .dots { display: flex; justify-content: center; gap: .45rem; margin: .5rem 0 1.4rem; }
.m-onboard .dots span { width: 9px; height: 9px; border-radius: 5px; background: #D9DBE2; transition: all .25s; }
.m-onboard .dots span.active { width: 26px; background: var(--red); }
.m-onboard .actions { padding: 0 1.25rem 1.5rem; display: grid; gap: .75rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ==================================================================
   ÉCRANS D'AUTHENTIFICATION (en-tête rouge + feuille blanche)
   ================================================================== */
.m-auth { min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.m-hero {
  position: relative; overflow: hidden; color: #fff; padding: calc(1rem + env(safe-area-inset-top)) 1.4rem 3.4rem;
  background: radial-gradient(circle at 15% 0%, #FF4049 0, transparent 50%), linear-gradient(150deg, #F0111C, var(--red) 45%, var(--red-dark));
}
.m-hero-shape { position: absolute; border-radius: 50%; border: 34px solid rgba(255, 255, 255, .07); }
.m-hero-shape.s1 { width: 230px; height: 230px; right: -90px; top: -90px; }
.m-hero-shape.s2 { width: 140px; height: 140px; right: 70px; bottom: -80px; border-width: 22px; }
.m-hero-bar { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.4rem; }
.m-hero-logo { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.m-glass-btn {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .35);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.m-glass-btn:hover { color: #fff; background: rgba(255, 255, 255, .26); }
.m-hero-icon { position: relative; width: 58px; height: 58px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: .9rem; }
.m-hero h1 { position: relative; font-weight: 800; font-size: 1.75rem; margin: 0 0 .3rem; }
.m-hero p { position: relative; margin: 0; opacity: .88; font-size: .95rem; max-width: 330px; }

.m-sheet {
  position: relative; flex: 1; background: #fff; margin-top: -1.9rem; border-radius: 30px 30px 0 0;
  padding: 1.6rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(17, 24, 39, .06);
}
.m-sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #E5E7EB; margin: -0.6rem auto 1.2rem; }

/* Champs */
.m-field { margin-bottom: 1rem; }
.m-field label { display: block; font-weight: 700; font-size: .82rem; color: var(--navy); margin-bottom: .4rem; }
.m-input {
  display: flex; align-items: center; gap: .6rem; background: #F4F5F8; border: 1.5px solid transparent; border-radius: 16px;
  padding: 0 1rem; height: 56px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.m-input:focus-within { background: #fff; border-color: var(--red); box-shadow: 0 0 0 4px rgba(229, 9, 20, .1); }
.m-input.invalid { border-color: var(--red); background: #FFF6F7; }
.m-input > i { color: #9CA3AF; width: 18px; text-align: center; }
.m-input input, .m-input select { flex: 1; min-width: 0; border: none; background: transparent; outline: none; height: 100%; color: var(--text); font-weight: 500; }
.m-input .eye { border: none; background: none; color: #9CA3AF; padding: .4rem; }
.m-prefix { display: flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--navy); padding-right: .7rem; border-right: 1.5px solid #E2E4EA; height: 28px; }
.m-prefix img { width: 22px; height: 22px; }
.m-error { color: var(--red-dark); font-size: .82rem; font-weight: 600; margin-top: .35rem; }
.m-hint { color: var(--muted); font-size: .8rem; margin-top: .35rem; }

/* Sélecteur Téléphone / E-mail */
.m-segment { display: grid; grid-template-columns: 1fr 1fr; background: #F4F5F8; border-radius: 16px; padding: 4px; margin-bottom: 1.2rem; }
.m-segment button { border: none; background: transparent; border-radius: 12px; padding: .65rem; font-weight: 700; color: var(--muted); transition: all .2s; }
.m-segment button.active { background: #fff; color: var(--red); box-shadow: var(--shadow-sm); }

.m-link-row { display: flex; justify-content: flex-end; margin: -.3rem 0 1.4rem; }
.m-link-row a { font-weight: 700; font-size: .9rem; }
.m-or { text-align: center; color: var(--muted); font-size: .9rem; margin: 1.25rem 0 .75rem; }
.m-btn { height: 58px; border-radius: 18px; font-size: 1.05rem; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

/* Étapes d'inscription */
.m-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-bottom: .6rem; }
.m-steps span { height: 6px; border-radius: 3px; background: #ECEDF1; transition: background .3s; }
.m-steps span.done { background: var(--red); }
.m-step-label { font-size: .78rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.m-step { display: none; }
.m-step.active { display: block; animation: fadeUp .3s both; }
.m-step-nav { display: grid; grid-template-columns: auto 1fr; gap: .6rem; margin-top: 1.4rem; }
.m-step-nav .back { width: 58px; height: 58px; border-radius: 18px; }
.m-step-nav.first { grid-template-columns: 1fr; }
.m-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; color: #4B5563; }
.m-check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--red); flex-shrink: 0; }

/* Code OTP */
.m-code { display: flex; gap: .55rem; justify-content: center; margin: .5rem 0 1.5rem; }
.m-code input {
  width: 48px; height: 60px; border-radius: 16px; border: 1.5px solid transparent; background: #F4F5F8;
  text-align: center; font-size: 1.6rem !important; font-weight: 800; color: var(--navy);
}
.m-code input:focus { outline: none; background: #fff; border-color: var(--red); box-shadow: 0 0 0 4px rgba(229, 9, 20, .1); }

/* PIN : points + pavé numérique natif */
.m-pin-title { text-align: center; font-weight: 800; color: var(--navy); font-size: 1.1rem; margin-bottom: .3rem; }
.m-pin-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; min-height: 1.3em; }
.m-pin-dots { display: flex; justify-content: center; gap: 1.1rem; margin-bottom: 2rem; }
.m-pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #D1D5DB; transition: all .15s; }
.m-pin-dots span.on { background: var(--red); border-color: var(--red); transform: scale(1.1); }
.m-pin-dots.shake { animation: shake .4s; }
.m-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem 1.4rem; max-width: 300px; margin: 0 auto; }
.m-keypad button {
  height: 66px; border-radius: 22px; border: none; background: #F4F5F8; font-size: 1.6rem; font-weight: 700; color: var(--navy);
  transition: background .12s, transform .12s;
}
.m-keypad button:active { background: var(--red-light); transform: scale(.94); }
.m-keypad button.ghost { background: transparent; font-size: 1.2rem; color: var(--muted); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Accueil mobile : carte de compte pleine largeur */
.m-content .balance-track { margin: 0 -1rem; padding: 0 1rem .25rem; }
.m-content .balance-card { flex-basis: calc(100% - 1.25rem); }
.m-content .services-grid { grid-template-columns: repeat(3, 1fr); }
.m-account-head { text-align: center; padding: .5rem 0 1.25rem; }
/* Espace pour le bouton flottant d'assistance : il ne recouvre plus les champs/boutons du bas */
.m-content { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
