/* ============================================ */
/* BASE STYLES - Dark Mode ULTRA RENFORCÉ      */
/* Reset et styles de base avec couleurs forcées */
/* ============================================ */

/* Prévention débordement horizontal */
html,
body {
	overflow-x: hidden !important;
	max-width: 100vw !important;
	box-sizing: border-box !important;
}

* {
	max-width: 100% !important;
	box-sizing: border-box !important;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	/* Force le dark mode au niveau racine */
	color-scheme: dark only !important;
	background: #000000 !important; /* Force dès le HTML */
}

/* Body - Fond noir FORCÉ */
body {
	min-height: 100vh;
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	color: #f3f4f6 !important; /* Forcé */
	background: #000000 !important; /* Forcé */
	overflow-x: hidden;
	position: relative;
	/* Amélioration du rendu des polices sur fond noir */
	text-rendering: optimizeLegibility;
	font-feature-settings: 'kern' 1;
	font-kerning: normal;
}

/* Typographie - Couleurs FORCÉES pour fond noir */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: var(--font-bold);
	line-height: var(--leading-tight);
	letter-spacing: -0.02em;
	color: #ffffff !important; /* Forcé */
	text-shadow: 0 0 5px rgba(255, 255, 255, 0.1) !important; /* Ajout ombre pour visibilité */
}

h1 {
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: var(--font-black);
	color: #ffffff !important; /* Double force */
}

h2 {
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: var(--font-extrabold);
	color: #ffffff !important; /* Double force */
}

h3 {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: var(--font-bold);
	color: #ffffff !important; /* Double force */
}

h4 {
	font-size: clamp(1.25rem, 2.5vw, 1.5rem);
	color: #ffffff !important; /* Double force */
}

p {
	line-height: var(--leading-relaxed);
	color: #f3f4f6 !important; /* Forcé */
	text-shadow: 0 0 2px rgba(243, 244, 246, 0.05) !important;
}

/* Liens - Contraste MAXIMAL */
a {
	color: #a8c7ff !important; /* Forcé - bleu très clair */
	text-decoration: none;
	transition: var(--transition-base);
	position: relative;
}

a:hover {
	color: #ffffff !important; /* Forcé - blanc au hover */
}

a:focus-visible {
	outline: 2px solid #7da8f5 !important;
	outline-offset: 2px;
	border-radius: 2px;
}

/* Strong et emphasis */
strong,
b {
	font-weight: var(--font-semibold);
	color: #ffffff !important; /* Forcé */
}

em,
i {
	font-style: italic;
	color: #f9fafb !important; /* Forcé */
}

/* Code inline */
code {
	font-family: var(--font-mono);
	font-size: 0.875em;
	padding: 0.125rem 0.25rem;
	background: #1a1a1a !important; /* Forcé */
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	border-radius: var(--radius-sm);
	color: #a8c7ff !important; /* Forcé */
}

/* Images & Media */
img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Formulaires - Dark mode FORCÉ */
input,
button,
textarea,
select {
	font: inherit;
	color: #f3f4f6 !important; /* Forcé */
	background: #121212 !important; /* Forcé */
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	border-radius: var(--radius-md);
}

button {
	cursor: pointer;
	transition: var(--transition-base);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Focus states RENFORCÉS */
input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: #7da8f5 !important;
	box-shadow: 0 0 0 3px rgba(125, 168, 245, 0.2) !important;
	background: #000000 !important; /* Force background au focus */
}

/* Placeholders */
::placeholder {
	color: #9ca3af !important; /* Forcé */
	opacity: 1;
}

/* Listes */
ul,
ol {
	list-style: none;
}

/* Container responsive */
.container {
	width: 100%;
	max-width: var(--container-xl);
	margin: 0 auto;
	padding: 0 var(--space-lg);
}

@media (min-width: 768px) {
	.container {
		padding: 0 var(--space-xl);
	}
}

/* Sections - Fond noir FORCÉ */
section {
	padding: var(--space-4xl) 0;
	position: relative;
	background: #000000 !important; /* Forcé */
}

