:root {
  --primary: #0b5ed7;
  --primary-dark: #073b8a;
  --accent: #ffb703;
  --bg: #f2f4f7;
  --card-bg: #ffffff;
  --text: #1c2430;
  --text-muted: #6b7684;
  --border: #e3e7ee;
  --success: #1aa260;
  --danger: #e2483d;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 30, 60, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Site responsive : plein écran sur mobile, carte centrée sur desktop */
.app-shell {
  min-height: 100vh;
}

.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  background: var(--card-bg);
  animation: fadeIn 0.25s ease;
}
.screen.active { display: flex; }

/* A partir des tablettes/ordinateurs : présentation en carte centrée,
   comme la plupart des espaces bancaires en ligne (Revolut, N26, etc.) */
@media (min-width: 640px) {
  body { background: #e7eaf0; }
  .app-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 64px 24px;
  }
  .screen.active {
    max-width: 420px;
    width: 100%;
    min-height: 740px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(15, 30, 60, 0.14);
    overflow: hidden;
  }
}

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

.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 18px 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header .logo { height: 34px; display: block; }

.header.with-back { padding-top: 14px; }

.back-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-btn:active { background: rgba(255,255,255,0.3); }

.header-title {
  font-size: 17px;
  font-weight: 600;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.content::-webkit-scrollbar { width: 0; }

/* ---------- Login ---------- */
.login-screen .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 40px 24px;
}
.login-logo-big { height: 64px; margin-bottom: 6px; }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-top: -8px; }

.field {
  width: 100%;
  text-align: left;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  background: #fafbfc;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #eef1f6; color: var(--text); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-link { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; }

.bio-btn {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.bio-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* ---------- Home ---------- */
.greeting { font-size: 14px; opacity: 0.9; }
.greeting-name { font-size: 19px; font-weight: 700; margin-top: 2px; }
.header-icons { margin-left: auto; display: flex; gap: 14px; font-size: 18px; }

.account-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin: -34px 4px 18px;
  box-shadow: var(--shadow);
}
.account-card .label { font-size: 12px; opacity: 0.85; }
.account-card .balance { font-size: 28px; font-weight: 700; margin: 4px 0 10px; }
.account-card .iban { font-size: 12px; opacity: 0.85; letter-spacing: 0.5px; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.quick-action {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}
.quick-action .qa-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 6px;
}
.quick-action:active { background: #f0f3f9; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 10px;
  color: var(--text);
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #eef1f6;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 14px; font-weight: 600; }
.tx-date { font-size: 12px; color: var(--text-muted); }
.tx-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.tx-amount.neg { color: var(--danger); }
.tx-amount.pos { color: var(--success); }

/* ---------- Beneficiary list ---------- */
.ben-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.ben-item.selected { border-color: var(--primary); background: #eef4ff; }
.ben-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.ben-info { flex: 1; min-width: 0; }
.ben-name { font-size: 14.5px; font-weight: 700; }
.ben-rib { font-size: 12px; color: var(--text-muted); }
.ben-bank { font-size: 11.5px; color: var(--text-muted); }

.add-ben-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1.5px dashed var(--primary);
  border-radius: 14px;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  background: #f5f9ff;
  margin-bottom: 6px;
}

/* ---------- Amount ---------- */
.amount-display {
  text-align: center;
  padding: 24px 0 8px;
}
.amount-input {
  font-size: 42px;
  font-weight: 800;
  border: none;
  background: none;
  text-align: center;
  width: 100%;
  color: var(--text);
  outline: none;
}
.amount-currency { font-size: 16px; color: var(--text-muted); font-weight: 600; }

.info-banner {
  background: #fff7e6;
  border: 1px solid #ffe1a8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #8a5a00;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}

/* ---------- Recap ---------- */
.recap-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
}
.recap-row:last-child { border-bottom: none; }
.recap-label { color: var(--text-muted); }
.recap-value { font-weight: 700; text-align: right; }
.recap-total {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
}

/* ---------- OTP ---------- */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 8px;
}
.otp-box {
  width: 44px; height: 54px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: #fafbfc;
}
.otp-box:focus { border-color: var(--primary); outline: none; background: #fff; }
.otp-timer { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
/* ---------- Type de virement (segmented control) ---------- */
.segmented {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.seg-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.seg-btn + .seg-btn { border-left: 1.5px solid var(--border); }
.seg-btn.active { background: var(--primary); color: #fff; }
.seg-btn.seg-disabled {
  background: #f2f3f5;
  color: #aab1bb;
  cursor: not-allowed;
}
.seg-lock { font-size: 11px; }

/* ---------- Elements non disponibles dans cette version ---------- */
.quick-action.disabled,
.nav-item.disabled {
  opacity: 0.4;
  cursor: default;
}
.icon-inert { opacity: 0.85; cursor: default; }

/* ---------- Notifications internes (remplacent les alert()) ---------- */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1c2430;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }

/* ---------- Loading ---------- */
.loading-screen .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.spinner {
  width: 52px; height: 52px;
  border: 5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.success-screen .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 30px;
}
.success-check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 42px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  animation: pop 0.35s ease;
}
@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.success-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.success-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 20px; }
.receipt-card {
  width: 100%;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  margin-bottom: 20px;
}
.success-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.bottom-nav {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  padding: 10px 0 14px;
  background: #fff;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.nav-item.active { color: var(--primary); font-weight: 700; }
.nav-item .nav-icon { font-size: 19px; }

.hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* ---------- Page Admin (hors cadre téléphone) ---------- */
.admin-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.admin-header a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.admin-title { font-size: 20px; font-weight: 800; margin: 0; }
.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.admin-card h2 {
  font-size: 15px;
  margin: 0 0 14px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.color-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.color-field input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fafbfc;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.preset-btn:hover { border-color: var(--primary); }
.preset-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
}
.logo-preview-box img {
  max-height: 44px;
  max-width: 140px;
  background: #22252b;
  padding: 6px 10px;
  border-radius: 8px;
}
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 14px 0 0;
  display: flex;
  gap: 10px;
}
.save-msg {
  text-align: center;
  font-size: 13px;
  color: var(--success);
  font-weight: 700;
  margin-top: 10px;
  display: none;
}
.disclaimer {
  font-size: 11.5px;
  color: var(--text-muted);
  background: #fff7e6;
  border: 1px solid #ffe1a8;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

