/**
 * Touchy Idea – Comptes clients
 * Fenêtre « Connexion / Inscription » — shortcode [touchy_connexion].
 *
 * Colonne de droite de la maquette « Popups Compte ». Feuille autonome : elle
 * porte ses propres tokens pour ne pas charger comptes.css (espace client) sur
 * toutes les pages où la popup est posée.
 *
 * Sélecteurs à deux classes minimum : Divi et son thème stylent `input[type=…]`,
 * `p`, `h2` et `a` avec une spécificité (0,1,1) à (0,2,1).
 */

/* ============================================================================
 * 1. TOKENS
 * ========================================================================== */

.ti-auth {
	--ti-auth-accent: #ff6fa5;

	--ti-plum-50:  #f7eefc;
	--ti-plum-100: #eeddf8;
	--ti-plum-300: #c897ea;
	--ti-plum-400: #a684cc;
	--ti-plum-600: #66448f;
	--ti-plum-700: #4a2f70;

	--ti-cherry-100: #ffe7ee;
	--ti-cherry-500: #ff6fa5;
	--ti-cherry-700: #c84372;

	--ti-peach-500:  #fec6b8;
	--ti-banana-500: #ffdd81;
	--ti-mint-400:   #b8e5d4;
	--ti-mint-200:   #e2f6ee;

	--ti-cream:    #f8f7f1;
	--ti-vanilla:  #fff8ee;
	--ti-white:    #ffffff;
	--ti-mist-100: #efece3;
	--ti-mist-200: #ddd7c8;
	--ti-mauve-400: #a99cb7;
	--ti-mauve-500: #6b5b82;
	--ti-mauve-600: #4a3f5c;
	--ti-ink:      #2d1b47;

	--ti-auth-border:      var(--ti-mist-200);
	--ti-auth-border-soft: var(--ti-mist-100);
	--ti-auth-focus:       0 0 0 4px rgba(255, 111, 165, 0.32);
	--ti-auth-shadow:      0 1px 2px rgba(45, 27, 71, 0.05);

	--ti-auth-font-body:  "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--ti-auth-font-title: "Caveat Brush", "Comic Sans MS", cursive;

	/* Titres : valeurs relevées sur touchy-idea.com (preset Divi « H2 »). */
	--ti-h2-size:   clamp(34px, 7.5vw, 56px);
	--ti-h2-weight: 500;

	--ti-auth-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
	--ti-auth-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

	position: relative;
	min-width: 0;
	font-family: var(--ti-auth-font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--ti-ink);
	text-align: left;
}

/* Polices de la maquette désactivées : celles du thème. */
.touchy-no-webfont .ti-auth {
	--ti-auth-font-body: inherit;
	--ti-auth-font-title: inherit;
}

.ti-auth *,
.ti-auth *::before,
.ti-auth *::after {
	box-sizing: border-box;
}

/* `hidden` doit gagner contre nos `display: flex`. */
.ti-auth [hidden] {
	display: none !important;
}

/* Survols : toujours « all 300ms ease » (charte). */
.ti-auth a,
.ti-auth button,
.ti-auth label,
.ti-auth input,
.ti-auth .ti-auth__box {
	transition: all 300ms ease;
}

/* ============================================================================
 * 2. ONGLETS
 * ========================================================================== */

.ti-auth .ti-auth__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 24px;
	padding: 0;
}

.ti-auth .ti-auth__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 18px;
	border: 1px solid var(--ti-auth-border);
	border-radius: 999px;
	background: var(--ti-white);
	color: var(--ti-plum-600);
	font-family: var(--ti-auth-font-body);
	font-weight: 700;
	font-size: 14.5px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: all 300ms ease;
}

.ti-auth .ti-auth__tab:hover {
	background: var(--ti-plum-50);
	color: var(--ti-plum-600);
	transform: translateY(-2px);
}

.ti-auth .ti-auth__tab.is-active {
	border-color: transparent;
	background: var(--ti-plum-600);
	color: var(--ti-cream);
	box-shadow: var(--ti-auth-shadow);
}

.ti-auth .ti-auth__tab.is-active:hover {
	transform: none;
}

