/* Variables CSS pour les thèmes */
:root {
    --color-primary: #F97316;
    --color-primary-dark: #EA580C;
    --color-primary-light: #FDBA74;
    --color-secondary: #4B5563;
    --color-secondary-dark: #374151;
    --color-background: #F9FAFB;
    --color-surface: #FFFFFF;
    --color-text: #1F2937;
    --color-text-muted: #6B7280;
    --color-error: #EF4444;
    --color-success: #10B981;
    --color-border: #E5E7EB;
}

.dark-mode {
    --color-primary: #F97316;
    --color-primary-dark: #FDBA74;
    --color-primary-light: #9A3412;
    --color-secondary: #9CA3AF;
    --color-secondary-dark: #E5E7EB;
    --color-background: #111827;
    --color-surface: #1F2937;
    --color-text: #F9FAFB;
    --color-text-muted: #D1D5DB;
    --color-error: #EF4444;
    --color-success: #10B981;
    --color-border: #374151;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Style pour les champs en erreur */
.border-red-500 {
    border-color: #ef4444 !important;
}

/* Animation pour les champs en erreur */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-container:has(.error-message-client:not([style*="display: none"])) {
    animation: shake 0.5s ease-in-out;
}

/* Style amélioré pour les messages d'erreur */
.error-message-client {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-message-client::before {
    content: "⚠";
    font-size: 0.75rem;
}
/* Styles de base */
.form-container {
    overflow: hidden;
    width: 100%;
}

.animation-container {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
    overflow: visible !important;
}

input, select {
    width: 100% !important;
    transform-origin: center;
    transition: all 0.2s ease;
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
    }

    .max-w-4xl {
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    .step-indicators {
        display: none;
    }
}

.wide-input {
    width: 100% !important;
    padding-left: 2.5rem;
    padding-right: 1rem;
}

.radio-container {
    overflow: visible !important;
}

input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2) !important;
    outline: none;
    border-color: var(--color-primary);
}

/* Styles améliorés avec thème corporate/culturel */
.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    z-index: 10;
}

input:focus + .input-icon {
    color: var(--color-primary);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-text-muted);
    z-index: 10;
}

.password-strength {
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.progress-bar {
    height: 4px;
    background-color: var(--color-primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-color: rgba(249, 115, 22, 0.2);
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.step-indicator.active {
    background-color: var(--color-primary);
    color: white;
}

.step-indicator.completed {
    background-color: var(--color-success);
    color: white;
}

.error-message {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
}

.input-error {
    border-color: var(--color-error) !important;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-checkmark {
    display: none;
    color: var(--color-success);
}

/* Styles pour l'animation des étapes */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Amélioration de l'apparence des boutons */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

/* Animation de transition entre les étapes */
.step-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.step-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.step-transition-exit {
    opacity: 1;
    transform: translateX(0);
}

.step-transition-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

/* Correction pour les icônes dans les selects */
select {
    appearance: none;
}

/* Nouveaux styles pour l'arrière-plan animé et le thème corporate/culturel */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

.bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23F97316' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: patternMove 80s linear infinite;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0) 70%);
    animation: float 15s infinite ease-in-out;
    will-change: transform;
}

.floating-element:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
    animation-duration: 20s;
}

.floating-element:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
    animation-duration: 18s;
}

.floating-element:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 20%;
    animation-delay: -10s;
    animation-duration: 16s;
}

.floating-element:nth-child(4) {
    width: 250px;
    height: 250px;
    bottom: 30%;
    left: 10%;
    animation-delay: -15s;
    animation-duration: 22s;
}

@keyframes patternMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 1000px 1000px;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-8px) rotate(2deg) scale(1.02);
    }
    50% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    75% {
        transform: translateY(8px) rotate(-2deg) scale(0.98);
    }
}

.cultural-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23F97316' fill-opacity='0.1'%3E%3Cpath fill-rule='evenodd' d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2l-2 2V0zm0 4l4-4h2l-6 6V4zm0 4l8-8h2L40 10V8zm0 4L52 0h2L40 14v-2zm0 4L56 0h2L40 18v-2zm0 4L60 0h2L40 22v-2zm0 4L64 0h2L40 26v-2zm0 4L68 0h2L40 30v-2zm0 4L72 0h2L40 34v-2zm0 4L76 0h2L40 38v-2zm0 4L80 0v2L42 40h-2zm4 0L80 4v2L46 40h-2zm4 0L80 8v2L50 40h-2zm4 0l28-28v2L54 40h-2zm4 0l24-24v2L58 40h-2zm4 0l20-20v2L62 40h-2zm4 0l16-16v2L66 40h-2zm4 0l12-12v2L70 40h-2zm4 0l8-8v2l-6 6h-2zm4 0l4-4v2l-2 2h-2z'/%3E%3C/g%3E%3C/svg%3E");
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    animation: patternRotate 80s linear infinite;
    will-change: transform;
}

@keyframes patternRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.corporate-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .corporate-card {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.illustration-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.cultural-motif {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-width='2'%3E%3Cpath d='M10 10h32v32H10z'/%3E%3Cpath d='M26 10V42'/%3E%3Cpath d='M10 26H42'/%3E%3Cpath d='M15 15l22 22'/%3E%3Cpath d='M37 15L15 37'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.05;
    animation: motifPulse 20s infinite alternate ease-in-out;
}

@keyframes motifPulse {
    0% {
        opacity: 0.03;
        transform: scale(1);
    }
    100% {
        opacity: 0.08;
        transform: scale(1.1);
    }
}

/* Bouton mode sombre */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Animation supplémentaire pour les inputs */
@keyframes inputPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.input-pulse {
    animation: inputPulse 0.3s ease;
}

/* Animation pour les transitions d'étapes */
.step-transition {
    animation: stepTransition 0.4s ease forwards;
}

@keyframes stepTransition {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation pour les icônes */
.input-icon {
    transition: all 0.3s ease;
}

/* Animation pour les boutons */
.btn-animate {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-animate:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-animate:focus:not(:active)::after {
    animation: ripple 0.8s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Animation pour la carte - MODIFIÉ POUR PLUS DE FLUIDITÉ */
@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(0.5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(2px) rotate(-0.5deg);
    }
}

.card-float {
    animation: cardFloat 8s ease-in-out infinite;
    will-change: transform;
}

/* Classe pour arrêter l'animation */
.card-static {
    animation: none;
    transform: translateY(0) rotate(0deg);
}

/* Styles pour le bouton home */
.home-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.home-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background-color: var(--color-primary-dark);
}

/* Animation de ripple pour le bouton home */
.home-toggle:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.home-toggle:focus:not(:active)::after {
    animation: ripple 0.8s ease-out;
}

/* Animation de pulse au survol */
@keyframes homePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.home-toggle:hover {
    animation: homePulse 2s infinite;
}

/* Animation d'entrée */
.home-toggle {
    animation: homeEntrance 0.6s ease-out;
}

@keyframes homeEntrance {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Adaptation pour le mode sombre */
.dark-mode .home-toggle {
    background-color: var(--color-primary);
    color: var(--color-text);
}

.dark-mode .home-toggle:hover {
    background-color: var(--color-primary-dark);
}

/* Amélioration de la performance des animations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimisation pour les transitions */
.corporate-card,
.theme-toggle,
.home-toggle,
input,
select,
button {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}
