/* SMS – Consentements : cases du checkout, messages d'erreur, case newsletter, modale, metabox. */

/* Cases du checkout ------------------------------------------------------ */
.woocommerce-checkout .sms-consent-waiver {
	margin-top: 0.75em;
}
.woocommerce-checkout .sms-consent-waiver .woocommerce-form__label-for-checkbox {
	display: inline-block;
}
.sms-consent-error {
	display: block;
	margin: 0.35em 0 0 0;
	color: #b32d2e;
	font-size: 0.9em;
	line-height: 1.4;
}
.sms-consent-error[hidden] {
	display: none;
}
.sms-consent-invalid .woocommerce-form__label-for-checkbox {
	display: inline-block;
	outline: 2px solid #b32d2e;
	outline-offset: 4px;
	border-radius: 2px;
}

/* Case newsletter (inscription, Détails du compte, profil admin, modale) ----
   Reprise du CSS de NL Opt-in : case blanche, contour noir, coche noire,
   insensible aux styles du thème (les !important sont volontaires). */
.sms-consent-checkbox,
.sms-consent-checkbox::before,
.sms-consent-checkbox::after,
.sms-consent-checkbox__box,
.sms-consent-checkbox__box::before,
.sms-consent-checkbox__box::after,
.sms-consent-checkbox__text {
	all: initial !important;
}
.sms-consent-checkbox {
	display: inline-flex !important;
	align-items: flex-start !important;
	gap: 0.5rem !important;
	cursor: pointer !important;
	font-family: inherit !important;
	font-size: inherit !important;
	line-height: 1.4 !important;
	color: inherit !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}
.sms-consent-checkbox:has(.sms-consent-checkbox__input:checked) {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	color: inherit !important;
}
.sms-consent-checkbox__text {
	display: inline-block !important;
	font-family: inherit !important;
	font-size: inherit !important;
	color: inherit !important;
}
.sms-consent-checkbox__text a {
	color: inherit;
	text-decoration: underline;
}
.sms-consent-checkbox__input {
	all: initial !important;
	position: absolute !important;
	opacity: 0 !important;
	width: 1.4em !important;
	height: 1.4em !important;
	margin: 0 !important;
}
.sms-consent-checkbox__input:focus-visible + .sms-consent-checkbox__box {
	outline: 2px solid rgba(0, 0, 0, 0.5) !important;
	outline-offset: 2px !important;
}
.sms-consent-checkbox__box {
	display: inline-block !important;
	flex: 0 0 auto !important;
	width: 1.2em !important;
	height: 1.2em !important;
	margin-top: 0.1em !important;
	box-sizing: border-box !important;
	background: #fff !important;
	border: 2px solid #000 !important;
	border-radius: 2px !important;
	vertical-align: middle !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: 85% 85% !important;
}
.sms-consent-checkbox__input:checked + .sms-consent-checkbox__box {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><polyline points="4,10 8,14 16,6" stroke="%23000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>') !important;
}
.sms-consent-checkbox::before,
.sms-consent-checkbox::after,
.sms-consent-checkbox__text::before,
.sms-consent-checkbox__text::after,
.sms-consent-checkbox__box::before,
.sms-consent-checkbox__box::after {
	content: none !important;
	display: none !important;
}
.sms-consent-account legend {
	margin-top: 1em;
}

/* Colonne Newsletter (liste des utilisateurs) ---------------------------- */
.sms-consent-nl--yes {
	color: #007017;
	font-weight: 600;
}
.sms-consent-nl--unknown {
	color: #757575;
}

/* Modale newsletter (page Commande reçue) --------------------------------- */
.sms-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	font-size: 1rem;
	line-height: 1.5;
}
.sms-consent-modal[hidden] {
	display: none;
}
.sms-consent-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}
.sms-consent-modal__panel {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 32rem;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	padding: 2rem 2rem 1.5rem;
	background: #fff;
	color: #1d1d1d;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.sms-consent-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: #1d1d1d;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}
.sms-consent-modal__close:hover,
.sms-consent-modal__close:focus-visible {
	background: #f0f0f0;
	outline: 2px solid #1d1d1d;
}
.sms-consent-modal__title {
	margin: 0 2rem 0.75rem 0;
	font-size: 1.4rem;
	line-height: 1.3;
}
.sms-consent-modal__text {
	margin: 0 0 1rem;
}
.sms-consent-modal__optin {
	margin: 0 0 1.25rem;
}
.sms-consent-modal__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}
.sms-consent-modal__accept,
.sms-consent-modal__decline {
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
}
.sms-consent-modal__accept[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}
/* « Non merci » : bouton présenté comme un lien, même taille que le bouton d'acceptation, contraste > 4.5:1 */
.sms-consent-modal__decline {
	padding: 0.5em 0;
	border: 0;
	background: transparent;
	color: #1d1d1d;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
.sms-consent-modal__decline:hover,
.sms-consent-modal__decline:focus-visible {
	color: #000;
	outline: 2px solid #1d1d1d;
	outline-offset: 2px;
}
.sms-consent-modal__thanks {
	margin: 0;
	font-weight: 600;
}
body.sms-consent-modal-open {
	overflow: hidden;
}

/* Administration : aperçu, journal, metabox --------------------------------- */
.sms-consent-preview {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1.5rem;
	max-width: 1100px;
	margin: 0.5rem 0 1.5rem;
}
.sms-consent-preview__block {
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}
.sms-consent-preview__block h3 {
	margin: 0 0 0.75rem;
}
.sms-consent-preview .form-row {
	margin: 0 0 0.75rem;
}
.sms-consent-preview .sms-consent-error {
	margin-left: 1.6em;
}
.sms-consent-modal--preview {
	position: static;
	display: block;
	padding: 0;
	background: #f0f0f1;
	border-radius: 6px;
}
.sms-consent-modal--preview .sms-consent-modal__panel {
	max-height: none;
	margin: 1rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.sms-consent-modal--preview .sms-consent-modal__thanks {
	margin-top: 1rem;
	color: #757575;
}
.sms-consent-tools .sms-consent-count {
	margin-left: 0.75rem;
	font-weight: 600;
}
.sms-consent-log td {
	vertical-align: top;
	max-width: 320px;
	overflow-wrap: anywhere;
}
.sms-consent-metabox p {
	margin: 0 0 0.6em;
}
.sms-consent-metabox pre {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	padding: 0.5em;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	font-size: 11px;
}
.sms-consent-metabox details {
	margin: 0 0 0.6em;
}
.sms-consent-metabox summary {
	cursor: pointer;
	color: #2271b1;
}
