/* ===== IFH PAYMENT SYSTEM ===== */

/* Overlay */
.pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 40, 0.78);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.28s ease;
  backdrop-filter: blur(5px);
}
.pay-overlay.visible { opacity: 1; }

/* Modal — layout côte à côte */
.pay-modal {
  background: #fff;
  width: 96vw;
  max-width: 820px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  position: relative;
  border-radius: 20px;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: 0 40px 100px rgba(5,15,40,0.4);
}
.pay-overlay.visible .pay-modal {
  transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════
   PANNEAU GAUCHE — Résumé commande
═══════════════════════════════════════ */
.pay-header {
  width: 38%;
  flex-shrink: 0;
  background: linear-gradient(160deg, #00375A 0%, #006BA3 55%, #0092D5 100%);
  padding: 28px 26px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
}

/* Symbole IF décoratif */
.pay-header::before {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -20px;
  width: 160px;
  height: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 200'%3E%3Crect x='5' y='5' width='24' height='82' rx='3' fill='white' opacity='0.15'/%3E%3Crect x='53' y='52' width='24' height='98' rx='3' fill='white' opacity='0.15'/%3E%3Crect x='101' y='24' width='24' height='62' rx='3' fill='white' opacity='0.15'/%3E%3Crect x='22' y='130' width='24' height='58' rx='3' fill='white' opacity='0.15'/%3E%3Crect x='80' y='148' width='24' height='46' rx='3' fill='white' opacity='0.15'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.pay-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.pay-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pay-logo-mark {
  border: 2px solid rgba(255,255,255,0.5);
  padding: 5px 8px;
  line-height: 1.1;
}
.pay-logo-mark span {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
.pay-logo-mark .pay-logo-pays {
  font-size: 7px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}
.pay-close {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
  flex-shrink: 0;
}
.pay-close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Résumé commande */
.pay-order-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pay-order-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.pay-order-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.25;
}
.pay-order-desc {
  font-size: 12px;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  margin-bottom: 24px;
}
.pay-order-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
}
.pay-amount-value {
  font-size: 32px;
  font-weight: 900;
  color: #FFE552;
  letter-spacing: -0.5px;
}
.pay-amount-currency {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}

/* Badge sécurisé (bas gauche) */
.pay-secure-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-top: 24px;
}
.pay-secure-left i { font-size: 10px; color: rgba(255,255,255,0.4); }

/* ═══════════════════════════════════════
   PANNEAU DROIT — Étapes
═══════════════════════════════════════ */
.pay-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
}

