/* ============================================
   ONBOARDING PAGE - CAHIER STYLE FINAL
   ============================================ */

/* Local Sniglet Font */
@font-face {
    font-family: 'Sniglet';
    src: url('/assets/fonts/Sniglet-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sniglet';
    src: url('/assets/fonts/Sniglet-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Palette Bleu Blanc Rouge Vivant */
    --first-color: 37, 99, 235;
    /* Royal Blue */
    --second-color: 220, 38, 38;
    /* Red */
    --third-color: 147, 197, 253;
    /* Light Blue */
    --fourth-color: 252, 165, 165;
    /* Light Red */
    --fifth-color: 255, 255, 255;
    /* White */

    --pointer-color: 59, 130, 246;
    --size: 80%;
    --blending-value: multiply;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Sniglet', sans-serif !important;
    font-weight: 400 !important;
}

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: #ffffff;
    color: #1e3a8a;
}

/* ============================================
   BACKGROUND ANIMATION + SEYÈS GRID
   ============================================ */

.bg-container {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: white;
    z-index: 0;
}

/* Le quadrillage Seyès en pleine page (UNE SEULE FEUILLE RÉALISTE) */
/* Le quadrillage Seyès en pleine page (EXACT MATCH LANDING) */
.bg-container::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    /* Carreaux de 32px - IDENTIQUE LANDING */
    background-image:
        /* Lignes horizontales principales (tous les 32px) */
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 31px,
            #b8d4e8 31px,
            #b8d4e8 32px),
        /* Lignes horizontales secondaires fines (tous les 8px) */
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 7px,
            #d8e8f4 7px,
            #d8e8f4 8px),
        /* Lignes verticales (tous les 32px) */
        repeating-linear-gradient(to right,
            transparent,
            transparent 31px,
            #c8dce8 31px,
            #c8dce8 32px);

    background-size: 100% 100%;
    /* S'adapte au conteneur */
    /* Pour garder la proportion exacte, on pourrait forcer un background-size fixe si besoin, mais 100% 100% sur un div absolute fill donne le même résultat que sur landing */
    /* Cependant sur landing c'est 100% 100% de la page (document height). Ici c'est 100vh fixés. */
    /* Pour éviter la distorsion si width != height, on préfère souvent laisser le gradient se répeter naturellement ou utiliser background-size: 32px 32px pour grid */
    /* MAIS le code de landing utilise background-size: 100% 100% sur gradients. */

    background-attachment: fixed;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* Les Blobs colorés (derrière le quadrillage) */
.gradients-container {
    display: none !important;
    /* Tâches supprimées */
    filter: url(#blurMe) blur(40px);
    width: 100%;
    height: 100%;
    opacity: 0.5;
    position: relative;
    z-index: 1;
}

.gradient-blob {
    position: absolute;
    width: var(--size);
    height: var(--size);
    top: calc(50% - var(--size) / 2);
    left: calc(50% - var(--size) / 2);
    mix-blend-mode: var(--blending-value);
}

/* Animations lentes */
.animate-first {
    background: radial-gradient(circle at center, rgba(var(--first-color), 0.8) 0, rgba(var(--first-color), 0) 50%) no-repeat;
    transform-origin: center center;
    animation: moveVertical 60s ease infinite;
}

.animate-second {
    background: radial-gradient(circle at center, rgba(var(--second-color), 0.6) 0, rgba(var(--second-color), 0) 50%) no-repeat;
    transform-origin: calc(50% - 400px);
    animation: moveInCircle 50s reverse infinite;
}

.animate-third {
    background: radial-gradient(circle at center, rgba(var(--third-color), 0.8) 0, rgba(var(--third-color), 0) 50%) no-repeat;
    transform-origin: calc(50% + 400px);
    animation: moveInCircle 80s linear infinite;
}

.animate-fourth {
    background: radial-gradient(circle at center, rgba(var(--fourth-color), 0.7) 0, rgba(var(--fourth-color), 0) 50%) no-repeat;
    transform-origin: calc(50% - 200px);
    animation: moveHorizontal 70s ease infinite;
}

.animate-fifth {
    background: radial-gradient(circle at center, rgba(var(--fifth-color), 1) 0, rgba(var(--fifth-color), 0) 50%) no-repeat;
    transform-origin: calc(50% - 800px) calc(50% + 200px);
    animation: moveInCircle 40s ease infinite;
}

.interactive {
    background: radial-gradient(circle at center, rgba(var(--pointer-color), 0.8) 0, rgba(var(--pointer-color), 0) 50%) no-repeat;
    width: 100%;
    height: 100%;
    top: -50%;
    left: -50%;
    opacity: 0.7;
}

@keyframes moveVertical {
    0% {
        transform: translateY(-50%);
    }

    50% {
        transform: translateY(50%);
    }

    100% {
        transform: translateY(-50%);
    }
}

@keyframes moveInCircle {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes moveHorizontal {
    0% {
        transform: translateX(-50%) translateY(-10%);
    }

    50% {
        transform: translateX(50%) translateY(10%);
    }

    100% {
        transform: translateX(-50%) translateY(-10%);
    }
}

/* ============================================
   CONTENT LAYOUT
   ============================================ */

.onboarding-wrapper {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Aligné en haut pour stabilité */
    padding: 20px;
    padding-top: 5px;
    /* Espace minimal depuis le haut */

    /* Animation gérée par JS (slide-enter-from-right ou slide-enter-from-left) */
}

/* STYLE PTIT COCHON RECTANGULAIRE */
.back-link {
    position: absolute;
    top: 20px;
    left: 40px;
    color: #2563EB;
    text-decoration: none;
    font-family: 'Sniglet', sans-serif;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    background: white;
    padding: 10px 22px;
    border-radius: 16px;
    border: 2px solid #2563EB;
    box-shadow: none;
}

.back-link:hover {
    background: #2563EB;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.back-link:active {
    transform: translateY(0);
    box-shadow: none;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 0;
    /* Plus de marge ici */
    position: relative;
    z-index: 10;
    /* Pour que le logo passe au-dessus de la carte si bordure */
}

/* LOGO STYLING - Ajusté et redressé */
.onboarding-logo {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15));
    margin-bottom: -25px;
    /* Remonte la carte de ~1cm visuellement en chevauchant ou collant */
    margin-top: 0;
    transform: none;
    transition: transform 0.3s ease;
}

.onboarding-logo:hover {
    transform: scale(1.05);
}

/* TITRE AMÉLIORÉ */
.onboarding-title {
    font-size: 4.5rem;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.1;
    text-shadow:
        3px 3px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transform: rotate(-2deg);
    /* Légère rotation ludique */
}

.onboarding-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
}

/* ============================================
   CARD DESIGN (Plus compacte)
   ============================================ */

.onboarding-card {
    background: white;
    border: 3px solid #1e3a8a;
    border-radius: 28px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    min-height: 500px;
    box-shadow: 0 8px 30px rgba(30, 58, 138, 0.12);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step-title {
    font-size: 3.5rem;
    color: #2563EB;
    text-align: center;
    margin-bottom: 25px;
}

/* ============================================
   USER TYPE CARDS
   ============================================ */

.user-type-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.type-card {
    background: white;
    border: 3px solid #1e3a8a;
    border-radius: 28px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 4px 4px 0 rgba(30, 58, 138, 0.1);
}

.type-card:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
}

.type-card.selected {
    background: #EFF6FF;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px #2563EB inset, 0 8px 30px rgba(37, 99, 235, 0.15);
}

.type-icon {
    font-size: 3.5rem;
}

.type-label {
    color: #2563EB;
    font-weight: 400;
    font-size: 1.8rem;
    font-family: 'Sniglet', sans-serif;
}

/* ============================================
   FORMS
   ============================================ */

.form-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.form-label {
    display: block;
    color: #1e3a8a;
    margin-bottom: 8px;
    font-size: 1.8rem;
    font-weight: 400;
    font-family: 'Sniglet', sans-serif;
    padding-left: 5px;
}

.form-input,
.form-select {
    width: 100%;
    background: #fff;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    padding: 12px 18px;
    color: #1e3a8a;
    font-size: 1.6rem;
    font-weight: 400;
    font-family: 'Sniglet', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0 rgba(147, 197, 253, 0.2);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 3px 3px 0 rgba(96, 165, 250, 0.3);
    transform: translate(-1px, -1px);
}

.form-select option {
    background: #111;
}

.form-select option[disabled] {
    color: #93c5fd;
}

.form-input::placeholder {
    color: #93c5fd;
}

/* Select showing placeholder (disabled selected) */
.form-select:invalid,
.form-select:has(option[disabled]:checked) {
    color: #93c5fd;
}

/* ============================================
   COUNTRY "AUTRE" MODAL
   ============================================ */
.autre-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 58, 138, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.autre-modal-card {
    background: white;
    border: 3px solid #1e3a8a;
    border-radius: 24px;
    padding: 35px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(30, 58, 138, 0.3);
    animation: slideUp 0.3s ease;
}

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

.autre-modal-title {
    font-family: 'Sniglet', sans-serif;
    font-size: 2rem;
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 20px;
}

.autre-modal-input {
    width: 100%;
    margin-bottom: 15px;
}

.autre-modal-info {
    font-family: 'Sniglet', sans-serif;
    font-size: 1.3rem;
    color: #60a5fa;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(147, 197, 253, 0.15);
    border-radius: 12px;
}

.autre-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.autre-modal-btn {
    padding: 12px 30px;
    border-radius: 12px;
    font-family: 'Sniglet', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.autre-modal-btn.cancel {
    background: white;
    border: 2px solid #93c5fd;
    color: #60a5fa;
}

.autre-modal-btn.cancel:hover {
    background: #f0f7ff;
    border-color: #60a5fa;
}

.autre-modal-btn.confirm {
    background: #1e3a8a;
    border: none;
    color: white;
    box-shadow: 4px 4px 0 rgba(30, 58, 138, 0.3);
}

.autre-modal-btn.confirm:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(30, 58, 138, 0.3);
}

/* ============================================
   AVATAR SELECTOR (Curio)
   ============================================ */
.avatar-selector-onboarding {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: center;
}

.avatar-btn-onboarding {
    width: 110px;
    height: 110px;
    border: 3px solid #E5E7EB;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.avatar-btn-onboarding img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-btn-onboarding:hover {
    border-color: #8B5CF6;
    transform: scale(1.1);
}

.avatar-btn-onboarding.selected {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.3);
}

