/* ============================================================
   MiMo — Design System
   ============================================================ */
@import url('https://cdn-uicons.flaticon.com/uicons-solid-rounded/css/uicons-solid-rounded.css');
@import url('https://cdn-uicons.flaticon.com/uicons-solid-straight/css/uicons-solid-straight.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:      #F26B21;
  --orange2:     #FF8C42;
  --orange-btn:  #F47B38;
  --purple:      #7B3FC4;
  --blue:        #2D5BFF;
  --dark:        #080818;
  --radius:      20px;
  --radius-sm:   12px;
  --font:        'Poppins', 'Segoe UI', Arial, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: #fff;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

/* ── App wrapper ── */
.app {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

/* ── Auth header gradient (login / register) ── */
.auth-top {
  background: linear-gradient(160deg,#F26B21 0%,#E0457B 38%,#6B4DD3 65%,#3B8FE8 100%);
  padding: clamp(28px,7vw,44px) 20px 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   LOGO IMAGE — responsive, fond transparent
   ══════════════════════════════════════ */
.mimo-logo-img {
  height: clamp(30px, 7vw, 44px);
  width: auto;
  display: block;
  /* Le PNG est blanc sur fond transparent, pas besoin de filter */
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}

/* Logo dans les headers de page (dashboard, cards, profile) */
.dash-header .mimo-logo-img,
.topbar .mimo-logo-img {
  margin: 0 auto;
}

/* Logo dans les mini-cartes (vcard, big-card) */
.vc-logo-img {
  height: clamp(10px, 3vw, 14px);
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.bc-logo-img {
  height: clamp(14px, 4vw, 20px);
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

/* ── Top bar ── */
.topbar {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ══════════════════════════════════════
   CARTES VIRTUELLES — image PNG transparente
   ══════════════════════════════════════ */

/* Mini carte dans le scroll dashboard */
.vcard {
  flex-shrink: 0;
  width: clamp(150px, 42vw, 180px);
  aspect-ratio: 1.586;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.vcard-bg { display: none; }
.vcard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* Zone du haut : prend tout l'espace disponible (logo dans l'image) */
.vcard .vc-top {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 9px 10px 0;
}
/* Zone du bas : ligne de numéro sous le logo */
.vcard .vc-bottom {
  padding: 0 10px 9px;
  display: flex;
  align-items: center;
}
/* Numéro masqué style carte bancaire */
.vcard .vc-last4 {
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  font-family: 'Courier New', monospace;
}
.vcard .vc-net { font-size: clamp(10px, 3vw, 14px); font-weight: 900; color: #fff; }

/* Grosse carte (page card.php) */
.big-card {
  width: 100%;
  aspect-ratio: 1.586;
  max-height: 200px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  padding: clamp(14px,4vw,20px) clamp(14px,4vw,20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  margin: 10px 0 16px;
}
.big-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg,#F26B21 0%,#E0457B 38%,#6B4DD3 65%,#3B8FE8 100%);
}
.big-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.big-card > *:not(.big-card-bg) { position: relative; z-index: 2; }
.big-card .bc-top { display: flex; justify-content: space-between; align-items: center; }
.big-card .bc-net { font-size: clamp(14px,4vw,20px); color: #fff; display: flex; align-items: center; }
.big-card .bc-center {
  width: clamp(48px,13vw,60px);
  height: clamp(48px,13vw,60px);
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px,5vw,24px);
  color: rgba(255,255,255,.6);
  margin: 0 auto;
}
.big-card .bc-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.big-card .bc-balance { font-size: clamp(16px,5vw,22px); font-weight: 800; color: #fff; }
.big-card .bc-balance span { font-size: clamp(11px,3vw,13px); font-weight: 500; opacity: .8; display: block; }
.big-card .bc-freeze { text-align: right; }
.big-card .bc-freeze-btn {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 11px; cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.big-card .bc-freeze-btn .icon { font-size: 20px; }

/* Mastercard circles */
.mc-circles { display: flex; align-items: center; }
.mc-circles .mc-r { width: clamp(22px,6vw,30px); height: clamp(22px,6vw,30px); border-radius: 50%; background: #E8001C; }
.mc-circles .mc-g { width: clamp(22px,6vw,30px); height: clamp(22px,6vw,30px); border-radius: 50%; background: #F59E00; margin-left: clamp(-9px,-2.5vw,-7px); }

/* Visa text */
.visa-text { font-size: clamp(14px,4vw,20px); font-weight: 900; font-style: italic; color: #fff; letter-spacing: -1px; }

/* ── Card add button ── */
.card-add {
  flex-shrink: 0;
  width: clamp(150px,42vw,180px);
  aspect-ratio: 1.586;
  border-radius: 14px;
  border: 2px dashed rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: #9CA3AF;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .2s, color .2s;
}
.card-add:hover { border-color: var(--orange); color: var(--orange); }
.card-add .plus { font-size: 28px; font-weight: 300; }

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  padding: clamp(13px,4vw,16px);
  border: none;
  border-radius: 999px;
  font-size: clamp(13px,3.5vw,15px);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
  font-family: var(--font);
  letter-spacing: .3px;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--orange-btn); color: #fff; }
.btn-outline  { background: #fff; color: var(--orange); border: 2px solid #fff; }
.btn-ghost    { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-sm { padding: 9px 18px; font-size: 13px; width: auto; display: inline-block; }
.btn + .btn { margin-top: 12px; }

/* ── WHITE PANEL ── */
.panel {
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: clamp(20px,6vw,28px) clamp(16px,5vw,24px) 32px;
  color: #111;
  margin-top: auto;
}
.panel h2 { font-size: clamp(17px,5vw,20px); font-weight: 800; margin-bottom: 20px; color: #111; }

/* ── FORM ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 5px; }
.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #E8E8E8;
  border-radius: 999px;
  font-size: clamp(14px,4vw,15px);
  font-family: var(--font);
  color: #111;
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.form-group input:focus { border-color: var(--orange); }
.form-group .input-wrap { position: relative; }
.form-group .input-wrap input { padding-right: 46px; }
.form-group .toggle-pw {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--orange);
  font-size: 18px; padding: 0;
}
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }
.form-check input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; }
.form-link { text-align: center; font-size: 13px; color: #888; margin-top: 10px; }
.form-link a { color: var(--orange); font-weight: 700; text-decoration: none; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.alert-error   { background: #FFF0E6; color: #F26B21; }
.alert-success { background: #D1FAE5; color: #059669; }

/* ── DASHBOARD HEADER ── */
.dash-header {
  padding: clamp(14px,4vw,20px) 20px 0;
  text-align: center;
}
.dash-subtitle { font-size: 13px; color: #6B7280; margin-top: 4px; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }

/* ── BALANCE ── */
.balance-block { text-align: center; padding: 12px 20px 20px; }
.balance-amount {
  font-size: clamp(36px,10vw,52px);
  font-weight: 900;
  line-height: 1.1;
  color: #111;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.balance-amount .currency { font-size: clamp(18px,5vw,26px); font-weight: 700; color: #374151; }
.balance-refresh {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(242,107,33,.1); color: #F26B21;
  border: 1px solid rgba(242,107,33,.25);
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; margin-top: 6px;
  font-family: var(--font);
}
.balance-actions { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.balance-actions .act-btn {
  flex: 1; max-width: 150px;
  padding: clamp(11px,3vw,14px);
  border-radius: 999px;
  font-size: clamp(13px,3.5vw,15px);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: none; cursor: pointer;
  font-family: var(--font);
}
.act-btn-outline { background: #fff; color: var(--orange); border: 1.5px solid var(--orange); }
.act-btn-solid   { background: var(--orange-btn); color: #fff; }

/* ── CARDS SCROLL ── */
.cards-scroll {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.cards-scroll::-webkit-scrollbar { display: none; }

/* ── CONTENT AREA ── */
.content-area {
  background: transparent;
  flex: 1;
  padding: 20px 16px 90px;
  color: #111;
}

/* ── TRANSACTIONS ── */
.tx-title { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.tx-refresh { font-size: 12px; background: #F3F4F6; border: none; border-radius: 999px; padding: 4px 10px; cursor: pointer; color: #555; font-family: var(--font); }
.tx-date-group { font-size: 12px; color: #9CA3AF; margin: 12px 0 6px; }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F3F4F6; color: inherit; }
.tx-item:last-child { border-bottom: none; }
a.tx-item:hover { background: #FAFAFA; border-radius: 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.tx-icon { width: 38px; height: 38px; border-radius: 50%; background: #F3F4F6; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #555; flex-shrink: 0; }
.tx-info { flex: 1; }
.tx-info .tx-name  { font-size: 14px; font-weight: 600; color: #111; }
.tx-info .tx-label { font-size: 12px; color: #9CA3AF; }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-amount.plus  { color: #10B981; }
.tx-amount.minus { color: #F26B21; }
.tx-amount.gray  { color: #9CA3AF; }

/* ── CARD DETAIL ── */
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 14px; font-weight: 700; color: var(--orange); margin-bottom: 10px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid #F3F4F6; font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .dr-label { color: #9CA3AF; }
.detail-row .dr-value { font-weight: 600; color: #111; display: flex; align-items: center; gap: 6px; }
.detail-row .copy-btn { background: #F3F4F6; border: none; border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; color: #555; font-family: var(--font); }
.reveal-btn { background: none; border: none; color: var(--orange); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.status-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-active { background: #D1FAE5; color: #059669; }
.status-frozen { background: #DBEAFE; color: #2563EB; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: #1A0A2E;
  display: flex;
  z-index: 100;
  border-radius: 24px 24px 0 0;
  padding: 8px 0 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -6px 28px rgba(0,0,0,.4);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: rgba(255,255,255,.45);
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  transition: color .2s, transform .15s; padding-top: 8px;
  position: relative;
}
.nav-item.active {
  color: #F26B21;
  transform: translateY(-2px);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 20px; height: 3px;
  background: #F26B21;
  border-radius: 999px;
}
.nav-item.active .nav-icon i  { color: #F26B21; }
.nav-item:not(.active) .nav-icon i { color: rgba(255,255,255,.45); }
.nav-item:not(.active):hover { color: rgba(255,255,255,.75); }
.nav-item:not(.active):hover .nav-icon i { color: rgba(255,255,255,.75); }
.nav-item .nav-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.nav-item .nav-icon i {
  font-size: 22px;
  transition: color .2s;
  line-height: 1;
}

/* ── NOTIFICATION BELL ── */
.notif-bell {
  position: absolute;
  right: 20px;
  top: 20px;
  text-decoration: none;
  color: rgba(255,255,255,.85) !important;
  z-index: 10;
  line-height: 1;
}
.notif-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-bell i {
  font-size: 24px;
  display: block;
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  background: #F26B21;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0 3px;
  line-height: 1;
  border: 2px solid rgba(255,255,255,.3);
}

/* ── PAGE TITLE ── */
.page-title { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 16px; }

/* ── MODAL ── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: flex-end; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; width: 100%; max-width: 430px; border-radius: var(--radius) var(--radius) 0 0; padding: 24px 20px 32px; max-height: 85vh; overflow-y: auto; }
.modal-box h3 { font-size: 17px; font-weight: 800; color: #111; margin-bottom: 16px; }
.modal-close { position: absolute; right: 20px; top: 20px; background: none; border: none; font-size: 22px; cursor: pointer; color: #555; }

/* ── CREATE CARD MODAL ── */
.brand-selector { display: flex; gap: 12px; margin-bottom: 16px; }
.brand-opt { flex: 1; padding: 14px; border-radius: var(--radius-sm); border: 2px solid #E8E8E8; text-align: center; cursor: pointer; font-weight: 700; font-size: 14px; transition: border-color .2s; }
.brand-opt.selected { border-color: var(--orange); color: var(--orange); }
.brand-opt .net-icon { font-size: 24px; display: block; margin-bottom: 4px; }

/* ── TOPUP / WITHDRAW ── */
.amount-input-big { text-align: center; margin: 20px 0; }
.amount-input-big input { font-size: clamp(28px,8vw,36px); font-weight: 900; border: none; border-bottom: 3px solid var(--orange); text-align: center; width: 200px; outline: none; font-family: var(--font); color: #111; background: transparent; }
.amount-input-big .currency-label { font-size: 14px; color: #9CA3AF; margin-top: 4px; }

/* ── SPINNER ── */
.spinner { border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; width: 20px; height: 20px; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MISC ── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.empty-state { text-align: center; color: #9CA3AF; padding: 32px 0; font-size: 14px; }

@media (min-width: 431px) {
  .app { box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .bottom-nav { border-radius: 24px 24px 0 0; }
}

/* ════════════════════════════════════════════════════
   UTILITAIRES — classes légères (fond blanc partout)
   ════════════════════════════════════════════════════ */

/* Sections avec ombre légère */
.light-section {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.light-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

/* Champs de formulaire */
.lm-field label { color: #374151; }
.lm-field input,
.lm-field select {
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  color: #111;
}
.lm-field input:focus,
.lm-field select:focus { border-color: var(--orange); background: #fff; }
.lm-field select option { background: #fff; color: #111; }

/* Textes nommés */
.lm-name     { color: #111 !important; }
.lm-sub      { color: #6B7280 !important; }
.lm-divider  { background: rgba(0,0,0,.1) !important; }
.lm-stat-val { color: #111 !important; }
.lm-stat-lbl { color: #9CA3AF !important; }

/* Topbar */
.topbar-title { color: #111 !important; }
.topbar-back  { color: #374151 !important; }
.dash-header a[href]:not(.notif-bell) { color: #374151 !important; }
