/*
 * MACFR Gate — la page de connexion.
 *
 * Deux principes. D'abord, l'identité vient de la couleur et du logo, pas
 * d'ornements : un écran de connexion doit se traverser vite. Ensuite, le
 * formulaire prime — sur mobile, la marque se réduit à un bandeau et la
 * saisie occupe l'écran.
 */

.macfr-gate {
	/* Palette de la page d'accueil : marine, orange, crème. */
	--gate-navy: #06366F;
	--gate-navy-2: #004AAD;
	--gate-brand: #D5570A;
	--gate-deep: #A23F06;
	--gate-ink: #222222;
	--gate-ink-2: #6B6B6B;
	--gate-line: #ECE4D9;
	--gate-bg: #FCFAF7;

	display: grid;
	grid-template-columns: 1.05fr 1fr;
	min-block-size: min(760px, 100vh);
	margin: 0;
	background: #FFFFFF;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(16, 17, 16, .10);
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--gate-ink);
}

.macfr-gate--centered { grid-template-columns: 1fr; max-inline-size: 480px; margin-inline: auto; }
.macfr-gate--centered .gate-brand { min-block-size: 180px; }

/* --- Colonne de marque ------------------------------------------------- */

.gate-brand {
	position: relative;
	display: grid;
	place-items: center;
	padding: 48px 40px;
	/*
	 * Le panneau de marque.
	 *
	 * Orange profond plutôt que marine : c'est la couleur du logo, et elle
	 * ne le fait pas disparaître comme le bleu le faisait. Le dégradé va du
	 * plus clair au plus sombre pour garder de la profondeur sans jamais
	 * descendre sous le seuil de lisibilité du blanc.
	 */
	background: linear-gradient(150deg, #A23F06 0%, #632604 100%);
	background-size: cover;
	background-position: center;
	color: #FFFFFF;
	text-align: center;
}

/* Un voile sombre quand une photo est posée : sans lui, le logo blanc
   disparaît sur les zones claires de l'image. */
.gate-brand[style*="background-image"]::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(150deg, rgba(162, 63, 6, .93), rgba(99, 38, 4, .86));
}

.gate-brand__inner { position: relative; display: grid; gap: 16px; justify-items: center; }
/*
 * Le logo sur une pastille blanche, plutôt que décoloré.
 *
 * J'avais employé « brightness(0) invert(1) » : ce filtre écrase toutes
 * les couleurs en blanc, sans distinction. Sur un logo dont le fond est
 * déjà clair, il ne reste qu'un carré blanc — c'est ce qui s'affichait.
 *
 * On pose donc le logo tel quel sur une pastille blanche. Il garde ses
 * couleurs, se détache du fond orange, et aucun logo ne peut disparaître.
 */
.gate-brand__logo {
	max-inline-size: 190px;
	block-size: auto;
	padding: 18px 22px;
	border-radius: 20px;
	background: #FFFFFF;
	box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .5);
}

/*
 * Une version claire téléversée n'a pas besoin de pastille.
 *
 * Elle est dessinée pour un fond sombre : l'entourer de blanc irait contre
 * l'intention.
 */
.gate-brand__logo.is-light {
	padding: 0;
	background: transparent;
	box-shadow: none;
}

.gate-brand__name {
	margin: 0;
	font-family: 'Fraunces', Georgia, serif;
	font-size: clamp(1.9rem, 4vw, 2.7rem);
	font-weight: 600;
	line-height: 1.06;
	letter-spacing: -.02em;
}

.gate-brand__baseline {
	margin: 0;
	max-inline-size: 26ch;
	font-size: .95rem;
	line-height: 1.6;
	/* 92 % plutôt que 86 % : sur la partie claire du dégradé, six points de
	   plus font passer le seuil de lisibilité. */
	color: rgba(255, 255, 255, .92);
}

/* --- Colonne du formulaire --------------------------------------------- */

.gate-panel {
	display: grid;
	align-content: center;
	gap: 4px;
	padding: 48px clamp(24px, 5vw, 56px);
}

.gate-title {
	margin: 0 0 6px;
	font-family: 'Fraunces', Georgia, serif;
	font-size: clamp(1.7rem, 3vw, 2.1rem);
	font-weight: 600;
	letter-spacing: -.02em;
	color: var(--gate-navy);
}