.ti-auth .ti-auth__tab-icon {
	flex: 0 0 auto;
}

.ti-auth .ti-auth__tab-bar {
	display: none;
}

/* Variante « titres manuscrits » */
.ti-auth .ti-auth__tabs--manuscrits {
	align-items: flex-end;
	gap: 22px;
	margin-bottom: 22px;
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab,
.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab:hover,
.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab.is-active {
	min-height: 44px;
	padding: 0 0 10px;
	border: none;
	border-radius: 0;
	background: none;
	box-shadow: none;
	transform: none;
	font-family: var(--ti-auth-font-title);
	font-weight: 400;
	font-size: 24px;
	align-items: flex-end;
	color: var(--ti-mauve-400);
	transition: all 300ms ease;
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab.is-active {
	font-size: 32px;
	color: var(--ti-ink);
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab:hover {
	color: var(--ti-plum-600);
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab-icon {
	display: none;
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab-bar {
	display: block;
	position: absolute;
	left: -4px;
	right: -4px;
	bottom: 0;
	height: 7px;
	border-radius: 999px;
	background: var(--ti-auth-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: all 300ms ease;
}

.ti-auth .ti-auth__tabs--manuscrits .ti-auth__tab.is-active .ti-auth__tab-bar {
	transform: scaleX(1) rotate(-1.5deg);
}

/* ============================================================================
 * 3. PANNEAUX ET TEXTES
 * ========================================================================== */

.ti-auth .ti-auth__panel {
	animation: ti-auth-swap 260ms var(--ti-auth-ease-out);
}

.ti-auth .ti-auth__form {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.ti-auth .ti-auth__title {
	margin: 0 0 8px;
	padding: 0;
	font-family: var(--ti-auth-font-title);
	font-weight: var(--ti-h2-weight);
	font-size: var(--ti-h2-size);
	line-height: 1;
	letter-spacing: 0;
	color: var(--ti-ink);
	text-transform: none;
}

.ti-auth .ti-auth__title:focus {
	outline: none;
}

.touchy-no-webfont .ti-auth .ti-auth__title {
	font-weight: 800;
	letter-spacing: -0.02em;
	font-size: clamp(30px, 5vw, 38px);
}

.ti-auth .ti-auth__lede {
	margin: 0 0 24px;
	padding: 0;
	font-size: 15.5px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--ti-mauve-500);
	text-wrap: pretty;
}

.ti-auth [data-ti-panel="inscription"] .ti-auth__lede,
.ti-auth [data-ti-panel="oubli"] .ti-auth__lede {
	margin-bottom: 22px;
}

.ti-auth a {
	color: var(--ti-plum-600);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	text-decoration-color: var(--ti-plum-300);
	transition: all 300ms ease;
}

.ti-auth a:hover {
	color: var(--ti-plum-600);
	text-decoration-color: var(--ti-cherry-500);
}

.ti-auth a:focus-visible,
.ti-auth button:focus-visible {
	outline: 2px solid var(--ti-plum-600);
	outline-offset: 2px;
}

.ti-auth .ti-auth__switch {
	margin: 18px 0 0;
	padding: 0;
	text-align: center;
	font-size: 14.5px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--ti-mauve-500);
}

.ti-auth .ti-auth__switch a {
	font-weight: 700;
}

.ti-auth .ti-auth__muted {
	color: var(--ti-mauve-500);
}

/* Bandeau d'erreur général (session expirée, compte bloqué…) */
.ti-auth .ti-auth__alert {
	margin: 0 0 18px;
	padding: 12px 16px;
	border-radius: 14px;
	background: var(--ti-cherry-100);
	color: var(--ti-cherry-700);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
}

/* Bandeau positif (email renvoyé, adresse confirmée…) */
.ti-auth .ti-auth__alert--ok {
	background: var(--ti-mint-200);
	color: var(--ti-plum-700);
}

/* « Renvoyer l'email », dans le bandeau d'erreur */
.ti-auth .ti-auth__inline-btn {
	display: inline;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	cursor: pointer;
}

.ti-auth .ti-auth__inline-btn:hover {
	background: none;
	color: var(--ti-plum-600);
}

/* Retour (mot de passe oublié) */
.ti-auth .ti-auth__back {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	margin: 0 0 8px;
	font-weight: 700;
	font-size: 14.5px;
	text-decoration: none;
}

.ti-auth .ti-auth__back:hover {
	color: var(--ti-cherry-500);
}

/* Icônes Lucide du site : caractères de la police ETmodules complétée par
   le plugin divi-icones (voir Touchy_Comptes_Icons). */
.ti-lucide {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	font-family: ETmodules !important;
	font-style: normal !important;
	font-weight: 400 !important;
	font-variant: normal;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	speak: never;
}

/* ============================================================================
 * 3 bis. DÉFILEMENT DE LA FENÊTRE (mobile, petits écrans)
 *
 * La section Divi de la popup est fixe, haute de 100dvh, et centre sa ligne
 * par des marges automatiques. Sans ces règles, la ligne se tasse à la
 * hauteur de l'écran et rogne ce qui dépasse : sur un téléphone, le bouton
 * « Crée mon compte » tombait sous le bord, hors d'atteinte (mesuré le
 * 26/09/2026 sur 375 × 812 : bouton à 996 px).
 *
 *  - la section défile, et le défilement ne se transmet pas à la page
 *    (overscroll-behavior) ;
 *  - la ligne garde sa hauteur réelle ; les marges automatiques la centrent
 *    quand elle tient et tombent à zéro quand elle déborde : le haut reste
 *    toujours atteignable ;
 *  - la page derrière est bloquée tant que la fenêtre est ouverte
 *    (attribut posé par auth.js).
 * ========================================================================== */

[data-ti-auth-host],
[class*="et-interaction-target-"]:has([data-ti-auth]) {
	max-height: 100vh;
	max-height: 100dvh;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

[data-ti-auth-host] > *,
[class*="et-interaction-target-"]:has([data-ti-auth]) > * {
	flex-shrink: 0 !important;
	max-height: none !important;
}

html[data-ti-auth-lock],
html[data-ti-auth-lock] body {
	overflow: hidden !important;
}

/* ============================================================================
 * 4. CHAMPS
 * ========================================================================== */

.ti-auth .ti-auth__field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 0 0 16px;
}

[data-ti-panel="inscription"] .ti-auth__field {
	margin-bottom: 14px;
}

[data-ti-panel="inscription"] [data-ti-field="password"] {
	margin-bottom: 16px;
}

[data-ti-panel="connexion"] [data-ti-field="login_password"] {
	margin-bottom: 12px;
}

[data-ti-panel="oubli"] .ti-auth__field {
	margin-bottom: 0;
}

.ti-auth .ti-auth__label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.ti-auth .ti-auth__label {
	margin: 0;
	padding: 0;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ti-ink);
	cursor: pointer;
}

.ti-auth .ti-auth__label-note {
	font-weight: 500;
	color: var(--ti-mauve-500);
}

.ti-auth .ti-auth__small-link {
	font-size: 13.5px;
	font-weight: 600;
}

.ti-auth .ti-auth__input,
.ti-auth .ti-field .ti-input {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--ti-auth-border);
	border-radius: 14px;
	background: var(--ti-white);
	box-shadow: none;
	font-family: var(--ti-auth-font-body);
	font-size: 16px; /* 16 px : iOS ne zoome pas au focus. */
	font-weight: 400;
	line-height: 1.4;
	color: var(--ti-ink);
	-webkit-appearance: none;
	appearance: none;
	transition: all 300ms ease;
}

.ti-auth .ti-auth__input--pw {
	padding-right: 52px;
}

.ti-auth .ti-auth__input::placeholder,
.ti-auth .ti-field .ti-input::placeholder {
	color: var(--ti-mauve-400);
	opacity: 1;
}

.ti-auth .ti-auth__input:focus,
.ti-auth .ti-field .ti-input:focus {
	outline: none;
	border-color: var(--ti-plum-600);
	box-shadow: var(--ti-auth-focus);
	color: var(--ti-ink);
}

.ti-auth .is-error .ti-auth__input {
	border: 2px solid var(--ti-cherry-500);
	background: var(--ti-cherry-100);
}

.ti-auth .is-error .ti-auth__input--pw {
	padding-right: 51px;
}

.ti-auth .ti-auth__error {
	margin: 0;
	padding: 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ti-cherry-700);
}

.ti-auth .ti-auth__error a {
	color: var(--ti-cherry-700);
	font-weight: 700;
}

/* Champs ajoutés par les modules (code de parrainage) */
.ti-auth .ti-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 0 0 14px;
	font-weight: 700;
	font-size: 14px;
	color: var(--ti-ink);
}

.ti-auth .ti-field__optional {
	font-weight: 500;
	color: var(--ti-mauve-500);
}

/* Mot de passe + œil */
.ti-auth .ti-auth__pw {
	position: relative;
	display: block;
}

.ti-auth .ti-auth__eye {
	position: absolute;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
	display: none; /* Visible seulement quand le script est là. */
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: none;
	color: var(--ti-mauve-500);
	cursor: pointer;
}

.ti-auth.is-ready .ti-auth__eye {
	display: grid;
}

.ti-auth .ti-auth__eye:hover {
	background: none;
	color: var(--ti-plum-600);
}

.ti-auth .ti-auth__eye-off,
.ti-auth .ti-auth__eye[aria-pressed="true"] .ti-auth__eye-on {
	display: none;
}

.ti-auth .ti-auth__eye[aria-pressed="true"] .ti-auth__eye-off {
	display: block;
}

/* Jauge de solidité */
.ti-auth .ti-auth__meter {
	display: none;
	align-items: center;
	gap: 10px;
}

.ti-auth.is-ready .ti-auth__meter {
	display: flex;
}

.ti-auth .ti-auth__bars {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
}

.ti-auth .ti-auth__bars > span {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: var(--ti-mist-200);
	transition: all 300ms ease;
}

.ti-auth .ti-auth__meter[data-score="1"] .ti-auth__bars > span:nth-child(-n+1) { background: var(--ti-cherry-500); }
.ti-auth .ti-auth__meter[data-score="2"] .ti-auth__bars > span:nth-child(-n+2) { background: var(--ti-peach-500); }
.ti-auth .ti-auth__meter[data-score="3"] .ti-auth__bars > span:nth-child(-n+3) { background: var(--ti-banana-500); }
.ti-auth .ti-auth__meter[data-score="4"] .ti-auth__bars > span { background: var(--ti-mint-400); }

.ti-auth .ti-auth__meter-label {
	flex: 0 0 auto;
	min-width: 9ch;
	text-align: right;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--ti-mauve-600);
}

