/* ==========================================
   STYLE FINANCE PROFESSIONNEL - Calédonie Loto
   Design sobre, élégant et sécurisé
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ==========================================
   VARIABLES FINANCE
   ========================================== */
:root {
    /* Palette Finance Sobre */
    --primary-navy: #0F172A;        /* Bleu marine très foncé */
    --primary-blue: #1E3A8A;        /* Bleu royal professionnel */
    --accent-gold: #D4AF37;         /* Or élégant */
    --accent-green: #047857;        /* Vert finance (positif) */
    --accent-red: #DC2626;          /* Rouge finance (alerte) */
    
    /* Neutres élégants */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Dégradés sobres */
    --gradient-navy: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #B8930C 100%);
    --gradient-subtle: linear-gradient(to bottom, #FFFFFF, #F9FAFB);
    
    /* Ombres élégantes */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    overflow-x: hidden;
}

/* ==========================================
   TYPOGRAPHIE SOBRE
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'IBM Plex Sans', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--primary-navy);
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

/* ==========================================
   GESTION DES ÉTAPES
   ========================================== */
.step-container {
    display: none;
    opacity: 0;
}

.step-container.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   HEADER PROFESSIONNEL
   ========================================== */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo sobre */
.logo-text {
    color: var(--primary-navy);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Navigation épurée */
nav a {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
    transition: color var(--transition-base);
    text-decoration: none;
}

nav a:hover {
    color: var(--primary-blue);
}

/* Indicateurs d'étapes minimalistes */
.step-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: all var(--transition-base);
}

.step-indicator.active {
    background: var(--primary-blue) !important;
    width: 12px;
    height: 12px;
}

.step-indicator.completed {
    background: var(--accent-green) !important;
}

/* ==========================================
   HERO SECTION SOBRE
   ========================================== */
.hero-gradient {
    background: var(--gradient-navy);
    position: relative;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
}

/* Animation icône subtile */
.hero-icon {
    animation: subtleFloat 3s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ==========================================
   CONFETTIS DISCRETS
   ========================================== */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.3;
}

.confetti {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    animation: confettiFall 2.5s linear infinite;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.5s; }
.confetti:nth-child(3) { left: 30%; animation-delay: 1s; }
.confetti:nth-child(4) { left: 40%; animation-delay: 1.5s; }
.confetti:nth-child(5) { left: 50%; animation-delay: 2s; }
.confetti:nth-child(6) { left: 60%; animation-delay: 2.5s; }
.confetti:nth-child(7) { left: 70%; animation-delay: 3s; }
.confetti:nth-child(8) { left: 80%; animation-delay: 3.5s; }

@keyframes confettiFall {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(80px);
        opacity: 0;
    }
}

/* ==========================================
   CARTES DE GAINS - SYSTÈME ROBUSTE
   ========================================== */
.gain-card {
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    height: 100%;
}

.gain-card .card-content {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gain-card:hover .card-content {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.gain-card.selected .card-content {
    border-color: var(--accent-green);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.15);
    background: rgba(4, 120, 87, 0.02);
}

/* Badge de sélection */
.gain-card.selected::after {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--accent-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    animation: checkmark 0.3s ease forwards;
}

/* ZONE D'IMAGE - CORRECTION COMPLÈTE */
.image-zone {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    background: var(--gray-100);
    display: block;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.image-zone img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-base);
}

.gain-card:hover .image-zone img {
    transform: scale(1.08);
}

/* Pour les emojis (si pas d'image réelle) */
.image-zone .emoji-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    line-height: 1;
}

/* CONTENU DE LA CARTE */
.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin: 0;
    line-height: 1.4;
}

.card-body p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.card-body .select-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: auto;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gain-card:hover .card-body .select-text {
    opacity: 1;
}

.select-text svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================
   FORMULAIRES PROFESSIONNELS
   ========================================== */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--gray-900);
    transition: all var(--transition-base);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--gray-400);
}

