/**
 * ATYPIKIA - CSS moderne pour start.php
 * Style moderne inspiré d'index.php selon la charte graphique
 */

/* Fix pour la bande blanche - Override des styles main-content */
.start-page .main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix pour la première section */
.start-page section:first-of-type {
    margin-top: 80px !important;
}

/* Fix spécifique pour start-form-section */
.start-form-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Override plus fort pour body start-page */
body.start-page .main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.start-page section:first-of-type {
    margin-top: 80px !important;
}

/* Variables CSS selon la charte graphique */
:root {
    /* Couleurs principales */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FFF8F0;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: rgba(107, 114, 128, 0.2);
    
    /* Couleurs d'interface */
    --blue-royal: #1E40AF;
    
    /* Couleurs officielles des troubles */
    --tdah-color: #F97316;
    --tsa-color: #1E40AF;
    --hpi-color: #10B981;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F97316;
    
    /* Couleurs complémentaires */
    --rose: #EC4899;
    --turquoise: #06B6D4;
    --coral: #EF4444;
    --indigo: #6366F1;
    --teal: #14B8A6;
    --lime: #84CC16;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Dark mode */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #FFF8F0;
    --border-color: rgba(255, 255, 255, 0.1);
    --tsa-color: #3B82F6;
}

/* Page start moderne */
.start-page {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
}

.start-form-section {
    padding: var(--space-8) 0 var(--space-16);
    position: relative;
    overflow: hidden;
}

.start-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(30, 64, 175, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Container et wrapper */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    position: relative;
    z-index: 2;
}

.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Disclaimer card moderne */
.disclaimer-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 240, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-6);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .disclaimer-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(38, 38, 38, 0.95) 100%);
}

.disclaimer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-royal) 0%, var(--tdah-color) 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.disclaimer-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--blue-royal) 0%, var(--indigo) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

.disclaimer-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-3) 0;
}

.disclaimer-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--space-4) 0;
}

.text-tdah {
    color: var(--tdah-color);
    font-weight: 600;
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--hpi-color);
}

.privacy-note i {
    color: var(--hpi-color);
}

/* Formulaire moderne */
.start-form {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 240, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    position: relative;
}

[data-theme="dark"] .start-form {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(38, 38, 38, 0.95) 100%);
}

/* Sections du formulaire */
.form-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-6) 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-title i {
    color: var(--blue-royal);
    font-size: 1.125rem;
}

/* Grid du formulaire */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

/* Groupes de champs */
.form-group {
    position: relative;
    transition: all var(--transition-normal);
}

.form-group.focused {
    transform: translateY(-2px);
}

.form-group.error {
    animation: shake 0.5s ease-in-out;
}

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

/* Labels modernes */
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.required-star {
    color: var(--error-color);
    font-weight: 700;
}

/* Badges de précision et fonctionnalités */
.precision-badge,
.feature-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--tdah-color) 0%, var(--warning-color) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.feature-badge {
    background: linear-gradient(135deg, var(--hpi-color) 0%, var(--teal) 100%);
}

/* Inputs modernes */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue-royal);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Inputs avec erreur */
.form-group.error input,
.form-group.error select {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.form-group.error input:focus,
.form-group.error select:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), var(--shadow-md);
}

/* Messages d'erreur */
.error-message {
    display: block;
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: var(--space-2);
    font-weight: 500;
}

/* Help text */
.help-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--space-1);
    opacity: 0.8;
}

/* Radio buttons modernes */
.radio-group {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    flex: 1;
    min-width: 120px;
    justify-content: center;
    font-weight: 500;
}

.radio-option:hover {
    border-color: var(--blue-royal);
    background: rgba(30, 64, 175, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.radio-option input[type="radio"]:checked + .radio-custom {
    background: var(--blue-royal);
    border-color: var(--blue-royal);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-option:has(input:checked) {
    border-color: var(--blue-royal);
    background: rgba(30, 64, 175, 0.1);
    color: var(--blue-royal);
    font-weight: 600;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform var(--transition-fast);
}

/* Select moderne */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: var(--space-8);
}

.form-group select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%231e40af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Optgroups stylés */
.form-group select optgroup {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.form-group select option {
    padding: var(--space-2);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Alertes */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-weight: 500;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert i {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

/* Boutons modernes */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-royal) 0%, var(--indigo) 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--blue-royal) 0%, var(--blue-royal) 100%);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--blue-royal);
    background: rgba(30, 64, 175, 0.05);
    color: var(--blue-royal);
}

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: 1.125rem;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Effet shine sur le bouton principal */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left var(--transition-normal);
}

.btn-primary:hover .btn-shine {
    left: 100%;
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .disclaimer-card,
    .start-form {
        padding: var(--space-6);
    }
    
    .disclaimer-card {
        flex-direction: column;
        text-align: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-option {
        min-width: unset;
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: var(--space-3);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .start-form-section {
        padding: var(--space-6) 0 var(--space-12);
    }
    
    .disclaimer-card,
    .start-form {
        padding: var(--space-4);
        border-radius: var(--radius-lg);
    }
    
    .form-section {
        margin-bottom: var(--space-6);
        padding-bottom: var(--space-4);
    }
    
    .form-grid {
        gap: var(--space-3);
    }
}

/* Animations d'apparition */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.disclaimer-card {
    animation: fadeIn var(--transition-slow) ease-out;
}

.start-form {
    animation: slideInUp var(--transition-slow) ease-out 0.2s both;
}

.form-section {
    animation: slideInUp var(--transition-slow) ease-out calc(0.3s + var(--delay, 0s)) both;
}

.form-section:nth-child(1) { --delay: 0.1s; }
.form-section:nth-child(2) { --delay: 0.2s; }
.form-section:nth-child(3) { --delay: 0.3s; }
.form-section:nth-child(4) { --delay: 0.4s; }

/* Focus states pour l'accessibilité */
.btn:focus,
.form-group input:focus,
.form-group select:focus {
    outline: 2px solid var(--blue-royal);
    outline-offset: 2px;
}

.radio-option:focus-within {
    outline: 2px solid var(--blue-royal);
    outline-offset: 2px;
}

/* Style pour l'explication email - Option C */
.help-text {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.email-benefits {
    list-style: none;
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border-radius: 8px;
    border-left: 4px solid var(--blue-royal);
}

.email-benefits li {
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.help-text p:first-child {
    color: var(--blue-royal);
    margin-bottom: 8px;
    font-size: 14px;
}

.help-text .note {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

/* ========================================
   NOTIFICATION PRÉ-REMPLISSAGE UTILISATEUR
======================================== */

.prefill-notification {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
    animation: slideInFromTop 0.6s ease-out;
}

.prefill-notification .notification-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.prefill-notification .notification-content {
    flex: 1;
}

.prefill-notification h3 {
    color: #065f46;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
}

.prefill-notification p {
    color: #047857;
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.5;
}

.prefill-benefits {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.prefill-benefits .benefit {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.prefill-benefits .benefit i {
    font-size: 11px;
    color: #10b981;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .prefill-notification {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }
    
    .prefill-notification .notification-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 0 auto;
    }
    
    .prefill-benefits {
        justify-content: center;
        gap: 12px;
    }
    
    .prefill-benefits .benefit {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Réduction des animations pour ceux qui le préfèrent */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .prefill-notification {
        animation: none;
    }
}