/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--bg-1: #001a33;
	--bg-2: #003d6b;
	--bg-3: #002244;
	--accent: #005691;
	--accent-2: #e2001a;
	--accent-glow: rgba(0, 86, 145, 0.4);
	--card-bg: rgba(255, 255, 255, 0.07);
	--card-border: rgba(255, 255, 255, 0.12);
	--text: #f0f4ff;
	--text-muted: rgba(240, 244, 255, 0.65);
	--success: #10b981;
	--danger: #ef4444;
	--radius: 20px;
	--transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--text);
	background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
	background-attachment: fixed;
	overflow-x: hidden;
	position: relative;
}

/* ── Animated background blobs ────────────────────────────── */
body::before,
body::after {
	content: "";
	position: fixed;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.45;
	z-index: 0;
	pointer-events: none;
	animation: blob-drift 12s ease-in-out infinite alternate;
}

body::before {
	width: 55vw;
	height: 55vw;
	max-width: 500px;
	max-height: 500px;
	background: var(--accent-2);
	top: -10%;
	right: -10%;
}

body::after {
	width: 45vw;
	height: 45vw;
	max-width: 420px;
	max-height: 420px;
	background: var(--accent);
	bottom: -10%;
	left: -10%;
	animation-delay: -6s;
	animation-direction: alternate-reverse;
}

@keyframes blob-drift {
	0%   { transform: translate(0, 0) scale(1); }
	50%  { transform: translate(-30px, 20px) scale(1.08); }
	100% { transform: translate(20px, -30px) scale(0.95); }
}

