/* Tasdjil Auth Portal — registre civil, pas clone E-Subside/SONU */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Sora:wght@500;600;700&display=swap');

:root {
	--brand: #009ADB;
	--brand-deep: #0078ab;
	--brand-dark: #005f88;
	--ink: #0a3a4a;
	--teal: #009ADB;
	--cyan: #009ADB;
	--cyan-soft: #e5f6fc;
	--mist: #eef5f9;
	--paper: #ffffff;
	--muted: #5a7380;
	--danger: #c0392b;
	--chad-b: #002664;
	--chad-y: #fecb00;
	--chad-r: #c60c30;
	--radius: 18px;
	--shadow: 0 24px 60px rgba(0, 154, 219, 0.16);
	--font-display: 'Sora', system-ui, sans-serif;
	--font-body: 'IBM Plex Sans', system-ui, sans-serif;
}

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

html, body {
	margin: 0;
	min-height: 100%;
	font-family: var(--font-body);
	color: var(--ink);
	background: var(--mist);
	-webkit-font-smoothing: antialiased;
}

body.auth-body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 154, 219, 0.22), transparent 55%),
		radial-gradient(ellipse 70% 50% at 90% 80%, rgba(0, 120, 171, 0.16), transparent 50%),
		linear-gradient(160deg, #d4eaf5 0%, #eef5f9 45%, #e2eff6 100%);
	position: relative;
	overflow-x: hidden;
}

body.auth-body::before {
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.35;
	background-image:
		repeating-linear-gradient(
			-18deg,
			transparent,
			transparent 14px,
			rgba(0, 154, 219, 0.04) 14px,
			rgba(0, 154, 219, 0.04) 15px
		);
	z-index: 0;
}

.auth-lang {
	position: fixed;
	top: 1.1rem;
	right: 1.1rem;
	z-index: 20;
	display: flex;
	gap: 0.4rem;
}

.auth-lang button {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 999px;
	border: 1.5px solid rgba(0, 154, 219, 0.35);
	background: rgba(255, 255, 255, 0.85);
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
	transition: 0.2s ease;
}

.auth-lang button.is-active {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

.auth-shell {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.25rem 1.5rem;
}

.auth-card {
	width: 100%;
	max-width: 980px;
	background: var(--paper);
	border-radius: calc(var(--radius) + 6px);
	box-shadow: var(--shadow);
	overflow: hidden;
	display: grid;
	grid-template-columns: 1.05fr 1fr;
	min-height: 560px;
	animation: authRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card--narrow {
	max-width: 440px;
	grid-template-columns: 1fr;
	min-height: auto;
}

.auth-brand {
	position: relative;
	padding: 2.25rem 2rem 1.75rem;
	background:
		radial-gradient(circle at 20% 15%, rgba(0, 154, 219, 0.45), transparent 45%),
		radial-gradient(circle at 85% 70%, rgba(254, 203, 0, 0.1), transparent 40%),
		linear-gradient(165deg, #0078ab 0%, #009ADB 48%, #005f88 100%);
	color: #fff;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.auth-brand::after {
	content: '';
	position: absolute;
	width: 280px;
	height: 280px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 50%;
	right: -80px;
	bottom: -60px;
	pointer-events: none;
}

.auth-brand::before {
	content: '';
	position: absolute;
	width: 180px;
	height: 180px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 50%;
	right: -30px;
	bottom: 20px;
	pointer-events: none;
}

/* Panneau mission — fond blanc + logo officiel */
.auth-brand--mission {
	padding: 2.5rem 1.75rem;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: #ffffff;
	border-right: 1px solid rgba(0, 154, 219, 0.12);
}

.auth-brand--mission::before,
.auth-brand--mission::after {
	display: none;
}

.auth-mission {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 340px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2.25rem;
	animation: authFade 0.8s ease both;
}

.auth-mission__logo {
	display: flex;
	align-items: center;
	justify-content: center;
}

.auth-mission__img {
	display: block;
	width: auto;
	max-width: 220px;
	height: auto;
	max-height: 88px;
	object-fit: contain;
}

.auth-mission__copy {
	width: 100%;
}

.auth-mission__fr {
	margin: 0;
	font-family: var(--font-display);
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #009ADB;
	line-height: 1.45;
}

.auth-mission__fr--strong {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #0078ab;
}

.auth-mission__rule {
	width: 72px;
	height: 1px;
	border: 0;
	background: #009ADB;
	opacity: 0.55;
	margin: 1.15rem auto;
}

.auth-mission__ar-block {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: #009ADB;
	line-height: 1.55;
}

.auth-brand__top {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	position: relative;
	z-index: 1;
}

.auth-brand__logo {
	width: 52px;
	height: 52px;
	object-fit: contain;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 12px;
	padding: 4px;
}

.auth-brand__name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.15rem;
	letter-spacing: 0.02em;
	line-height: 1.15;
}

.auth-brand__name span {
	display: block;
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.75;
	margin-top: 0.2rem;
	font-family: var(--font-body);
}

.auth-brand__hero {
	position: relative;
	z-index: 1;
	margin-top: auto;
	padding-top: 3rem;
	animation: authFade 0.8s 0.15s ease both;
}

.auth-brand__hero h1 {
	font-family: var(--font-display);
	font-size: clamp(1.45rem, 2.4vw, 1.85rem);
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 0.85rem;
	max-width: 16ch;
}

.auth-brand__hero p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.55;
	opacity: 0.82;
	max-width: 32ch;
}

.auth-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.auth-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.auth-pill i { font-size: 0.85rem; opacity: 0.9; }

.auth-brand__foot {
	position: relative;
	z-index: 1;
	margin-top: 2rem;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.7rem;
	opacity: 0.8;
}

.auth-brand__foot img {
	width: 28px;
	height: auto;
}

.auth-panel {
	padding: 2.25rem 2rem 1.75rem;
	display: flex;
	flex-direction: column;
	animation: authFade 0.7s 0.1s ease both;
}

.auth-panel__eyebrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--teal);
	margin-bottom: 0.65rem;
}

