:root {
    --pd-primary: #6366f1;
    --pd-secondary: #8b5cf6;
    --pd-accent: #ec4899;
    --pd-success: #10b981;
    --pd-danger: #ef4444;
    --pd-text: #0f172a;
    --pd-text-light: #64748b;
    --pd-bg: #f8fafc;
    --pd-glass: rgba(255, 255, 255, 0.8);
    --pd-shadow: 0 20px 50px rgba(99, 102, 241, 0.15);
    --pd-shadow-lg: 0 30px 60px rgba(99, 102, 241, 0.25);
}

* {
    box-sizing: border-box;
}

/* ===== CONTAINER PRINCIPAL ===== */
.partition-form-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 60px auto;
    padding: 0 20px;
    position: relative;
}

/* Background décoratif animé */
.partition-form-wrapper::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-secondary));
    border-radius: 50%;
    opacity: 0.08;
    animation: pulse 8s ease-in-out infinite;
    z-index: -1;
}

.partition-form-wrapper::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--pd-accent), var(--pd-secondary));
    border-radius: 50%;
    opacity: 0.06;
    animation: pulse 10s ease-in-out infinite reverse;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) translateY(0);
        opacity: 0.08;
    }
    50% {
        transform: scale(1.1) translateY(-20px);
        opacity: 0.12;
    }
}

/* ===== CARTE GLASSMORPHISM ===== */
.partition-form-container {
    position: relative;
    background: var(--pd-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 32px;
    box-shadow: var(--pd-shadow);
    padding: 48px 40px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.partition-form-container:hover {
    box-shadow: var(--pd-shadow-lg);
    transform: translateY(-4px);
}

/* Bordure gradient subtile */
.partition-form-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 2px;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.3), 
        rgba(236, 72, 153, 0.3)
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

/* ===== HEADER ===== */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.form-subtitle {
    font-size: 17px;
    color: var(--pd-text-light);
    font-weight: 500;
    line-height: 1.6;
}

/* ===== FORMULAIRE ===== */
.partition-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--pd-text);
    margin-bottom: 10px;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.form-group label .required {
    color: var(--pd-accent);
    margin-left: 2px;
}

/* Input moderne avec effet focus sophistiqué */
.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--pd-text);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input::placeholder {
    color: var(--pd-text-light);
    opacity: 0.6;
}

.form-group input:focus {
    border-color: var(--pd-primary);
    background: white;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.08),
        0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.form-group input:hover:not(:focus) {
    border-color: rgba(99, 102, 241, 0.3);
}

/* État d'erreur */
.form-group.error input {
    border-color: var(--pd-danger);
    background: rgba(239, 68, 68, 0.02);
}

.form-group.error input:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

.error-message {
    display: block;
    color: var(--pd-danger);
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    min-height: 18px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== CHECKBOX RGPD ===== */
.checkbox-group {
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.3s;
    padding: 12px;
    border-radius: 12px;
}

.checkbox-label:hover {
    background: rgba(99, 102, 241, 0.04);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--pd-primary);
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 14px;
    line-height: 1.6;
    color: var(--pd-text-light);
    font-weight: 500;
}

/* ===== BOUTON SUBMIT MODERNE ===== */
.submit-button {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-secondary));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* Effet de brillance au survol */
.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    transition: left 0.6s;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45);
}

.submit-button:active {
    transform: translateY(-1px);
}

.submit-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.submit-button .button-text {
    position: relative;
    z-index: 1;
}

/* Animation de chargement */
.button-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== MESSAGE DE SUCCÈS ===== */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    animation: fadeIn 0.4s forwards;
}

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

.success-modal {
    background: white;
    border-radius: 32px;
    padding: 48px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    animation: modalEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes modalEnter {
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Checkmark animé */
.success-checkmark {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--pd-success);
    stroke-miterlimit: 10;
    box-shadow: 
        inset 0 0 0 var(--pd-success),
        0 0 0 0 rgba(16, 185, 129, 0.3);
    animation: 
        fillCheckmark 0.4s ease-in-out 0.4s forwards,
        scaleCheckmark 0.3s ease-in-out 0.9s both,
        pulseCheckmark 2s ease-in-out 1.2s infinite;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--pd-success);
    fill: none;
    animation: strokeCheckmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheckmark 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes strokeCheckmark {
    100% { stroke-dashoffset: 0; }
}

@keyframes scaleCheckmark {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fillCheckmark {
    100% {
        box-shadow: 
            inset 0 0 0 50px var(--pd-success),
            0 0 0 20px rgba(16, 185, 129, 0);
    }
}

@keyframes pulseCheckmark {
    0%, 100% {
        box-shadow: 
            inset 0 0 0 50px var(--pd-success),
            0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 
            inset 0 0 0 50px var(--pd-success),
            0 0 0 20px rgba(16, 185, 129, 0);
    }
}

.success-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--pd-text);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--pd-success), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-description {
    font-size: 17px;
    color: var(--pd-text-light);
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 8px;
}

.success-email {
    font-weight: 700;
    color: var(--pd-primary);
    font-size: 18px;
}

/* ===== CONFETTIS ===== */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999998;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .partition-form-wrapper {
        margin: 30px auto;
        padding: 0 16px;
    }

    .partition-form-container {
        padding: 36px 24px;
        border-radius: 24px;
    }

    .form-title {
        font-size: 28px;
    }

    .form-subtitle {
        font-size: 15px;
    }

    .success-modal {
        padding: 36px 28px;
        border-radius: 24px;
    }

    .success-title {
        font-size: 26px;
    }

    .success-description {
        font-size: 15px;
    }
}

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Accessibilité */
.partition-form *:focus-visible {
    outline: 3px solid var(--pd-primary);
    outline-offset: 2px;
}

/* Préchargement des polices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