.gate-lede { margin: 0 0 24px; font-size: .95rem; line-height: 1.6; color: var(--gate-ink-2); }

.gate-form { display: grid; gap: 18px; }

.gate-field { display: grid; gap: 7px; }

.gate-field > span:first-child {
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--gate-ink-2);
}

.macfr-gate input[type="text"],
.macfr-gate input[type="email"],
.macfr-gate input[type="password"] {
	inline-size: 100%;
	padding: 14px 16px;
	border: 1px solid var(--gate-line);
	border-radius: 12px;
	background: #FFFFFF;
	/* 16 px exactement : en dessous, iOS zoome à chaque saisie. */
	font-family: inherit;
	font-size: 16px;
	color: var(--gate-ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.macfr-gate input:focus {
	outline: none;
	border-color: var(--gate-brand);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--gate-brand) 18%, transparent);
}

.gate-password { position: relative; display: block; }
.gate-password input { padding-inline-end: 48px; }

.gate-peek {
	position: absolute;
	inset-inline-end: 6px;
	inset-block-start: 50%;
	translate: 0 -50%;
	inline-size: 38px;
	block-size: 38px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	opacity: .55;
}

.gate-peek:hover, .gate-peek.is-on { opacity: 1; }

.gate-hint { font-size: .78rem; color: var(--gate-ink-2); }
.gate-hint.is-weak { color: #B8410A; }
.gate-hint.is-strong { color: #3C5A0E; }

.gate-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.gate-check { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--gate-ink-2); cursor: pointer; }
.gate-check input { accent-color: var(--gate-brand); inline-size: 17px; block-size: 17px; }

.gate-btn {
	inline-size: 100%;
	padding: 15px 24px;
	border: 0;
	border-radius: 100px;
	background: linear-gradient(100deg, var(--gate-brand), var(--gate-deep));
	color: #FFFFFF;
	font-family: 'Inter', system-ui, sans-serif;
	font-weight: 600;
	font-size: 1rem;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: translate .12s ease, box-shadow .2s ease, filter .2s ease;
}

.gate-btn:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--gate-brand) 34%, transparent); translate: 0 -1px; }
.gate-btn:active { translate: 0; box-shadow: none; }
.gate-btn:disabled { opacity: .6; cursor: wait; }

.gate-link { color: var(--gate-deep); font-size: .88rem; text-decoration: none; border-block-end: 1px solid transparent; }
.gate-link:hover { border-block-end-color: currentColor; }

.gate-alt { margin: 22px 0 0; font-size: .9rem; color: var(--gate-ink-2); }
.gate-alt--muted { padding-block-start: 18px; border-block-start: 1px solid var(--gate-line); font-size: .85rem; }
.gate-foot { margin: 26px 0 0; font-size: .82rem; }

.gate-flash {
	margin: 0 0 20px;
	padding: 13px 16px;
	border-radius: 12px;
	border-inline-start: 4px solid;
	font-size: .9rem;
	line-height: 1.5;
}

.gate-flash.is-error { background: #FDEDE9; border-color: #B8410A; color: #7A2A05; }
.gate-flash.is-notice { background: #EEF4E6; border-color: #3C5A0E; color: #2C4209; }

.macfr-gate--done { display: block; padding: 40px; text-align: center; }
.macfr-gate--done .gate-btn { inline-size: auto; display: inline-block; margin-inline-end: 12px; }

/* --- Petits écrans ------------------------------------------------------ */

@media (max-width: 860px) {
	.macfr-gate {
		grid-template-columns: 1fr;
		min-block-size: 0;
		border-radius: 16px;
		box-shadow: 0 10px 30px rgba(16, 17, 16, .08);
	}

	/* La marque devient un bandeau : sur un téléphone, l'écran doit servir
	   à saisir, pas à contempler. */
	.gate-brand { padding: 30px 24px; }
	.gate-brand__logo { max-inline-size: 130px; }
	.gate-brand__name { font-size: 1.6rem; }
	.gate-brand__baseline { font-size: .85rem; }
	.gate-panel { padding: 32px 22px 38px; }
}

@media (max-width: 420px) {
	.gate-brand__baseline { display: none; }
	.gate-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.gate-btn:hover { translate: none; }
}
