/* Demandes de rappel : fenêtre (fiches formation) et page Contact.
   Champs en pilule crème (comme la recherche), choix en puces, bouton rouge
   du site. Jetons du thème : --marine, --rouge, --rose, --creme, --blanc. */

/* --- Fenêtre ------------------------------------------------------------- */
.cci-rappel--fenetre {
	width: min(44rem, calc(100% - 2rem));
	max-width: none;
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--r-xl, 2rem);
	background: var(--blanc, #fff);
	color: var(--marine, #11314b);
	overflow: auto;
	overscroll-behavior: contain;
	box-shadow: 0 2rem 4rem rgba(14, 33, 51, 0.25);
}

.cci-rappel--fenetre::backdrop {
	background: rgba(14, 33, 51, 0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.cci-rappel__panneau {
	position: relative;
	padding: clamp(1.75rem, 1rem + 2.5vw, 3rem);
}

.cci-rappel__titre {
	margin: 0.4rem 0 0;
	font-size: var(--fs-2xl, 2.5rem);
	font-weight: var(--fw-semibold, 600);
	line-height: 1.1;
	--hl-bg: var(--rose, #fdc9d8);
	--hl-fg: var(--rouge, #e50043);
}

.cci-rappel__formation {
	display: inline-block;
	margin: 1rem 0 0;
	padding: 0.45rem 0.9rem;
	border-radius: var(--r-pill, 999px);
	background: var(--creme, #f6f4ef);
	font-size: var(--fs-sm, 0.9375rem);
	font-weight: var(--fw-medium, 500);
	line-height: 1.3;
}

.cci-rappel__fermer {
	position: absolute;
	top: clamp(1rem, 0.6rem + 1vw, 1.5rem);
	right: clamp(1rem, 0.6rem + 1vw, 1.5rem);
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1.5px solid var(--marine, #11314b);
	border-radius: 50%;
	background: var(--blanc, #fff);
	color: var(--marine, #11314b);
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.cci-rappel__fermer .icon {
	width: 1.1rem;
	height: 1.1rem;
	transition: rotate 0.45s var(--ease-out, ease);
}

.cci-rappel__fermer:hover {
	background: var(--marine, #11314b);
	color: var(--blanc, #fff);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.cci-rappel__fermer:hover .icon {
		rotate: 90deg;
		transition: rotate 0.85s var(--ressort, ease);
	}
}

/* Ouverture : le panneau monte en douceur ; fermeture : il redescend. */
@media (prefers-reduced-motion: no-preference) {
	.cci-rappel--fenetre[open] {
		animation: cci-rappel-entre 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.cci-rappel--fenetre[open]::backdrop {
		animation: cci-rappel-voile 0.4s ease;
	}

	.cci-rappel--fenetre.is-fermeture {
		animation: cci-rappel-sort 0.38s cubic-bezier(0.65, 0, 0.35, 1) forwards;
	}

	.cci-rappel--fenetre.is-fermeture::backdrop {
		animation: cci-rappel-voile 0.38s ease reverse forwards;
	}
}

@keyframes cci-rappel-entre {
	from { opacity: 0; transform: translateY(1.5rem) scale(0.98); }
}

@keyframes cci-rappel-sort {
	to { opacity: 0; transform: translateY(1rem) scale(0.98); }
}

@keyframes cci-rappel-voile {
	from { opacity: 0; }
}

/* Mobile : feuille qui monte du bas, pleine largeur. */
@media (max-width: 40rem) {
	.cci-rappel--fenetre {
		width: 100%;
		max-height: 92dvh;
		margin: auto 0 0;
		border-radius: 1.75rem 1.75rem 0 0;
	}

	@media (prefers-reduced-motion: no-preference) {
		.cci-rappel--fenetre[open] {
			animation-name: cci-rappel-monte;
		}

		.cci-rappel--fenetre.is-fermeture {
			animation-name: cci-rappel-descend;
		}
	}
}

@keyframes cci-rappel-monte {
	from { transform: translateY(100%); }
}

@keyframes cci-rappel-descend {
	to { transform: translateY(100%); }
}

/* --- Page Contact ---------------------------------------------------------- */
.cci-rappel--page {
	max-width: 46rem;
	padding: clamp(1.75rem, 1rem + 2.5vw, 3rem);
	border-radius: var(--r-xl, 2rem);
	background: var(--blanc, #fff);
	color: var(--marine, #11314b);
}

/* --- Formulaire ------------------------------------------------------------ */
.cci-rappel__form {
	display: grid;
	gap: 1.4rem;
	margin-top: 1.75rem;
}

.cci-rappel__form[hidden] {
	display: none;
}

.cci-rappel--page .cci-rappel__form {
	margin-top: 0;
}

.cci-rappel__grille {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1rem 1rem;
}

@media (max-width: 34rem) {
	.cci-rappel__grille {
		grid-template-columns: minmax(0, 1fr);
	}
}

.cci-rappel__champ {
	display: grid;
	gap: 0.45rem;
}

.cci-rappel__champ label,
.cci-rappel__choix legend {
	padding: 0;
	font-size: var(--fs-sm, 0.9375rem);
	font-weight: var(--fw-medium, 500);
}

.cci-rappel__champ label span[aria-hidden],
.cci-rappel__note span {
	color: var(--rouge, #e50043);
}

.cci-rappel__facultatif {
	font-weight: 400;
	opacity: 0.6;
}

.cci-rappel__champ input,
.cci-rappel__champ select,
.cci-rappel__champ textarea {
	width: 100%;
	min-height: 3.25rem;
	padding: 0 1.25rem;
	border: 1.5px solid transparent;
	border-radius: var(--r-pill, 999px);
	background: var(--creme, #f6f4ef);
	color: inherit;
	font: inherit;
	font-size: var(--fs-md, 1.0625rem);
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cci-rappel__champ textarea {
	min-height: 6rem;
	padding: 0.9rem 1.25rem;
	border-radius: 1.5rem;
	resize: vertical;
}

.cci-rappel__champ select {
	appearance: none;
	padding-right: 3rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2311314b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1.1rem center;
	background-size: 1.1rem;
}

.cci-rappel__champ input:hover,
.cci-rappel__champ select:hover,
.cci-rappel__champ textarea:hover {
	border-color: color-mix(in srgb, var(--marine, #11314b) 15%, transparent);
}

.cci-rappel__champ input:focus,
.cci-rappel__champ select:focus,
.cci-rappel__champ textarea:focus {
	border-color: var(--marine, #11314b);
	background: var(--blanc, #fff);
	outline: none;
	box-shadow: none;
}

/* Choix en puces (profil, moment). */
.cci-rappel__choix {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.cci-rappel__choix legend {
	margin-bottom: 0.6rem;
}

.cci-rappel__puces {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cci-rappel__puce {
	position: relative;
	cursor: pointer;
}

.cci-rappel__puce input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cci-rappel__puce span {
	display: inline-flex;
	align-items: center;
	min-height: 2.6rem;
	padding: 0 1.1rem;
	border: 1.5px solid color-mix(in srgb, var(--marine, #11314b) 22%, transparent);
	border-radius: var(--r-pill, 999px);
	font-size: var(--fs-sm, 0.9375rem);
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.cci-rappel__puce:hover span {
	border-color: var(--marine, #11314b);
}

.cci-rappel__puce input:checked + span {
	border-color: var(--marine, #11314b);
	background: var(--marine, #11314b);
	color: var(--blanc, #fff);
}

@media (prefers-reduced-motion: no-preference) {
	.cci-rappel__puce input:checked + span {
		animation: cci-pop 0.75s both;
	}
}

.cci-rappel__puce input:focus-visible + span {
	outline: 2px solid var(--rouge, #e50043);
	outline-offset: 2px;
}

/* Accord RGPD. */
.cci-rappel__accord {
	display: grid;
	grid-template-columns: 1.25rem minmax(0, 1fr);
	gap: 0.75rem;
	align-items: start;
	font-size: var(--fs-xs, 0.875rem);
	line-height: 1.45;
	cursor: pointer;
}

.cci-rappel__accord input {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.1rem 0 0;
	accent-color: var(--marine, #11314b);
}

.cci-rappel__accord a {
	color: inherit;
	text-decoration: underline;
}

.cci-rappel__erreur {
	margin: 0;
	padding: 0.8rem 1.1rem;
	border-radius: 1rem;
	background: color-mix(in srgb, var(--rouge, #e50043) 10%, var(--blanc, #fff));
	color: var(--rouge, #e50043);
	font-size: var(--fs-sm, 0.9375rem);
}

.cci-rappel__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.cci-rappel__note {
	margin: 0;
	font-size: var(--fs-xs, 0.875rem);
	opacity: 0.7;
}

.cci-rappel__form.is-envoi .cci-rappel__envoyer {
	opacity: 0.6;
	cursor: progress;
}

/* Champ piège pour les robots : hors écran. */
.cci-rappel__piege {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Merci. */
.cci-rappel__merci {
	display: grid;
	justify-items: center;
	gap: 0.6rem;
	padding: 1.5rem 0 0.5rem;
	text-align: center;
	outline: none;
}

.cci-rappel__merci[hidden] {
	display: none;
}

.cci-rappel__ok {
	display: grid;
	place-items: center;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 50%;
	background: var(--rose, #fdc9d8);
	color: var(--rouge, #e50043);
}

.cci-rappel__ok svg {
	width: 2.2rem;
	height: 2.2rem;
}

@media (prefers-reduced-motion: no-preference) {
	.cci-rappel__merci:not([hidden]) .cci-rappel__ok {
		animation: cci-pop 0.9s both;
	}
}

.cci-rappel__merci-titre {
	margin: 0.5rem 0 0;
	font-size: var(--fs-xl, 1.75rem);
	font-weight: var(--fw-semibold, 600);
}

.cci-rappel__merci p {
	margin: 0;
}

/* Après envoi, le libellé de la formation suffit : on retire le titre de saisie. */
.cci-rappel__panneau.is-merci .cci-rappel__titre,
.cci-rappel__panneau.is-merci .eyebrow {
	display: none;
}