@media (min-width: 768px) {
	section {
		padding: calc(var(--space-4xl) * 1.5) 0;
	}
}

/* Classes utilitaires */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.text-center {
	text-align: center;
}

.text-left {
	text-align: left;
}

.text-right {
	text-align: right;
}

/* Sélection de texte - Contraste MAXIMAL */
::selection {
	background: #7da8f5 !important;
	color: #000000 !important; /* Forcé */
}

::-moz-selection {
	background: #7da8f5 !important;
	color: #000000 !important; /* Forcé */
}

/* Focus visible global RENFORCÉ */
:focus-visible {
	outline: 2px solid #7da8f5 !important;
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* Scrollbar personnalisée - Dark mode FORCÉ */
::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

::-webkit-scrollbar-track {
	background: #121212 !important; /* Forcé */
	border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
	background: #2a2a2a !important; /* Forcé */
	border-radius: var(--radius-md);
	border: 2px solid #121212 !important;
	transition: var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
	background: #7da8f5 !important; /* Forcé */
}

/* Firefox scrollbar */
* {
	scrollbar-width: thin;
	scrollbar-color: #2a2a2a #121212 !important; /* Forcé */
}

/* Cursor glow effect - Plus visible sur fond noir */
.cursor-glow {
	position: fixed;
	width: 200px;
	height: 200px;
	pointer-events: none;
	border-radius: 50%;
	background: radial-gradient(
		circle,
		rgba(125, 168, 245, 0.15) 0%,
		transparent 60%
	) !important; /* Forcé avec plus d'intensité */
	mix-blend-mode: screen;
	filter: blur(40px);
	transform: translate(-50%, -50%);
	z-index: var(--z-max);
	opacity: 0.8; /* Plus visible */
	transition: opacity var(--transition-slow);
}

@media (pointer: coarse) {
	.cursor-glow {
		display: none;
	}
}

/* ============================= */
/* SURCHARGE SPÉCIALE MOBILE     */
/* Force absolue pour problème double dark */
/* ============================= */

/* Mobile général */
@media (max-width: 768px) {
	/* Force tous les éléments critiques */
	html {
		background: #000000 !important;
		color-scheme: dark only !important;
	}

	body {
		background: #000000 !important;
		color: #f9fafb !important;
	}

	/* Force tous les titres */
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	.hero-title,
	.section-title,
	.brand-text,
	.gradient-text-animated {
		color: #ffffff !important;
		-webkit-text-fill-color: #ffffff !important;
		text-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
	}

	/* Force tous les paragraphes */
	p,
	.hero-subtitle,
	.section-desc {
		color: #f9fafb !important;
		text-shadow: 0 0 5px rgba(249, 250, 251, 0.1) !important;
	}

	/* Force les liens */
	a {
		color: #bbd4ff !important;
	}

	a:hover {
		color: #ffffff !important;
	}

	/* Force les formulaires sur mobile */
	input,
	textarea,
	select {
		background: #000000 !important;
		color: #f9fafb !important;
		border-color: rgba(255, 255, 255, 0.2) !important;
	}

	input:focus,
	textarea:focus,
	select:focus {
		background: #000000 !important;
		color: #ffffff !important;
		border-color: #7da8f5 !important;
	}

	/* Augmentation de la taille de base pour meilleure lisibilité */
	html {
		font-size: 17px;
	}

	/* Zones de tap plus grandes */
	button,
	a,
	input,
	select,
	textarea {
		min-height: 44px;
		min-width: 44px;
	}

	/* Espacements adaptés mobile */
	section {
		padding: var(--space-3xl) 0;
	}
}

/* Mobile + Dark Mode Système - TRIPLE FORCE */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
	/* Force absolue sur TOUS les éléments textuels */
	*,
	*::before,
	*::after {
		color: inherit !important;
	}

	html {
		background: #000000 !important;
		color: #f9fafb !important;
	}

	body {
		background: #000000 !important;
		color: #f9fafb !important;
	}

	/* Force directe sur chaque élément critique */
	.brand-text,
	.hero-title,
	.word-rotate span,
	.word-rotate span.active,
	.gradient-text-animated,
	.price-highlight,
	.section-title,
	.title-gradient,
	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: #ffffff !important;
		-webkit-text-fill-color: #ffffff !important;
		text-shadow: 0 0 15px rgba(255, 255, 255, 0.3) !important;
		background: none !important; /* Annule les gradients si problème */
	}

	.hero-subtitle,
	.section-desc,
	p,
	span:not(.brand-text):not(.gradient-text-animated):not(.price-highlight),
	div:not([class*='gradient']) {
		color: #f9fafb !important;
		text-shadow: 0 0 8px rgba(249, 250, 251, 0.2) !important;
	}

	/* Force les liens avec contraste maximal */
	a,
	.nav-menu a,
	.project-link,
	.footer-links a {
		color: #bbd4ff !important;
		text-shadow: 0 0 5px rgba(187, 212, 255, 0.3) !important;
	}

	a:hover,
	.nav-menu a:hover,
	.project-link:hover,
	.footer-links a:hover {
		color: #ffffff !important;
		text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
	}

	/* Force backgrounds pour tous conteneurs */
	body,
	html,
	.hero,
	.explications-section,
	.services-section,
	.portfolio-section,
	.process-section,
	.about-section,
	.contact-section,
	.footer-modern,
	section {
		background: #000000 !important;
	}

	.card-base,
	.process-card,
	.service-card,
	.contact-form,
	.portfolio-card,
	.explication-card,
	.tech-benefits,
	.navbar,
	.nav-menu {
		background: #121212 !important;
		border-color: rgba(255, 255, 255, 0.2) !important;
	}

	/* Force formulaires */
	input,
	textarea,
	select,
	button {
		background: #000000 !important;
		color: #f9fafb !important;
		border-color: rgba(255, 255, 255, 0.2) !important;
	}

	input:focus,
	textarea:focus,
	select:focus {
		background: #000000 !important;
		color: #ffffff !important;
		border-color: #7da8f5 !important;
		box-shadow: 0 0 0 3px rgba(125, 168, 245, 0.3) !important;
	}

	::placeholder {
		color: #9ca3af !important;
		opacity: 1 !important;
	}
}

