/* ============================================================
   KASPANOVA CHECKOUT CARD — VERSION FINALE ULTIME (COMPACT SAFE)
   - Même style / mêmes couleurs / mêmes images
   - ~25-30% plus compact (mobile + desktop)
   - Zéro composant perdu
============================================================ */

/* ------------------------
   Card wrapper — inchangé (look premium)
------------------------- */
.checkout-card {
  width: 100%;
  max-width: 400px;
  padding: 1px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(122,61,241,0.45), transparent 55%),
    radial-gradient(circle at bottom right, rgba(112,199,186,0.35), transparent 55%);
  box-shadow:
    0 0 45px rgba(122,61,241,0.35),
    0 28px 55px rgba(0,0,0,0.65);
  box-sizing: border-box;
  overflow: hidden;
}

/* ===============================
   CHECKOUT — CANONICAL SIZE
=============================== */

.checkout-card {
  width: 360px;
  max-width: 360px;
  margin: 0 auto;
}

/* ------------------------
   Inner — COMPRESS (padding réduit)
------------------------- */
.checkout-inner {
  border-radius: 24px;
  padding: 6px 12px 12px; 
  background: linear-gradient(180deg, rgba(22,27,34,0.98), rgba(13,17,23,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ------------------------
   Header — léger compact, aucune couleur touchée
------------------------- */
.checkout-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 3px; /* avant 4 */
  margin-bottom: 0;
}

.checkout-header > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px; /* avant 3 */
}

.checkout-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px; /* avant 8 */
}

.checkout-logo {
  height: 28px; /* inchangé => pas de problème de logo */
}

.checkout-title {
  font-size: 0.96rem; /* avant 1rem */
  font-weight: 600;
}

.checkout-origin {
  font-size: 0.66rem;
  color: #9ca3af;
  margin-top: 0;
  margin-bottom: 2px;
}

.checkout-origin strong {
  color: #70c7ba;
  font-weight: 600;
}


/* ------------------------
   KasWare connected pill — compact sans casser
------------------------- */
#kaswareState.kasware-slot,
#kaswareState {
  height: 32px;      /* avant 36 */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 3px 0;     /* avant 4px 0 */
}

.kn-wallet-pill {
  width: 100%;
  max-width: min(320px, 100%);
  height: 26px;      /* avant 28 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.70rem; /* avant 0.72 */
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.kn-wallet-pill.connected {
  opacity: 1;
  pointer-events: auto;
  color: #70c7ba;
  background: rgba(112,199,186,0.18);
  border: 1px solid rgba(112,199,186,0.45);
}

.kn-wallet-pill .wallet-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------
   Pills (timer + status) — compact SAFE
------------------------- */
.checkout-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-self: end;
  flex-wrap: nowrap;
}

.kn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;    /* avant 4px 9px */
  border-radius: 999px;
  font-size: 0.66rem;  /* avant 0.7rem */
  font-weight: 600;
  border: 1px solid rgba(148,163,184,0.35);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kn-pill i {
  width: 14px;
  height: 14px;
}