/* ============================================================================
 * 5. CASES À COCHER
 *
 * La vraie case reste dans le label, invisible mais focalisable : clavier,
 * lecteurs d'écran et envoi du formulaire marchent sans script.
 * ========================================================================== */

.ti-auth .ti-auth__check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 8px 0;
	cursor: pointer;
	user-select: none;
	font-weight: 400;
}

.ti-auth .ti-auth__check--inline {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 0;
}

.ti-auth .ti-auth__check-input {
	position: absolute;
	top: 12px;
	left: 4px;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

.ti-auth .ti-auth__check--inline .ti-auth__check-input {
	top: 50%;
}

.ti-auth .ti-auth__box {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 1px solid var(--ti-auth-border);
	border-radius: 7px;
	background: var(--ti-white);
	color: var(--ti-white);
	transition: all 300ms ease;
}

.ti-auth .ti-auth__check--inline .ti-auth__box {
	margin-top: 0;
}

.ti-auth .ti-auth__box-icon {
	display: block;
	opacity: 0;
	transition: all 300ms ease;
}

/* Survol : comme la porte 18+ du site. */
.ti-auth .ti-auth__check:hover .ti-auth__box {
	border-color: var(--ti-plum-400);
}

.ti-auth .ti-auth__check-input:checked + .ti-auth__box,
.ti-auth .ti-auth__check:hover .ti-auth__check-input:checked + .ti-auth__box {
	border-color: transparent;
	background: var(--ti-auth-accent);
}

.ti-auth .ti-auth__check-input:checked + .ti-auth__box .ti-auth__box-icon {
	opacity: 1;
}

.ti-auth .ti-auth__check-input:focus-visible + .ti-auth__box {
	box-shadow: var(--ti-auth-focus);
	border-color: var(--ti-plum-600);
}

.ti-auth .is-error .ti-auth__box {
	border: 2px solid var(--ti-cherry-500);
}

.ti-auth .ti-auth__check-text {
	font-size: 14px;
	line-height: 1.55;
	color: var(--ti-ink);
}

.ti-auth .ti-auth__check--inline .ti-auth__check-text {
	font-size: 14.5px;
	color: var(--ti-mauve-600);
}

.ti-auth .ti-auth__check--soft .ti-auth__check-text {
	color: var(--ti-mauve-600);
}

/* Encadré des deux cases de l'inscription */
.ti-auth .ti-auth__consents {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 14px;
	border: 1px solid var(--ti-auth-border-soft);
	border-radius: 18px;
	background: var(--ti-vanilla);
}

.ti-auth .ti-auth__consents > .ti-auth__check--soft {
	border-top: 1px solid var(--ti-auth-border-soft);
}

.ti-auth .ti-auth__error--check {
	margin: -6px 0 6px;
	padding-left: 32px;
}

/* Pot de miel */
.ti-auth .ti-auth__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ============================================================================
 * 6. BOUTON PRINCIPAL
 * ========================================================================== */

.ti-auth .ti-auth__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 58px;
	margin: 20px 0 0;
	padding: 0 28px;
	border: none;
	border-radius: 999px;
	background: var(--ti-auth-accent);
	box-shadow: var(--ti-auth-shadow);
	color: var(--ti-white);
	font-family: var(--ti-auth-font-title);
	font-weight: 400;
	font-size: 26px;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: all 300ms ease;
}