.auth-panel__logo {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin: 0 auto 1.25rem;
	text-align: center;
}

.auth-panel__logo img {
	display: block;
	width: auto;
	max-width: 200px;
	max-height: 72px;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
}

.auth-panel h2 {
	font-family: var(--font-display);
	font-size: 1.55rem;
	font-weight: 600;
	margin: 0 0 0.4rem;
	color: var(--ink);
	text-align: left;
}

.auth-panel__lead {
	margin: 0 0 1.5rem;
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.45;
	text-align: left;
}

.auth-alert {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
	background: #fdecea;
	border: 1px solid #f5c6c2;
	color: var(--danger);
	font-size: 0.86rem;
	margin-bottom: 1.1rem;
}

.auth-alert--ok {
	background: #e8f7ef;
	border-color: #b7e4c7;
	color: #1b6b3a;
}

.auth-field {
	margin-bottom: 1.05rem;
}

.auth-field label {
	display: block;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--brand, var(--teal));
	margin-bottom: 0.4rem;
}

.auth-field label .req { color: var(--chad-r); }

.auth-input {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 48px;
	background: #f0f4f7;
	border: 1.5px solid #e2e8ec;
	border-radius: 12px;
	padding: 0 0.9rem;
	transition: 0.2s ease;
}

.auth-input:focus-within {
	border-color: #009ADB;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(0, 154, 219, 0.18);
}

.auth-input > i {
	color: #009ADB;
	opacity: 0.75;
	font-size: 1.15rem;
	flex-shrink: 0;
	width: 1.25rem;
	text-align: center;
	pointer-events: none;
}

.auth-input input {
	flex: 1;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 0.85rem 0;
	margin: 0;
	font-family: var(--font-body);
	font-size: 0.95rem;
	line-height: 1.3;
	color: var(--ink);
	width: 100%;
	height: auto;
	min-height: 0;
	appearance: none;
	-webkit-appearance: none;
}