input.error {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Labels professionnels */
label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* Messages d'erreur sobres */
.error-message {
    color: var(--accent-red);
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
}

/* ==========================================
   BOUTONS PROFESSIONNELS
   ========================================== */
button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton principal */
.btn-primary {
    background: var(--primary-blue);
    color: white;
    padding: 14px 28px;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: #1E40AF;
    box-shadow: var(--shadow-lg);
}

/* Bouton secondaire */
.btn-secondary {
    background: var(--accent-green);
    color: white;
    padding: 14px 28px;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: #059669;
}

/* Bouton outline */
.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 12px 26px;
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

/* Bouton avec gradient doré (pour gain) */
.btn-gold {
    background: var(--gradient-gold);
    color: var(--primary-navy);
    padding: 14px 28px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

/* ==========================================
   CARTES & CONTENEURS
   ========================================== */
.card-glass {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.card-solid {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.card-gradient {
    background: var(--gradient-navy);
    border-radius: var(--radius-xl);
    padding: 32px;
    color: white;
    box-shadow: var(--shadow-xl);
}

/* ==========================================
   BADGES & ALERTES
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.badge-gold {
    background: rgba(212, 175, 55, 0.1);
    color: #B8930C;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-blue {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(30, 58, 138, 0.3);
}

.badge-green {
    background: rgba(4, 120, 87, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(4, 120, 87, 0.3);
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: start;
    gap: 12px;
    border: 1px solid var(--gray-200);
}

.alert-info {
    background: rgba(30, 58, 138, 0.05);
    border-color: rgba(30, 58, 138, 0.2);
}

.alert-success {
    background: rgba(4, 120, 87, 0.05);
    border-color: rgba(4, 120, 87, 0.2);
}

.alert-warning {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.2);
}

/* ==========================================
   SECTIONS SPÉCIFIQUES
   ========================================== */

/* Section hero sobre */
#step1 .hero-gradient {
    min-height: 50vh;
    display: flex;
    align-items: center;
}

/* Section de gain */
#step2 {
    background: var(--gradient-subtle);
}

/* Section de sélection */
#step3 {
    background: var(--white);
}

/* Section formulaire */
#step4 {
    background: var(--gray-50);
}

/* Section finale */
#step5 {
    background: var(--gradient-subtle);
}

/* ==========================================
   FOOTER PROFESSIONNEL
   ========================================== */
footer {
    background: var(--primary-navy);
    color: var(--gray-300);
}

footer h3, footer h4 {
    color: var(--white);
    font-weight: 600;
}

footer a {
    color: var(--gray-400);
    transition: color var(--transition-base);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-gold);
}

/* Ligne dorée en haut du footer */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
}

/* ==========================================
   SCROLLBAR SOBRE
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .card-glass, .card-solid, .card-gradient {
        padding: 24px;
    }
    
    /* Images des cartes en tablet */
    .image-zone {
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .card-glass, .card-solid, .card-gradient {
        padding: 20px;
    }
    
    button {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
    
    /* Images des cartes en mobile */
    .image-zone {
        height: 160px !important;
        min-height: 160px !important;
        max-height: 160px !important;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .card-body h3 {
        font-size: 1rem;
    }
    
    .card-body p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .confetti {
        width: 3px;
        height: 3px;
    }
    
    .step-indicator {
        width: 8px;
        height: 8px;
    }
    
    .step-indicator.active {
        width: 10px;
        height: 10px;
    }
    
    /* Images des cartes en petit mobile */
    .image-zone {
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
    }
    
    .image-zone .emoji-icon {
        font-size: 3.5rem;
    }
    
    .card-body {
        padding: 14px;
    }
}

/* ==========================================
   ACCESSIBILITÉ
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible sobre */
*:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ==========================================
   UTILITAIRES
   ========================================== */
.text-gradient {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-finance {
    box-shadow: var(--shadow-lg);
}

.border-gold {
    border-color: var(--accent-gold) !important;
}

.bg-gold {
    background: var(--gradient-gold) !important;
}

.bg-navy {
    background: var(--gradient-navy) !important;
}

/* Effet de ligne dorée */
.gold-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
}

/* ==========================================
   ANIMATIONS SUBTILES
   ========================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.4s ease forwards;
}

/* Suppression des animations excessives */
.animate-pulse-slow,
.animate-bounce-slow {
    animation: none;
}

/* Animation subtile pour validation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-checkmark {
    animation: checkmark 0.3s ease forwards;
}

/* ==========================================
   STATES SPÉCIAUX
   ========================================== */

/* Chargement sobre */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* Success state */
.success {
    border-color: var(--accent-green) !important;
    background: rgba(4, 120, 87, 0.02) !important;
}

/* Error state */
.error {
    border-color: var(--accent-red) !important;
    background: rgba(220, 38, 38, 0.02) !important;
}

/* ==========================================
   PRINT STYLES emails js  winner nazareth 
   ========================================== */
@media print {
    header, footer, .step-indicator {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card-glass, .card-solid {
        border: 1px solid var(--gray-300);
        box-shadow: none;
        page-break-inside: avoid;
    }
}