/* H-Pay — styles publics. Neutres, pour s'intégrer à n'importe quel thème. */

.hpay-fields { margin: 1em 0; }
.hpay-field { margin-bottom: 1em; }
.hpay-field__hint { display: block; font-size: .85em; opacity: .7; margin-top: .25em; }
.hpay-field__error { display: block; font-size: .85em; color: #b32d2e; margin-top: .25em; }
.hpay-phone--invalid { border-color: #b32d2e !important; }

.hpay-notice { padding: .75em 1em; border-radius: 4px; margin: 1em 0; }
.hpay-notice--error { background: #fcf0f1; border-left: 4px solid #b32d2e; }

.hpay-pending {
	border: 1px solid rgba(0,0,0,.1);
	border-radius: 8px;
	padding: 1.5em;
	margin: 1.5em 0;
	text-align: center;
}
.hpay-pending__title { margin: .5em 0; font-size: 1.15em; }
.hpay-pending__message { font-weight: 600; margin: .5em 0 1em; }
.hpay-pending__notice { font-size: .9em; opacity: .75; margin-top: 1em; }

.hpay-pending__details {
	list-style: none;
	margin: 1em auto;
	padding: 0;
	max-width: 24em;
	text-align: left;
}
.hpay-pending__details li {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: .4em 0;
	border-bottom: 1px solid rgba(0,0,0,.06);
}

.hpay-pending__spinner {
	width: 36px; height: 36px;
	margin: 0 auto;
	border: 3px solid rgba(0,0,0,.1);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: hpay-spin 1s linear infinite;
}
@keyframes hpay-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.hpay-pending__spinner { animation-duration: 3s; }
}

.hpay-pending--stalled { border-color: #dba617; }
.hpay-pending--success { border-color: #00a32a; }
.hpay-pending--failed  { border-color: #b32d2e; }

.hpay-result { padding: 1em 1.25em; border-radius: 8px; margin: 1.5em 0; }
.hpay-result--success { background: #edfaef; border-left: 4px solid #00a32a; }
.hpay-result--failed  { background: #fcf0f1; border-left: 4px solid #b32d2e; }
.hpay-result__reference { font-size: .9em; opacity: .75; margin: .5em 0 0; }

.hpay-form__amount { font-size: 1.05em; margin-bottom: 1em; }

/* ---------------------------------------------------------------------------
   Formulaire autonome (shortcode).

   Les champs utilisent les classes WooCommerce (form-row, input-text) pour que
   le même gabarit serve au checkout. Hors WooCommerce ces classes ne sont
   stylées par rien : ces règles comblent le vide.

   Scopé sous .hpay-form : dans le checkout WooCommerce, elles ne s'appliquent
   pas et c'est Woo qui garde la main sur la présentation.
   --------------------------------------------------------------------------- */

.hpay-form-wrapper {
	max-width: 30em;
	margin: 2em 0;
}

.hpay-form {
	border: 1px solid rgba( 0, 0, 0, .12 );
	border-radius: 10px;
	padding: 1.5em;
}

.hpay-form .hpay-field {
	display: flex;
	flex-direction: column;
	margin-bottom: 1.1em;
}

.hpay-form .hpay-field label {
	font-size: .9em;
	font-weight: 600;
	margin-bottom: .35em;
}

.hpay-form .hpay-field abbr.required {
	border: 0;
	text-decoration: none;
	color: #b32d2e;
	cursor: help;
}

.hpay-form .hpay-field input {
	width: 100%;
	box-sizing: border-box;
	padding: .6em .75em;
	border: 1px solid rgba( 0, 0, 0, .25 );
	border-radius: 6px;
	font-size: 1em;
	line-height: 1.3;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.hpay-form .hpay-field input:focus {
	outline: 0;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba( 34, 113, 177, .18 );
}

.hpay-form .hpay-field input.hpay-phone--invalid:focus {
	border-color: #b32d2e;
	box-shadow: 0 0 0 3px rgba( 179, 45, 46, .18 );
}

.hpay-form .hpay-field select {
	padding: .55em .6em;
	border: 1px solid rgba( 0, 0, 0, .25 );
	border-radius: 6px;
	font-size: 1em;
	background: #fff;
}

/* Prénom / Nom côte à côte, empilés sur mobile. */
.hpay-form .form-row-first,
.hpay-form .form-row-last {
	width: calc( 50% - .5em );
	display: inline-flex;
	vertical-align: top;
}

.hpay-form .form-row-first {
	margin-right: 1em;
}

@media ( max-width: 480px ) {
	.hpay-form .form-row-first,
	.hpay-form .form-row-last {
		width: 100%;
		margin-right: 0;
	}
}

.hpay-form .hpay-submit {
	display: block;
	width: 100%;
	padding: .8em 1em;
	border: 0;
	border-radius: 6px;
	background: #1d2939;
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: opacity .15s ease;
}

.hpay-form .hpay-submit:hover {
	opacity: .88;
}

.hpay-form .hpay-submit:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.hpay-form__amount {
	padding: .7em .9em;
	margin-bottom: 1.2em;
	background: rgba( 0, 0, 0, .04 );
	border-radius: 6px;
}
