:root {
    --primary-color: #0C2E63;
    --primary-dark: #081d42;
    --secondary-color: #E0E0E0;
    --accent-color: #FF6B00;
    --text-color: #1A1A1A;
    --success-color: #10b981;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0C2E63 0%, #FF6B00 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Particules animées en arrière-plan */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-100px) rotate(180deg); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

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

.logo-container {
    margin-bottom: 20px;
}

.site-logo {
    max-width: 200px;
    height: auto;
    display: inline-block;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #0C2E63 0%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

header p {
    font-size: 1.2em;
    color: #64748b;
    margin-bottom: 20px;
}

.price-tag {
    background: linear-gradient(135deg, #FF6B00 0%, #0C2E63 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.3em;
    display: inline-block;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.form-group {
    margin-bottom: 25px;
    animation: slideInLeft 0.6s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.05em;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

/* Grille des types de pochette avec vignettes */
.case-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.case-card {
    display: grid;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: center;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.case-card input[type="radio"] {
    display: none;
}

.case-card .thumb {
    width: 120px;
    height: 120px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-card .title {
    margin-top: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.case-card input[type="radio"]:checked + .thumb + .title,
.case-card input[type="radio"]:checked ~ .title {
    color: var(--primary-color);
}

.case-card:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

@media (max-width: 768px) {
    .container {
        padding: 30px;
    }
    .case-type-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .case-card .thumb {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    .case-type-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .case-card {
        padding: 8px 4px;
        border-radius: 8px;
    }
    .case-card .thumb {
        width: 50px;
        height: 50px;
        border-radius: 8px;
        border-width: 1px;
    }
    .case-card .title {
        font-size: 11px;
        margin-top: 6px;
        line-height: 1.2;
        font-weight: 500;
    }
}

/* Sous-sous-type (variantes) - style compact */
.subsubtype-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.variant-card {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.variant-card .variant-title {
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    font-size: 0.95em;
    line-height: 1.3;
}

.variant-card:has(input[type="radio"]:checked) .variant-title {
    color: var(--primary-color);
}

/* Styles spécifiques pour les boutons d'action */
button.submit-btn.btn-finalize {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

button.submit-btn.btn-finalize:hover {
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5);
}

@media (max-width: 480px) {
    .subsubtype-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .variant-card {
        padding: 8px 4px;
        min-height: 80px; /* Hauteur minimale pour uniformiser */
    }
    
    .variant-card .variant-title {
        font-size: 11px;
    }
    
    button.submit-btn {
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    button.submit-btn:hover {
        transform: none;
        box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    }
}

.radio-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.radio-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

button.submit-btn {
    background: linear-gradient(135deg, #FF6B00 0%, #0C2E63 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.4);
    position: relative;
    overflow: hidden;
}

button.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

button.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.6);
}

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

.alert {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Badge de qualité */
.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    color: #16a34a;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 10px;
}

.quality-badge::before {
    content: "✓";
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #16a34a;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
    }
}

/* Effet de chargement pour le bouton */
button.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

button.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    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); }
}

/* Styles pour le modal de résumé */
.summary-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.summary-label {
    color: #0C2E63;
    font-size: 14px;
    font-weight: 700;
}

.summary-value {
    color: #1A1A1A;
    font-weight: 600;
    word-break: break-word;
}

@media (max-width: 480px) {
    .summary-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .summary-label {
        font-size: 13px;
        color: #64748b;
    }
}

/* Success Overlay */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(5px);
}

#success-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#success-overlay.visible .success-checkmark {
    transform: scale(1);
}

.success-checkmark svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.success-message {
    font-size: 1.8em;
    font-weight: 800;
    color: #1e293b;
    text-align: center;
    padding: 0 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

#success-overlay.visible .success-message {
    opacity: 1;
    transform: translateY(0);
}

.success-submessage {
    font-size: 1.1em;
    color: #64748b;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.4s;
}

#success-overlay.visible .success-submessage {
    opacity: 1;
    transform: translateY(0);
}