/* ============================================
   BUTTONS (Style PTIT COCHON)
   ============================================ */

.btn-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.btn-next,
.btn-submit {
    background: #2563EB;
    /* Bleu Roi */
    color: white;
    border: 2px solid #1E40AF;
    border-radius: 16px;
    /* Quasi rectangulaire */
    padding: 12px 40px;
    font-family: 'Sniglet', sans-serif;
    /* POLICE PTIT COCHON */
    font-size: 1.8rem;
    /* Un peu plus grand pour cette police */
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: none;
    /* Ombre solide foncée marquee */
    transform: translate(0, 0);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-next:hover,
.btn-submit:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    /* Effet d'enfoncement */
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-next:active,
.btn-submit:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-next:disabled,
.btn-submit:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    border-color: #9CA3AF;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    background: white;
    border: 2px solid #1e3a8a;
    color: #1e3a8a;
    border-radius: 16px;
    padding: 12px 35px;
    font-family: 'Sniglet', sans-serif;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    text-transform: uppercase;
}

.btn-back:hover {
    background: #F3F4F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.btn-back:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
   DECORATIVE
   ============================================ */

.step-indicator {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(30, 58, 138, 0.2);
    transition: all 0.3s ease;
}

.dot.active {
    background: #2563EB;
    width: 35px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .user-type-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .onboarding-title {
        font-size: 3rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CHECKBOX CGU STYLE
   ============================================ */
.cgu-container {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    width: 100%;
}

.cgu-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #4b5563;
    font-family: 'Sniglet', sans-serif;
    user-select: none;
    text-align: center;
}

/* Hide default checkbox */
.cgu-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkbox */
.cgu-custom-checkbox {
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #1e3a8a;
    border-radius: 16px;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 rgba(30, 58, 138, 0.1);
}

.cgu-label:hover .cgu-custom-checkbox {
    border-color: #2563EB;
    box-shadow: 3px 3px 0 rgba(37, 99, 235, 0.2);
}

/* Checked State */
.cgu-input:checked~.cgu-custom-checkbox {
    background-color: #2563EB;
    border-color: #1e3a8a;
}

/* Checkmark */
.cgu-custom-checkbox::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.cgu-input:checked~.cgu-custom-checkbox::after {
    display: block;
}

.cgu-text {
    font-family: 'Sniglet', sans-serif;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #93c5fd;
    font-weight: 400;
}

.cgu-link {
    color: #2563EB;
    text-decoration: underline;
    font-weight: 400;
}

.cgu-link:hover {
    color: #1e40af;
}

/* ==================================
   TRANSITION CLASSES (SHARED LOGIC)
   ================================== */
/* Note: Onboarding uses same keyframes logic but needs its own classes if we want to separate files */

/* Vers la droite (Retour Landing) */
/* Transitions removed */