/* ── Floating particles (pure CSS) ────────────────────────── */
.particles {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.particle {
	position: absolute;
	width: 4px;
	height: 4px;
	background: var(--accent);
	border-radius: 50%;
	opacity: 0;
	animation: particle-rise linear infinite;
}

.particle:nth-child(1)  { left: 10%; animation-duration: 8s;  animation-delay: 0s; }
.particle:nth-child(2)  { left: 25%; animation-duration: 11s; animation-delay: 1.5s; width: 3px; height: 3px; }
.particle:nth-child(3)  { left: 40%; animation-duration: 9s;  animation-delay: 3s; }
.particle:nth-child(4)  { left: 55%; animation-duration: 13s; animation-delay: 0.8s; width: 5px; height: 5px; }
.particle:nth-child(5)  { left: 70%; animation-duration: 10s; animation-delay: 2.2s; }
.particle:nth-child(6)  { left: 85%; animation-duration: 12s; animation-delay: 4s; width: 3px; height: 3px; }
.particle:nth-child(7)  { left: 15%; animation-duration: 14s; animation-delay: 5s; }
.particle:nth-child(8)  { left: 60%; animation-duration: 9s;  animation-delay: 6s; width: 2px; height: 2px; }

@keyframes particle-rise {
	0%   { transform: translateY(100vh) scale(0); opacity: 0; }
	10%  { opacity: 0.6; }
	90%  { opacity: 0.3; }
	100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Main wrapper ─────────────────────────────────────────── */
.offset {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 440px;
	animation: card-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
	from {
		opacity: 0;
		transform: translateY(40px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ── Gateway title ────────────────────────────────────────── */
med-blue {
	display: block;
	text-align: center;
	font-size: clamp(0.75rem, 2.5vw, 0.85rem);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 1rem;
	opacity: 0;
	animation: fade-slide-down 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-slide-down {
	from { opacity: 0; transform: translateY(-12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ─────────────────────────────────────────────────── */
.insert {
	background: var(--card-bg);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid var(--card-border);
	border-radius: var(--radius);
	padding: clamp(1.5rem, 5vw, 2.25rem);
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	position: relative;
	overflow: hidden;
}

.insert::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
	background-size: 200% 100%;
	animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ── Logo / image ─────────────────────────────────────────── */
.logo-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 1.5rem;
	opacity: 0;
	animation: fade-scale 0.7s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-scale {
	from { opacity: 0; transform: scale(0.8); }
	to   { opacity: 1; transform: scale(1); }
}

img.logo {
	width: clamp(140px, 55vw, 220px);
	height: auto;
	max-height: 100px;
	object-fit: contain;
	border: none;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	animation: logo-enter 0.8s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
	filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
}

@keyframes logo-enter {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── WiFi signal icon (CSS only) ──────────────────────────── */
.wifi-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 1.25rem;
	opacity: 0;
	animation: fade-slide-up 0.6s 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wifi-icon span {
	display: block;
	width: 8px;
	height: 8px;
	background: var(--accent);
	border-radius: 50%;
	position: relative;
}

.wifi-icon span::before,
.wifi-icon span::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	border: 2px solid var(--accent);
	border-bottom: none;
	border-radius: 50% 50% 0 0;
	opacity: 0;
	animation: wifi-ring 2s ease-in-out infinite;
}

.wifi-icon span::before {
	width: 24px;
	height: 12px;
	top: -16px;
	animation-delay: 0s;
}

.wifi-icon span::after {
	width: 40px;
	height: 20px;
	top: -28px;
	animation-delay: 0.4s;
}

@keyframes wifi-ring {
	0%, 100% { opacity: 0.2; }
	50%      { opacity: 1; }
}

/* ── Typography blocks ────────────────────────────────────── */
big-red {
	display: block;
	text-align: center;
	font-size: clamp(1.5rem, 5vw, 2rem);
	font-weight: 800;
	background: linear-gradient(135deg, #fff 20%, var(--accent) 60%, var(--accent-2) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	line-height: 1.2;
	margin-bottom: 0.75rem;
	opacity: 0;
	animation: fade-slide-up 0.6s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

italic-black {
	display: block;
	text-align: center;
	font-size: clamp(0.9rem, 3vw, 1.05rem);
	font-weight: 400;
	font-style: normal;
	color: var(--text-muted);
	line-height: 1.6;
	margin-bottom: 1.75rem;
	opacity: 0;
	animation: fade-slide-up 0.6s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Divider ──────────────────────────────────────────────── */
hr {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--card-border), transparent);
	margin: 1.25rem 0;
}

/* ── Form ─────────────────────────────────────────────────── */
form {
	opacity: 0;
	animation: fade-slide-up 0.6s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"] {
	width: 100%;
	padding: 0.85rem 1rem;
	margin-bottom: 0.75rem;
	font-size: 1rem;
	color: var(--text);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--card-border);
	border-radius: 12px;
	outline: none;
	transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-muted);
	margin-bottom: 0.35rem;
}

/* ── Submit button ────────────────────────────────────────── */
input[type="submit"] {
	display: block;
	width: 100%;
	padding: 1rem 1.5rem;
	margin-top: 0.75rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), #0077b6);
	border: none;
	border-radius: 14px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
	box-shadow: 0 4px 20px rgba(0, 86, 145, 0.45);
	-webkit-tap-highlight-color: transparent;
}

input[type="submit"]:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

input[type="submit"]::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
	transform: translateX(-100%);
	transition: transform 0.6s ease;
}

input[type="submit"]:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(0, 86, 145, 0.6);
}

input[type="submit"]:hover::before {
	transform: translateX(100%);
}

input[type="submit"]:active:not(:disabled) {
	transform: translateY(0) scale(0.98);
	box-shadow: 0 2px 12px rgba(0, 86, 145, 0.4);
}

/* ── Auth feedback ────────────────────────────────────────── */
.auth-error,
.lockout-msg {
	text-align: center;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	margin-bottom: 1rem;
	line-height: 1.4;
	animation: fade-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-error {
	color: #fecaca;
	background: rgba(226, 0, 26, 0.15);
	border: 1px solid rgba(226, 0, 26, 0.35);
}

.lockout-msg {
	color: #fde68a;
	background: rgba(245, 158, 11, 0.12);
	border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ── Status badge (status page) ───────────────────────────── */
.status-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.65rem 1.25rem;
	margin: 0 auto 1.25rem;
	width: fit-content;
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(16, 185, 129, 0.35);
	border-radius: 50px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #6ee7b7;
	opacity: 0;
	animation: fade-slide-up 0.6s 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.status-dot {
	width: 10px;
	height: 10px;
	background: var(--success);
	border-radius: 50%;
	animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
	50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ── Footer ───────────────────────────────────────────────── */
copy-right {
	display: block;
	text-align: center;
	font-size: 0.7rem;
	font-weight: 400;
	font-style: normal;
	color: rgba(240, 244, 255, 0.35);
	line-height: 1.6;
	margin-top: 1.5rem;
	opacity: 0;
	animation: fade-slide-up 0.6s 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 380px) {
	body {
		padding: 0.75rem;
	}

	.insert {
		padding: 1.25rem;
		border-radius: 16px;
	}
}

@media (min-width: 768px) {
	.offset {
		max-width: 480px;
	}
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Bouton de redirection stylisé comme l'ancien submit */
.submit-btn-link {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #0077b6);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 86, 145, 0.45);
    transition: transform var(--transition), box-shadow var(--transition);
}

.submit-btn-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 86, 145, 0.6);
}
