/* ===================================
   STYLES DE BASE - Reset et fondations
   =================================== */

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

html {
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
	tab-size: 4;
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-body);
	font-size: var(--font-size-base);
	line-height: 1.6;
	color: var(--color-text-primary);
	background-color: var(--color-background);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Typographie */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	font-weight: 300;
	line-height: 1.2;
	color: var(--color-text-primary);
	margin: 0;
}

h1 {
	font-size: var(--font-size-6xl);
	letter-spacing: 0.025em;
}

h2 {
	font-size: var(--font-size-5xl);
	letter-spacing: 0.025em;
}

h3 {
	font-size: var(--font-size-3xl);
	letter-spacing: 0.025em;
}

h4 {
	font-size: var(--font-size-2xl);
}

h5 {
	font-size: var(--font-size-xl);
}

h6 {
	font-size: var(--font-size-lg);
}

p {
	margin: 0;
	color: var(--color-text-secondary);
	line-height: 1.7;
}

/* Liens */
a {
	color: inherit;
	text-decoration: none;
	transition: var(--transition-normal);
}

a:hover {
	color: var(--color-primary);
}

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

/* Images */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Boutons */
button {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: inherit;
	transition: var(--transition-normal);
}

button:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

/* Formulaires */
input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	color: inherit;
	word-spacing: normal !important;
	letter-spacing: normal !important;
	white-space: normal;
}

/* Spécifique aux textarea */
textarea {
	white-space: pre-wrap !important;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Spécifique aux inputs text */
input[type='text'],
input[type='email'] {
	white-space: normal !important;
}

input:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

/* Icônes SVG */
.icon {
	width: 1.5rem;
	height: 1.5rem;
	fill: currentColor;
	flex-shrink: 0;
	transition: var(--transition-normal);
}

.icon.star {
	color: #fbbf24;
}

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

/* Animations de base */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(2rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes scale {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes bounce {
	0%,
	20%,
	53%,
	80%,
	100% {
		transform: translateY(0);
	}
	40%,
	43% {
		transform: translateY(-0.5rem);
	}
	70% {
		transform: translateY(-0.25rem);
	}
	90% {
		transform: translateY(-0.125rem);
	}
}

@keyframes scroll {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(100%);
	}
}

/* Classes d'animation */
.animate-fade-in {
	animation: var(--animation-fade-in);
}

.animate-slide-up {
	animation: var(--animation-slide-up);
}

.animate-scale {
	animation: var(--animation-scale);
}

.animate-bounce {
	animation: bounce 2s infinite;
}

.animate-scroll {
	animation: scroll 2s ease-in-out infinite;
}

/* Délais d'animation */
.animation-delay-200 {
	animation-delay: 200ms;
}

.animation-delay-400 {
	animation-delay: 400ms;
}

.animation-delay-600 {
	animation-delay: 600ms;
}

.animation-delay-800 {
	animation-delay: 800ms;
}

/* États d'interaction */
.interactive:hover {
	transform: translateY(-2px);
}

.interactive:active {
	transform: translateY(0);
}

/* Sélection de texte */
::selection {
	background-color: var(--color-primary);
	color: var(--color-text-primary);
}

::-moz-selection {
	background-color: var(--color-primary);
	color: var(--color-text-primary);
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
	background: var(--color-border);
	border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--color-primary);
}

/* Médias queries de base */
@media (max-width: 768px) {
	html {
		font-size: 14px;
	}

	h1 {
		font-size: var(--font-size-4xl);
	}

	h2 {
		font-size: var(--font-size-3xl);
	}

	h3 {
		font-size: var(--font-size-2xl);
	}
}

/* États de chargement */
.loading {
	pointer-events: none;
	opacity: 0.6;
}

.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1rem;
	height: 1rem;
	margin: -0.5rem 0 0 -0.5rem;
	border: 2px solid transparent;
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

/* Focus visible pour l'accessibilité */
.focus-visible:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

/* Réduction de mouvement pour accessibilité */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	html {
		scroll-behavior: auto;
	}
}