.touchy-no-webfont .ti-auth .ti-auth__submit {
	font-weight: 800;
	font-size: 18px;
}

.ti-auth .ti-auth__submit:hover {
	transform: translateY(-2px);
	background: var(--ti-auth-accent);
	color: var(--ti-white);
	text-decoration: none;
}

.ti-auth .ti-auth__submit:active {
	transform: scale(0.97);
}

.ti-auth .ti-auth__spin {
	display: none;
	flex: 0 0 auto;
	stroke-width: 2.4;
}

.ti-auth .ti-auth__submit.is-loading {
	cursor: wait;
	opacity: 0.85;
	transform: none;
}

.ti-auth .ti-auth__submit.is-loading .ti-auth__spin {
	display: block;
	animation: ti-auth-spin 800ms linear infinite;
}

/* ============================================================================
 * 7. ÉCRANS DE CONFIRMATION
 * ========================================================================== */

.ti-auth .ti-auth__done {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 12px;
	text-align: center;
	animation-duration: 300ms;
}

.ti-auth .ti-auth__badge {
	display: grid;
	place-items: center;
	width: 92px;
	height: 92px;
	margin: 0 0 18px;
	border-radius: 50%;
	background: var(--ti-mint-400);
	color: var(--ti-plum-700);
}

.ti-auth .ti-auth__done .ti-auth__title {
	max-width: 16ch;
	margin-bottom: 10px;
}

.ti-auth .ti-auth__done .ti-auth__lede {
	max-width: 40ch;
	line-height: 1.65;
}

.ti-auth .ti-auth__done .ti-auth__lede strong {
	color: var(--ti-ink);
	word-break: break-word;
}

.ti-auth .ti-auth__done .ti-auth__submit {
	margin-top: 0;
}

/* ============================================================================
 * 8. ANIMATIONS
 * ========================================================================== */

@keyframes ti-auth-swap {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

@keyframes ti-auth-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ti-auth *,
	.ti-auth *::before,
	.ti-auth *::after {
		animation: none !important;
		transition: none !important;
	}

	/* Sans rotation, le spinner n'aurait plus de sens : on garde le libellé. */
	.ti-auth .ti-auth__submit.is-loading .ti-auth__spin {
		display: none;
	}
}
