/* =========================================================================
   style.css — NovaBank PWA
   - Variables de thème (clair / sombre)
   - Mise en page mobile-first, optimisée iPhone
   - Coins arrondis, ombres discrètes, animations CSS
   ========================================================================= */

/* ---------- Variables de thème ---------- */
:root {
  --radius: 22px;
  --radius-sm: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Marges de sécurité iPhone (encoche / barre d'accueil) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Thème sombre (par défaut) */
[data-theme="dark"] {
  --bg: #0b1622;
  --bg-grad: linear-gradient(165deg, #122436 0%, #0b1622 55%, #081019 100%);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-solid: #16202c;
  --card: rgba(255, 255, 255, 0.05);
  --text: #f5f8fc;
  --text-muted: #93a1b3;
  --accent: #4f8cff;
  --credit: #34d99b;
  --debit: #f5f8fc;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --border: rgba(255, 255, 255, 0.07);
}

/* Thème clair */
[data-theme="light"] {
  --bg: #f2f4f8;
  --bg-grad: linear-gradient(165deg, #e8eefb 0%, #f2f4f8 60%);
  --surface: rgba(0, 0, 0, 0.04);
  --surface-solid: #ffffff;
  --card: #ffffff;
  --text: #0d1b2a;
  --text-muted: #6b7a8d;
  --accent: #2b6fff;
  --credit: #0fae73;
  --debit: #0d1b2a;
  --shadow: 0 8px 24px rgba(20, 40, 80, 0.10);
  --border: rgba(0, 0, 0, 0.06);
}

/* ---------- Réinitialisation ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(24px + var(--safe-bottom));
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* =========================================================================
   ÉCRAN DE DÉMARRAGE (SPLASH)
   ========================================================================= */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-grad);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash.hidden { opacity: 0; visibility: hidden; }

.splash {
  flex-direction: column;
  gap: 18px;
}
.splash-icon {
  width: 96px; height: 96px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: logoIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.splash-logo {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  animation: logoIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 0.15s;
}

@keyframes logoIn {
  0%   { opacity: 0; transform: scale(0.8) translateY(10px); }
  60%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   ÉCRAN DE VERROUILLAGE (CODE D'ACCÈS)
   ========================================================================= */
.lock {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(54px + var(--safe-top)) 24px calc(34px + var(--safe-bottom));
  color: #fff;
  /* Ambiance « méduses » : dégradé sombre bleu-vert */
  background:
    radial-gradient(120% 80% at 70% 18%, rgba(40, 90, 110, 0.55), transparent 60%),
    radial-gradient(120% 90% at 20% 80%, rgba(30, 70, 95, 0.45), transparent 55%),
    linear-gradient(165deg, #143042 0%, #0a1a26 55%, #050d14 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.lock.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.lock-top { display: flex; flex-direction: column; align-items: center; }

.lock-avatar {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2b6f8a, #14323f);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: logoIn 0.7s ease both;
}
.lock-greeting {
  margin-top: 18px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  animation: fadeDown 0.6s ease both;
}

/* Points de saisie */
.lock-dots {
  display: flex;
  gap: 18px;
  margin-top: 34px;
  min-height: 16px;
}
.lock-dots .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.2s, transform 0.2s;
}
.lock-dots .dot.filled {
  background: #fff;
  transform: scale(1.05);
}
.lock-dots.error { animation: shake 0.45s; }
.lock-dots.error .dot { background: #ff6b6b; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

/* Pavé numérique */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 30px;
  width: 100%;
  max-width: 320px;
}
.key {
  height: 74px; width: 74px;
  margin: 0 auto;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 1.9rem;
  font-weight: 400;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.key:active { background: rgba(255, 255, 255, 0.28); transform: scale(0.92); }
.key--icon { background: transparent; font-size: 1.6rem; }
.key--icon:active { background: rgba(255, 255, 255, 0.12); }

.lock-forgot {
  background: none; border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem; font-family: var(--font);
  cursor: pointer;
}

/* =========================================================================
   EN-TÊTE (héros « méduses » — toujours sombre, texte blanc)
   ========================================================================= */
.app-header {
  position: relative;
  padding: calc(14px + var(--safe-top)) 18px 14px;
  color: #fff;
  background-image: url("./bg-jellyfish.svg");
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  animation: fadeDown 0.6s ease both;
}
/* Fondu vers le fond de la page sous l'en-tête */
.app-header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.app-header > * { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Avatar utilisateur */
.avatar {
  position: relative;
  width: 40px; height: 40px;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background: linear-gradient(145deg, #2b6f8a, #14323f);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; font-family: var(--font);
  border: 1px solid rgba(255,255,255,0.2);
}
.avatar:active { transform: scale(0.92); }
.avatar-dot {
  position: absolute; top: -1px; right: -1px;
  width: 10px; height: 10px;
  background: #ff4d4d;
  border: 2px solid #0c2230;
  border-radius: 50%;
}

/* Barre de recherche */
.search-wrap {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
}
.search-icon { width: 18px; height: 18px; opacity: 0.8; flex-shrink: 0; }
#search {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  color: #fff;
  font-size: 1rem; font-family: var(--font);
}
#search::placeholder { color: rgba(255, 255, 255, 0.85); }

/* Boutons ronds (stats / cartes) */
.icon-btn {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.28); }

/* ---------- Bloc solde ---------- */
.balance-block {
  text-align: center;
  padding: 30px 0 20px;
}
.account-type { color: rgba(255,255,255,0.9); font-size: 1rem; margin-bottom: 6px; }

.balance {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  color: #fff;
  animation: balancePop 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 0.2s;
}
.balance-cents { font-size: 1.6rem; font-weight: 700; }

.iban {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 12px;
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  letter-spacing: 0.3px;
}
.iban-ic { width: 18px; height: 18px; flex-shrink: 0; }

/* Bouton « Comptes et Portefeuilles » */
.accounts-btn {
  margin-top: 22px;
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform var(--transition), background var(--transition);
}
.accounts-btn:active { transform: scale(0.96); background: rgba(255,255,255,0.26); }

@keyframes balancePop {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---------- Actions rapides ---------- */
.quick-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 14px;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.3s;
}
.qa {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: none; border: none; cursor: pointer;
  color: #fff;
  font-size: 0.8rem; line-height: 1.15; font-family: var(--font);
}
.qa-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  transition: transform var(--transition), background var(--transition);
}
.qa-icon svg { width: 24px; height: 24px; }
.qa-lbl { max-width: 84px; }
.qa:active .qa-icon { transform: scale(0.9); background: rgba(255,255,255,0.28); }

/* =========================================================================
   CONTENU — TRANSACTIONS
   ========================================================================= */
.content {
  padding: 0 16px 0;
  margin-top: -10px;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 14px 4px 10px;
}

/* ---------- Encart d'avertissement (documents) ---------- */
.alert-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 4px;
  animation: txIn 0.5s ease both;
}
.alert-row { display: flex; gap: 14px; align-items: flex-start; }
.alert-ic {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245, 166, 35, 0.16);
  border-radius: 50%;
}
.alert-ic svg { width: 26px; height: 26px; }
.alert-text { display: flex; flex-direction: column; gap: 5px; }
.alert-text strong { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.3px; }
.alert-text span { color: var(--text-muted); font-size: 0.95rem; line-height: 1.4; }
.alert-btn {
  width: 100%;
  margin-top: 16px;
  padding: 15px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #0d1b2a;
  font-size: 1.02rem; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  transition: transform var(--transition);
}
.alert-btn:active { transform: scale(0.98); }

/* En-tête de groupe (date + total du jour) */
.tx-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 6px 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.tx-group-total { font-size: 0.85rem; }

/* Carte regroupant les transactions d'un jour */
.tx-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Ligne de transaction */
.transaction {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  animation: txIn 0.45s ease both;
  cursor: pointer;
}
.transaction:active { background: var(--surface); }
.transaction:last-child { border-bottom: none; }
.transaction--failed { opacity: 0.55; }
.transaction--failed .tx-amount { text-decoration: line-through; }

.tx-avatar {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.tx-avatar svg { width: 23px; height: 23px; }
.txd-avatar svg { width: 38px; height: 38px; }

/* Petites icônes inline (boutons / valeurs) */
.ti { width: 18px; height: 18px; vertical-align: -3px; }
.txd-btn .ti { width: 19px; height: 19px; }
.bank-share svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 5px; }
.cur-flag { width: 20px; height: 20px; }
.cur-chev { width: 16px; height: 16px; }
.key--icon svg { width: 26px; height: 26px; }

.tx-details {
  flex: 1;
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.tx-name {
  font-weight: 600; font-size: 0.98rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-meta { color: var(--text-muted); font-size: 0.8rem; }

.tx-amount {
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.tx-amount--credit { color: var(--credit); }
.tx-amount--debit  { color: var(--debit); }
.tx-amount--muted  { color: var(--text-muted); }

.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* Bouton « Tout afficher » */
.show-all-btn {
  display: block;
  width: 100%;
  margin: 16px 0 4px;
  padding: 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.05rem; font-weight: 700; font-family: var(--font);
  cursor: pointer;
}
.show-all-btn:active { opacity: 0.6; }

/* =========================================================================
   WIDGETS DE L'ACCUEIL (prochains paiements, patrimoine)
   ========================================================================= */
.widget-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-top: 16px;
  animation: txIn 0.5s ease both;
}
.widget-head {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  padding: 0; margin-bottom: 4px;
}
.widget-head svg { width: 16px; height: 16px; }

.wealth-total {
  font-size: 2rem; font-weight: 800; letter-spacing: -1px;
  margin: 4px 0 8px;
}

/* Lignes des widgets */
.w-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.w-row:last-child { border-bottom: none; }
.w-row--btn {
  width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-family: var(--font);
}
.w-row--btn:active { opacity: 0.6; }
.w-ic {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.w-ic svg { width: 24px; height: 24px; }
.w-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.w-name { font-weight: 600; font-size: 1rem; }
.w-sub { color: var(--text-muted); font-size: 0.84rem; line-height: 1.3; }
.w-val { font-weight: 700; font-size: 1rem; white-space: nowrap; }

/* =========================================================================
   PAGE « TOUTES LES TRANSACTIONS » (panneau plein écran)
   ========================================================================= */
.all-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  background-image: var(--bg-grad);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.all-screen.open { transform: translateX(0); }
body.no-scroll { overflow: hidden; }

.all-head {
  padding: calc(14px + var(--safe-top)) 18px 4px;
}
.all-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  margin-left: -8px;
  border: none; background: none; cursor: pointer;
  color: var(--text);
}
.all-back svg { width: 26px; height: 26px; }

.all-balance {
  margin-top: 8px;
  font-size: 2.6rem; font-weight: 800; letter-spacing: -1.5px;
  line-height: 1;
}
.all-balance-cents { font-size: 1.4rem; font-weight: 700; }
.all-balance-label { margin-top: 6px; color: var(--text-muted); font-size: 1rem; }

.all-searchrow {
  display: flex; align-items: center; gap: 12px;
  margin-top: 20px;
}
.all-search-wrap {
  flex: none;
  margin-top: 18px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 16px;
}
.all-search-wrap .search-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  color: var(--text-muted); opacity: 1;
}
.all-search-wrap #all-search {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  color: var(--text);
  font-size: 1.05rem; font-family: var(--font);
  -webkit-appearance: none; appearance: none;
}
.all-search-wrap #all-search::placeholder { color: var(--text-muted); }
.all-search-wrap #all-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.filter-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.filter-btn svg { width: 24px; height: 24px; }

.all-list {
  padding: 0 16px calc(30px + var(--safe-bottom));
}

/* =========================================================================
   FEUILLES MODALES (Profil, Cartes)
   ========================================================================= */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  background-image: var(--bg-grad);
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.34s ease;
  overflow-y: auto;
}
.sheet.open { transform: translateY(0); opacity: 1; }

.sheet-head {
  display: flex; align-items: center; gap: 14px;
  min-height: 40px;
}
.sheet-close {
  width: 40px; height: 40px; margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; color: var(--text);
}
.sheet-close svg { width: 24px; height: 24px; }
.sheet-h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.5px; }

/* Profil */
.profile-top { text-align: center; padding: 14px 0 22px; }
.profile-avatar {
  width: 104px; height: 104px; margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #2b6f8a, #14323f);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 700; color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
}
.profile-name { margin-top: 16px; font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; }
.profile-handle { margin-top: 4px; color: var(--text-muted); font-size: 1.05rem; }

/* Carte regroupant des lignes (profil + cartes) */
.sheet-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 6px;
}
.sheet-row, .card-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 15px 16px;
  border: none; background: none; cursor: pointer;
  color: var(--text); text-align: left;
  border-bottom: 1px solid var(--border);
}
.sheet-row:last-child, .card-row:last-child { border-bottom: none; }
.card-row { cursor: default; }
.sheet-ic {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.sheet-ic svg { width: 23px; height: 23px; }
.sheet-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sheet-title { font-weight: 600; font-size: 1.02rem; }
.sheet-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.35; }
.sheet-chev { color: var(--text-muted); font-size: 1.4rem; }

/* Mini-cartes bancaires */
.mini-card {
  width: 52px; height: 36px; flex-shrink: 0;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.mini-card--eph    { background: linear-gradient(135deg, #8a8f98, #4a4f57); }
.mini-card--violet { background: linear-gradient(135deg, #6a3df0, #2b6fff); }
.mini-card--blue   { background: linear-gradient(135deg, #1f4fd0, #0b2a6b); }

.cards-foot { text-align: center; color: var(--text-muted); font-size: 0.95rem; margin-top: 22px; }
.cards-add {
  display: block; margin: 14px auto 0;
  padding: 14px 30px;
  border: none; border-radius: 999px;
  background: #fff; color: #0d1b2a;
  font-size: 1.05rem; font-weight: 700; font-family: var(--font);
  cursor: pointer;
}
.cards-add:active { transform: scale(0.97); }

/* ---------- Informations personnelles ---------- */
.perso-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  padding: 8px 0 22px;
}
.perso-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.perso-sub { margin-top: 8px; color: var(--text-muted); font-size: 1.05rem; }
.perso-avatar {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #2b6f8a, #14323f);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
}
.info-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 0.95rem; }
.info-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.info-value { font-size: 1.05rem; font-weight: 500; }
.info-edit {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  color: #21c25e;
}
.info-edit svg { width: 20px; height: 20px; }

/* ---------- Coordonnées bancaires ---------- */
.cur-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 6px 0 14px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-weight: 600; font-size: 0.98rem;
}
.cur-chev { color: var(--text-muted); }
.bank-card { padding: 18px 16px 16px; }
.bank-section { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.bank-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.bank-label { display: block; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 5px; }
.bank-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bank-value { color: #21c25e; font-size: 1.02rem; font-weight: 500; line-height: 1.35; }
.copy-btn {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  color: #21c25e; padding: 0;
}
.copy-btn svg { width: 21px; height: 21px; }
.copy-btn.copied { color: var(--text-muted); }
.bank-share {
  width: 100%; margin-top: 16px;
  padding: 15px;
  border: none; border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  cursor: pointer;
}
.bank-share:active { transform: scale(0.98); }

/* ---------- Détail d'une transaction ---------- */
.txd-head { display: flex; align-items: center; justify-content: space-between; }
.txd-more, .txd-head .sheet-close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; color: var(--text);
}
.txd-more svg, .txd-head .sheet-close svg { width: 24px; height: 24px; }

.txd-hero { text-align: center; padding: 26px 0 22px; }
.txd-avatar {
  width: 84px; height: 84px; margin: 0 auto 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem; color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.txd-name { font-size: 1.3rem; font-weight: 600; }
.txd-amount { font-size: 2.7rem; font-weight: 800; letter-spacing: -1.5px; margin-top: 12px; }
.txd-amount--credit { color: var(--credit); }
.txd-date { color: var(--text-muted); font-size: 1rem; margin-top: 10px; }

.txd-actions {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 18px;
}
.txd-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  border: none; border-radius: 14px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.98rem; font-weight: 600; font-family: var(--font);
  white-space: nowrap; cursor: pointer;
}
.txd-btn:active { transform: scale(0.97); }

.txd-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 12px;
}
.txd-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.txd-row:last-child { border-bottom: none; }
.txd-k { color: var(--text-muted); font-size: 0.98rem; }
.txd-v { font-weight: 600; font-size: 0.98rem; text-align: right; }
.txd-v--green { color: #21c25e; }

/* ---------- Comptes liés ---------- */
.linked-ring {
  width: 230px; height: 230px;
  margin: 18px auto 30px;
  border-radius: 50%;
  border: 13px solid #22d3e0;
  display: flex; align-items: center; justify-content: center;
}
.linked-ring-inner { text-align: center; }
.linked-ring-label { display: block; color: var(--text); font-size: 1.1rem; }
.linked-ring-amount { display: block; font-size: 2.6rem; font-weight: 800; letter-spacing: -1px; margin-top: 6px; }

.linked-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 14px; }
.linked-amt { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.lcl-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: #0a1a6b;
  color: #fff; font-weight: 800; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Détail d'un prochain paiement (prélèvement) ---------- */
.up-hero { text-align: center; padding: 8px 0 18px; }
.up-avatar {
  width: 84px; height: 84px; margin: 0 auto 18px;
  border-radius: 50%;
  background: #2b7fff;
  display: flex; align-items: center; justify-content: center;
}
.up-avatar svg { width: 40px; height: 40px; }
.up-name { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.5px; }
.up-recur { font-size: 1.2rem; margin-top: 8px; }
.up-auto { color: var(--text-muted); font-size: 1rem; margin-top: 4px; }

.up-cancel {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  padding: 15px;
  margin-bottom: 16px;
  border: none; border-radius: 16px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  cursor: pointer;
}
.up-cancel svg { width: 20px; height: 20px; }
.up-cancel:active { transform: scale(0.98); }

.up-card { padding: 4px 16px; margin-bottom: 12px; }
.up-i { width: 17px; height: 17px; vertical-align: -3px; margin-left: 2px; }
.txd-v--green .up-i { width: 20px; height: 20px; }

.up-txhead {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 18px 2px 10px;
  font-size: 1.15rem; font-weight: 700;
}
.up-txhead span:last-child { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; }

/* ---------- Ajouter de l'argent ---------- */
.add-screen { padding-left: 18px; padding-right: 18px; }
.add-head {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
}
.add-head .sheet-close { margin-left: -8px; }
.add-titles { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.add-title { font-size: 1.05rem; font-weight: 600; }
.add-balance { color: var(--text-muted); font-size: 0.85rem; }

.add-amount {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 40px 0 18px;
  font-size: 3.4rem; font-weight: 700; letter-spacing: -1px;
}
.add-caret {
  width: 3px; height: 50px;
  background: #21c25e;
  border-radius: 2px;
  animation: blink 1.1s steps(1) infinite;
}
.add-eur { font-weight: 700; }
@keyframes blink { 50% { opacity: 0; } }

.add-method {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: max-content; margin: 0 auto;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--surface-solid);
  font-weight: 600; font-size: 0.98rem;
}
.add-chev { color: var(--text-muted); }
.add-arrival { text-align: center; color: var(--text); font-weight: 600; margin: 16px 0 14px; font-size: 0.95rem; }
.add-arrival span { color: var(--text-muted); font-weight: 400; }

.apay-mark {
  width: 20px; height: 20px; flex-shrink: 0;
  background: #000; border-radius: 5px;
  display: inline-block; position: relative;
}
[data-theme="light"] .apay-mark { background: #000; }
.apay-mark::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 38%, #fff 1.4px, transparent 1.6px) no-repeat,
    radial-gradient(circle at 50% 62%, #fff 3px, transparent 3.2px) no-repeat;
}
.apay-mark--dark { background: #fff; }
.apay-mark--dark::after {
  background:
    radial-gradient(circle at 50% 38%, #000 1.4px, transparent 1.6px) no-repeat,
    radial-gradient(circle at 50% 62%, #000 3px, transparent 3.2px) no-repeat;
}
.apay-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%;
  padding: 17px;
  border: none; border-radius: 16px;
  background: #fff; color: #000;
  font-size: 1.4rem; font-weight: 600; font-family: var(--font);
  cursor: pointer;
}
.apay-btn:active { transform: scale(0.98); }

.calc-ops { display: flex; gap: 10px; margin: 18px 0 12px; }
.calc-op {
  flex: 1; height: 48px;
  border: none; border-radius: 26px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1.3rem; cursor: pointer;
}
.calc-op:active { background: var(--surface); }

.calc-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px 30px;
  text-align: center;
}
.calc-key {
  height: 56px;
  border: none; background: none;
  color: var(--text);
  font-size: 1.9rem; font-weight: 400; font-family: var(--font);
  cursor: pointer;
}
.calc-key:active { opacity: 0.5; }
.calc-key--del { font-size: 1.4rem; }

@keyframes txIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   BARRE DE NAVIGATION INFÉRIEURE
   ========================================================================= */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  padding: 10px 6px calc(8px + var(--safe-bottom));
  background: var(--surface-solid);
  border-top: 1px solid var(--border);
  /* effet verre dépoli */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 0.68rem; font-family: var(--font);
  transition: color var(--transition);
}
.tab-ic { width: 24px; height: 24px; }
.tab.active { color: var(--text); font-weight: 600; }
.tab:active { transform: scale(0.94); }

/* =========================================================================
   ANIMATIONS GÉNÉRIQUES
   ========================================================================= */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); }  to { opacity: 1; transform: translateY(0); } }

/* Respect de la préférence "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================================
   ÉCRANS PLUS LARGES (tablette / desktop) — on centre l'app
   ========================================================================= */
@media (min-width: 600px) {
  body { max-width: 440px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,0.25); }
  .tabbar { max-width: 440px; margin: 0 auto; }
}