/* Steps indicator */
.pay-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.pay-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #E8EEF6;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  flex-shrink: 0;
  transition: all 0.3s;
}
.pay-step-dot.active {
  border-color: #0092D5;
  background: #0092D5;
  color: #fff;
}
.pay-step-dot.done {
  border-color: #21AB88;
  background: #21AB88;
  color: #fff;
}
.pay-step-line {
  flex: 1;
  height: 2px;
  background: #E8EEF6;
  transition: background 0.3s;
}
.pay-step-line.done { background: #21AB88; }

/* Step panels */
.pay-step-panel { display: none; }
.pay-step-panel.active { display: block; animation: payFadeIn 0.25s ease; }
@keyframes payFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pay-step-title {
  font-size: 17px;
  font-weight: 800;
  color: #0D1A3A;
  margin-bottom: 4px;
}
.pay-step-sub {
  font-size: 12px;
  font-weight: 300;
  color: #94A3B8;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Method cards */
.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.pay-method-card {
  border: 2px solid #E8EEF6;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  border-radius: 10px;
}
.pay-method-card:hover {
  border-color: #0092D5;
  background: #F0F8FF;
}
.pay-method-card.selected {
  border-color: #0092D5;
  background: #EBF4FC;
}
.pay-method-card.selected::after {
  content: '\2713';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: #0092D5;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-method-logo {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}
.pay-method-logo svg { width: 48px; height: 48px; }
.pay-method-logo.moncash { border-radius: 50%; background: transparent; }
.pay-method-logo.natcash { border-radius: 10px; background: transparent; }
.pay-method-logo.paypal  { border-radius: 8px; background: #fff; border: 1.5px solid #E8EEF6; }
.pay-method-info { flex: 1; }
.pay-method-name {
  font-size: 14px;
  font-weight: 700;
  color: #0D1A3A;
  margin-bottom: 2px;
}
.pay-method-desc {
  font-size: 11px;
  font-weight: 300;
  color: #888;
}
.pay-method-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 4px;
  display: inline-block;
}
.badge-local { background: #E8F5E9; color: #2E7D32; }
.badge-intl  { background: #E3F2FD; color: #1565C0; }

/* Form inputs */
.pay-form-group { margin-bottom: 16px; }
.pay-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 7px;
}
.pay-phone-wrap {
  display: flex;
  border: 1.5px solid #E8EEF6;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.pay-phone-wrap:focus-within { border-color: #0092D5; }
.pay-phone-prefix {
  background: #F7F9FC;
  border-right: 1.5px solid #E8EEF6;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #555;
  white-space: nowrap;
}
.pay-phone-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-family: var(--corps);
  font-size: 14px;
  color: #333;
  background: #fff;
}
.pay-form-hint {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 5px;
}

/* PayPal */
.pay-paypal-info {
  background: #F7F9FC;
  border: 1.5px solid #E8EEF6;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.pay-paypal-logo { margin-bottom: 12px; display: flex; justify-content: center; }
.pay-paypal-logo svg { width: 90px; height: 90px; }
.pay-paypal-desc { font-size: 13px; color: #666; line-height: 1.6; }

/* Buttons */
.pay-btn {
  width: 100%;
  padding: 15px;
  font-family: var(--corps);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
}
.pay-btn-primary { background: #0092D5; color: #fff; }
.pay-btn-primary:hover { background: #006BA3; }
.pay-btn-primary:disabled { background: #CBD5E1; cursor: not-allowed; }
.pay-btn-paypal { background: #FFC439; color: #003087; }
.pay-btn-paypal:hover { background: #FFB300; }
.pay-btn-back {
  background: transparent;
  color: #94A3B8;
  border: 1.5px solid #E8EEF6;
  margin-top: 10px;
  font-size: 13px;
}
.pay-btn-back:hover { border-color: #CBD5E1; color: #555; background: #F7F9FC; }

/* Secure badge (right panel) */
.pay-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F0F4F8;
}
.pay-secure::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  content: '\f023';
  font-size: 11px;
  color: #94A3B8;
}

/* Processing */
.pay-processing { text-align: center; padding: 24px 0 8px; }
.pay-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #E8EEF6;
  border-top-color: #0092D5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-processing-title { font-size: 17px; font-weight: 700; color: #0D1A3A; margin-bottom: 8px; }
.pay-processing-sub { font-size: 13px; font-weight: 300; color: #888; line-height: 1.6; }
.pay-processing-phone {
  display: inline-block;
  background: #EBF4FC;
  color: #0092D5;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin: 8px 0;
}
.pay-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* Success */
.pay-success { text-align: center; padding: 12px 0; }
.pay-success-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #21AB88, #189A77);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.pay-success-title { font-size: 22px; font-weight: 800; color: #0D1A3A; margin-bottom: 8px; }
.pay-success-desc {
  font-size: 14px;
  font-weight: 300;
  color: #666;
  line-height: 1.7;
  margin-bottom: 20px;
}
.pay-success-ref {
  display: inline-block;
  background: #F7F9FC;
  border: 1px solid #E8EEF6;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 13px;
  color: #555;
  margin-bottom: 24px;
}
.pay-success-ref strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #006BA3;
  letter-spacing: 3px;
  margin-top: 4px;
}
.pay-btn-done { background: #21AB88; color: #fff; }
.pay-btn-done:hover { background: #189A77; }

/* ═══════════════════════════════════════
   RESPONSIVE MOBILE
═══════════════════════════════════════ */
@media (max-width: 620px) {
  .pay-modal { flex-direction: column; max-height: 95vh; border-radius: 16px; }
  .pay-header {
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px 18px;
  }
  .pay-header-top { margin-bottom: 16px; }
  .pay-order-summary { flex-direction: row; align-items: center; gap: 16px; }
  .pay-order-amount { margin-top: 0; flex-direction: column; gap: 0; padding: 10px 14px; }
  .pay-amount-value { font-size: 24px; }
  .pay-secure-left { display: none; }
  .pay-body { padding: 20px; }
}
