/* Atea Whop Gateway — modal de paiement Embedded */
body.awg-modal-open { overflow: hidden; }

#awg-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba( 15, 18, 25, 0.62 );
	backdrop-filter: blur( 2px );
}

.awg-modal__card {
	width: 100%;
	max-width: 520px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba( 0, 0, 0, 0.35 );
	overflow: hidden;
}

.awg-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #eceff3;
	font-weight: 600;
	font-size: 15px;
}

.awg-modal__close {
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0 4px;
}
.awg-modal__close:hover { color: #111827; }

.awg-modal__body {
	position: relative;
	overflow-y: auto;
	min-height: 320px;
	padding: 8px;
}

#awg-mount iframe {
	width: 100% !important;
	border: 0;
	min-height: 480px;
}

.awg-modal__skeleton {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 300px;
	color: #4b5563;
	font-size: 14px;
	text-align: center;
	padding: 12px;
}

.awg-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #e5e7eb;
	border-top-color: #111827;
	border-radius: 50%;
	animation: awg-spin 0.8s linear infinite;
}
@keyframes awg-spin { to { transform: rotate( 360deg ); } }

.awg-error { color: #b91c1c; font-weight: 600; }

.awg-fallback-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 8px;
	background: #111827;
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
}
.awg-fallback-btn:hover { background: #1f2937; }

/* Rangée de logos de cartes (réassurance) */
.awg-card-logos { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; }
.awg-card-logos svg { height: 26px; width: auto; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* Secours 3DS : bascule vers la page hébergée */
.awg-rescue { margin-top: 12px; padding: 12px 14px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; text-align: center; font-size: 14px; }
.awg-rescue p { margin: 0 0 8px; }

/* Overlay du challenge 3DS (relais request-requirement-overlay) */
#awg-req-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(15, 15, 15, .6); display: flex; align-items: center; justify-content: center; }
#awg-req-overlay .awg-req-frame { width: min(480px, 94vw); height: min(680px, 92vh); background: #fff; border: 0; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
#awg-req-overlay .awg-req-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 22px; line-height: 1; cursor: pointer; }

/* Bascule vers la page hébergée (secours 3DS immédiat) */
.awg-handoff { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 24px; text-align: center; }
.awg-handoff__spin { width: 34px; height: 34px; border: 3px solid #e5e7eb; border-top-color: #eb8254; border-radius: 50%; animation: awg-spin 0.8s linear infinite; }
@keyframes awg-spin { to { transform: rotate(360deg); } }
.awg-fallback-btn { display: inline-block; padding: 12px 20px; background: #eb8254; color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; }

/* Panneau de diagnostic (mode debug) */
.awg-debug { padding: 8px 4px; }
.awg-debug h3 { margin: 0 0 6px; }
.awg-debug__reason { color: #b45309; font-size: 13px; margin: 0 0 10px; }
.awg-debug__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.awg-debug__actions .button { padding: 8px 14px; border-radius: 6px; border: 1px solid #cbd5e1; background: #f8fafc; cursor: pointer; }
.awg-debug__pre { max-height: 320px; overflow: auto; background: #0f172a; color: #a7f3d0; font: 10px/1.45 monospace; padding: 10px; border-radius: 8px; white-space: pre-wrap; }

/* Bouton diagnostic + toast de secours au-dessus du challenge */
.awg-modal__debug { border: 0; background: transparent; font-size: 18px; cursor: pointer; margin-right: 4px; }
#awg-toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2147483600; background: #fff7ed; border: 1px solid #fdba74; border-radius: 10px; padding: 10px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#awg-toast a { font-weight: 700; color: #c2410c; }

/* Mode challenge : le modal s'ouvre en grand pour l'étape bancaire */
.awg-modal__card { transition: width .28s ease, max-width .28s ease; }
#awg-modal.awg-modal--challenge .awg-modal__card { width: min(880px, 97vw) !important; max-width: 97vw !important; }
#awg-modal.awg-modal--challenge .awg-modal__body { padding: 0; }