.kn-pill-timer { color: #9ca3af; background: rgba(148,163,184,0.12); }
.kn-pill-pending { color: #facc15; background: rgba(250,204,21,0.18); border-color: rgba(250,204,21,0.35); }
.kn-pill-confirmed { color: #70c7ba; background: rgba(112,199,186,0.18); border-color: rgba(112,199,186,0.45); }
.kn-pill-expired { color: #f87171; background: rgba(248,113,113,0.18); border-color: rgba(248,113,113,0.45); }

/* ------------------------
   Invoice box — compact sans changer style
------------------------- */
.checkout-invoice {
  margin: 0 0 6px;
  padding: 5px 8px;          
  border-radius: 14px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(112,199,186,0.25);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.25),
    inset 0 1px 2px rgba(112,199,186,0.12);
  display: grid;
  gap: 2px;                  
  text-align: center;
}


.checkout-invoice span {
  font-size: 0.68rem; /* avant 0.71 */
  color: #9ca3af;
  display: block;
}

.checkout-invoice strong {
  font-size: 0.88rem; /* avant 0.93 */
  font-weight: 700;
  color: #70c7ba;
  display: block;
  margin-top: 0; /* avant 1px */
}
/* ============================================================
   QR CODE — CENTERED & VISUALLY PERFECT
============================================================ */

.checkout-qr {
  position: relative;
  width: 148px;
  height: 148px;

  padding: 6px;
  box-sizing: border-box;

  margin: 10px auto 12px;   /* 🔥 CENTRAGE HORIZONTAL */

  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(22,27,34,0.98),
    rgba(13,17,23,0.98)
  );

  display: flex;            /* 🔥 CENTRAGE INTERNE */
  align-items: center;
  justify-content: center;

  overflow: hidden;

  box-shadow:
    0 0 30px rgba(112,199,186,0.40),
    0 0 60px rgba(112,199,186,0.25),
    0 0 90px rgba(112,199,186,0.15),
    0 8px 25px rgba(0,0,0,0.40);
}

/* ------------------------
   Amount — compact sans casser icon
------------------------- */
.checkout-amount {
  text-align: center;
  margin: 2px 0 8px; /* avant 4px 0 10px */
}

.checkout-amount-kas {
  font-size: 1.38rem; /* avant 1.55 */
  font-weight: 700;
  color: #70c7ba;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px; /* avant 8 */
}

.checkout-amount-kas img {
  height: 22px; /* inchangé */
}

.checkout-amount-fiat {
  font-size: 0.76rem; /* avant 0.82 */
  color: #9ca3af;
  margin-top: 3px; /* avant 4 */
}

/* ------------------------
   Labels + copy fields — compact sans briser
------------------------- */
.checkout-label {
  font-size: 0.74rem;    /* avant 0.76 */
  color: #9ca3af;
  margin: 8px 0 3px;     /* avant 10px 0 4px */
}

.checkout-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;      /* avant 8px 10px */
  border-radius: 12px;
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(255,255,255,0.08);
}

.checkout-copy input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e6e6e6;
  font-size: 0.78rem; /* avant 0.8 */
}

.checkout-copy button {
  border: none;
  border-radius: 8px;
  padding: 6px 10px; /* inchangé (tap target OK) */
  font-size: 0.7rem;
  cursor: pointer;
  background: rgba(148,163,184,0.18);
  color: #e6e6e6;
  transition: background 0.15s ease;
}

.checkout-copy button:hover {
  background: rgba(148,163,184,0.30);
}

/* ------------------------
   Buttons KasWare — ON NE TOUCHE PAS AUX COULEURS
   (juste un peu moins haut)
------------------------- */
#btnKaswareConnect,
#btnKaswarePay {
  width: 100%;
  height: 42px;        /* avant 46px */
  border-radius: 14px;
  border: none;
  font-size: 0.88rem;  /* avant 0.9rem */
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Couleurs inchangées */
#btnKaswareConnect {
  background: linear-gradient(135deg, #70C7BA, #4ade80);
  color: #020617;
}

#btnKaswareConnect img {
  height: 26px; /* inchangé */
  width: auto;  /* FIX cadrage stable */
  object-fit: contain;
  filter: brightness(0) invert(1); /* inchangé */
}

#btnKaswareConnect:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 20px rgba(112,199,186,0.6);
  transform: translateY(-1px);
}

#btnKaswarePay {
  background: linear-gradient(135deg, #7A3DF1, #A78BFA);
  color: #ffffff;
}

#btnKaswarePay:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 20px rgba(122,61,241,0.6);
  transform: translateY(-1px);
}

#btnKaswareConnect:disabled,
#btnKaswarePay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------
   Footer logo — reuse existing footer rules
------------------------- */

.checkout-footer .footer-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.checkout-footer .footer-powered {
  gap: 6px;
}

.checkout-footer .footer-logo {
  max-height: 20px;     /* 🔒 hauteur contrôlée */
  width: auto;
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  opacity: 0.9;
}


/* ------------------------
   Overlays — inchangés (critical)
------------------------- */
.payment-confirmed-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.96);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  pointer-events: all;
  animation: overlayPop 0.35s ease-out both;
}
@keyframes overlayPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirmed-inner {
  text-align: center;
  color: #70c7ba;
}

.confirmed-inner i { width: 64px; height: 64px; }

.confirmed-title {
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 700;
}

.payment-expired-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.expired-card {
  width: 100%;
  max-width: 320px;
  padding: 26px 22px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(22,27,34,0.95), rgba(13,17,23,0.95));
  border: 1px solid rgba(248,113,113,0.45);
  box-shadow: 0 25px 60px rgba(0,0,0,0.7);
}

.expired-icon svg {
  width: 52px;
  height: 52px;
  color: #f87171;
}

.expired-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f87171;
  margin: 10px 0 6px;
}

.expired-text {
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.45;
  margin-bottom: 20px;
}