.auth-input input::placeholder { color: #8aa0ab; }

.auth-input__toggle {
	border: 0;
	background: transparent;
	color: #8aa0ab;
	cursor: pointer;
	padding: 0.25rem;
	line-height: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.auth-input__toggle:hover { color: #009ADB; }
.auth-input__toggle i { font-size: 1.15rem; }

.auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 0.25rem 0 1.25rem;
	flex-wrap: wrap;
}

.auth-check {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.86rem;
	color: var(--muted);
	cursor: pointer;
	user-select: none;
}

.auth-check input {
	width: 1rem;
	height: 1rem;
	accent-color: var(--teal);
}

.auth-link {
	font-size: 0.86rem;
	color: var(--teal);
	text-decoration: none;
	font-weight: 500;
}

.auth-link:hover { color: var(--ink); text-decoration: underline; }

.auth-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	width: 100%;
	border: 0;
	border-radius: 12px;
	padding: 0.95rem 1.25rem;
	font-family: var(--font-display);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
	text-decoration: none;
}

.auth-btn--primary {
	background: linear-gradient(135deg, #009ADB 0%, #0078ab 100%);
	color: #fff;
	box-shadow: 0 10px 24px rgba(0, 154, 219, 0.32);
}

.auth-btn--primary:hover {
	transform: translateY(-1px);
	background: linear-gradient(135deg, #1aa8e3 0%, #009ADB 100%);
	box-shadow: 0 14px 28px rgba(0, 154, 219, 0.4);
	color: #fff;
}

.auth-btn.is-loading {
	pointer-events: none;
	opacity: 0.92;
	cursor: wait;
	transform: none !important;
}

.auth-btn.is-loading.auth-btn--primary {
	background: linear-gradient(135deg, #009ADB 0%, #0078ab 100%);
}

.auth-spinner {
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	display: inline-block;
	animation: authSpin 0.7s linear infinite;
	flex-shrink: 0;
}

.auth-btn--ghost.is-loading .auth-spinner {
	border-color: rgba(0, 154, 219, 0.25);
	border-top-color: #009ADB;
}

@keyframes authSpin {
	to { transform: rotate(360deg); }
}

.auth-btn--ghost {
	background: transparent;
	color: var(--ink);
	border: 1.5px solid rgba(0, 154, 219, 0.3);
	margin-top: 0.75rem;
}

.auth-btn--ghost:hover {
	background: var(--mist);
	color: var(--ink);
}

.auth-help {
	margin-top: 1.15rem;
	text-align: center;
	font-size: 0.82rem;
	color: var(--muted);
}

.auth-secure {
	margin-top: auto;
	padding-top: 1.5rem;
	font-size: 0.72rem;
	color: var(--muted);
	line-height: 1.45;
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
}

.auth-tricolor {
	height: 4px;
	width: 100%;
	background: linear-gradient(90deg, var(--chad-b) 0 33.33%, var(--chad-y) 33.33% 66.66%, var(--chad-r) 66.66%);
	margin-top: 1.25rem;
	border-radius: 2px;
}

.auth-republic {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-top: 0.85rem;
	font-size: 0.68rem;
	color: var(--muted);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.auth-republic img { width: 22px; height: auto; }

.auth-page-foot {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 0 1rem 1.25rem;
	font-size: 0.7rem;
	color: #7a909c;
}

.auth-user {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.85rem 1rem;
	background: var(--mist);
	border-radius: 14px;
	margin-bottom: 1.35rem;
}

.auth-user__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: linear-gradient(145deg, #009ADB, #005f88);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 0.95rem;
	flex-shrink: 0;
	overflow: hidden;
}

.auth-user__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.auth-user__meta strong {
	display: block;
	font-family: var(--font-display);
	font-size: 0.95rem;
	font-weight: 600;
}

.auth-user__meta span {
	display: block;
	font-size: 0.78rem;
	color: var(--muted);
	margin-top: 0.15rem;
}

.auth-user__role {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--teal);
}

@keyframes authRise {
	from { opacity: 0; transform: translateY(18px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@keyframes authFade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
	.auth-card {
		grid-template-columns: 1fr;
		max-width: 440px;
		min-height: auto;
	}
	.auth-brand {
		padding: 1.5rem 1.4rem 1.25rem;
		min-height: auto;
	}
	.auth-brand--mission {
		padding: 2rem 1.4rem;
		min-height: 280px;
		border-right: 0;
		border-bottom: 1px solid rgba(0, 154, 219, 0.12);
	}
	.auth-mission {
		gap: 1.5rem;
	}
	.auth-mission__img {
		max-width: 180px;
		max-height: 72px;
	}
	.auth-mission__fr--strong { font-size: 0.85rem; }
	.auth-mission__fr { font-size: 0.75rem; }
	.auth-brand__hero {
		padding-top: 1.25rem;
	}
	.auth-brand__hero h1 { max-width: none; font-size: 1.35rem; }
	.auth-pills { display: none; }
	.auth-panel { padding: 1.6rem 1.4rem 1.4rem; }
}