/* Très petits écrans - Force additionnelle */
@media (max-width: 480px) and (prefers-color-scheme: dark) {
	/* Sur très petits écrans, force encore plus */
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	.hero-title,
	.section-title,
	.brand-text {
		color: #ffffff !important;
		-webkit-text-fill-color: #ffffff !important;
		text-shadow: 0 0 20px rgba(255, 255, 255, 0.4) !important;
		font-weight: 800 !important; /* Plus gras pour plus de visibilité */
	}

	p,
	.hero-subtitle,
	.section-desc {
		color: #ffffff !important; /* Blanc pur même pour les paragraphes */
		text-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
		font-weight: 500 !important; /* Légèrement plus gras */
	}
}

/* Désactivation des animations si préférence système */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.cursor-glow {
		display: none;
	}
}

/* Support du mode contraste élevé - ULTRA RENFORCÉ */
@media (prefers-contrast: high) {
	body {
		font-weight: 600; /* Plus gras */
		color: #ffffff !important; /* Blanc pur */
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: #ffffff !important;
		font-weight: 900 !important; /* Ultra gras */
		text-shadow: 0 0 20px rgba(255, 255, 255, 0.5) !important;
	}

	p {
		color: #ffffff !important; /* Même les paragraphes en blanc */
		font-weight: 500 !important;
	}

	a {
		color: #bbd4ff !important;
		text-decoration: underline;
		text-decoration-thickness: 2px;
		text-underline-offset: 3px;
		font-weight: 600 !important;
	}

	button,
	input,
	select,
	textarea {
		border-width: 3px !important;
		font-weight: 600 !important;
	}
}

/* Print styles - Fond blanc pour impression */
@media print {
	body {
		background: white !important;
		color: black !important;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: black !important;
	}

	p {
		color: black !important;
	}

	.cursor-glow,
	::-webkit-scrollbar {
		display: none !important;
	}
}