.expired-actions button {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(248,113,113,0.18);
  color: #fecaca;
  border: 1px solid rgba(248,113,113,0.45);
  font-weight: 600;
}

.expired-actions button:hover {
  background: rgba(248,113,113,0.28);
}
/* ============================================================
   INVOICE — VERTICAL COMPRESSION (NO VISUAL LOSS)
============================================================ */

.checkout-invoice {
  padding: 6px 10px;          /* avant 7–9px */
  gap: 2px;                   /* avant 3–4 */
}

/* Chaque bloc (Total / Exact) */
.checkout-invoice > div {
  line-height: 1.1;           /* CRUCIAL */
}

/* Label */
.checkout-invoice span {
  font-size: 0.66rem;
  line-height: 1.05;
  margin-bottom: 1px;
}

/* Value */
.checkout-invoice strong {
  font-size: 0.86rem;
  line-height: 1.1;
  margin: 0;
}

/* Neutralise l'effet du <br> sans casser le HTML */
.checkout-invoice br {
  display: none;
}

/* ------------------------
   Invoice confirmation progress
------------------------- */

.invoice-progress {
  margin: 1px 0 3px;
  padding: 0 4px;
}

.invoice-progress .kn-progress-track {
  height: 5px; /* plus fin que l’ancienne */
  border-radius: 999px;
  background: rgba(122,61,241,0.20);
}

.invoice-progress .kn-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7A3DF1, #A78BFA);
  transition: width 0.35s ease;
}
/* ------------------------
   Confirmations header (pill style)
------------------------- */
.invoice-confirmations {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 10px;

  background: linear-gradient(
    135deg,
    rgba(122,61,241,0.28),
    rgba(167,139,250,0.22)
  );

  border: 1px solid rgba(122,61,241,0.45);
  font-size: 0.64rem;
}

/* Left side */
.confirm-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c4b5fd;
  font-weight: 600;
}

/* Right counter */
.confirm-right {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.confirm-right span:first-child {
  color: #a78bfa;
}

.confirm-sep {
  opacity: 0.6;
}


.confirm-pill {
  background: linear-gradient(
    135deg,
    rgba(122,61,241,0.30),
    rgba(167,139,250,0.25)
  );
}
/* ============================================================
   SNAP CONFIRMATION ANIMATION
============================================================ */

.checkout-card.snap-confirm {
  animation: kaspaSnap 0.38s cubic-bezier(.2,1.4,.3,1) forwards;
}

@keyframes kaspaSnap {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(112,199,186,0);
  }
  45% {
    transform: scale(1.035);
    box-shadow:
      0 0 32px rgba(112,199,186,0.6),
      0 0 64px rgba(122,61,241,0.35);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 22px rgba(112,199,186,0.45),
      0 0 40px rgba(122,61,241,0.25);
  }
}
/* ============================================================
   DEMO ONLY — Constrain overlays to checkout card
   (No impact on production checkout)
============================================================ */

.checkout-demo {
  position: relative;
}

.checkout-demo .payment-confirmed-overlay,
.checkout-demo .payment-expired-overlay {
  position: absolute;   /* override fixed */
  inset: 0;
  z-index: 20;          /* sous navbar, au-dessus carte */
  border-radius: 26px;
  pointer-events: none; /* laisse voir le contenu */
}
/* ===============================
   KasWare pill — states FINAL
================================ */

.kn-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* Connected */
.kn-wallet-pill.connected {
  background: rgba(112,199,186,0.18);
  color: #70c7ba;
  border: 1px solid rgba(112,199,186,0.45);
}

/* Confirmed */
.kn-wallet-pill.confirmed {
  background: rgba(34,197,94,0.22);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.55);
}

/* ============================================================
   FOOTER POWERED — HARD OVERRIDE (NO TYPO / NO RESET)
============================================================ */

.checkout-footer {
  margin-top: 10px;
  padding-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.checkout-footer .footer-powered {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  /* PAS de height/min-height ici */
}

.checkout-footer .footer-powered img {
  height: 52px;               
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  opacity: 0.9;
}

/* Mobile — ajuste seulement l’image */
@media (max-width: 420px) {
  .checkout-footer .footer-powered img {
    height: 28px;             /* ou 30px, teste */
  }
}

/* ============================================================
   CHECKOUT TITLE — THEME SAFE (FINAL)
============================================================ */

.checkout-title,
.checkout-title a {
  color: #ffffff;
}

.theme-light .checkout-title,
.theme-light .checkout-title a {
  color: #020617 !important; /* noir lisible sur fond clair */
}
