/* &SWAPP Formulaire - Styles CSS */

body {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafc 100%);
    min-height: 100%;
}

html, body {
    height: 100%;
}

:root {
    --green-dark: #2E5941;
    --green-light: #A5C1AA;
    --yellow: #FFCC00;
    --yellow-hover: #e6b800;
}

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.step-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(46, 89, 65, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.step-header {
    background: linear-gradient(135deg, var(--green-dark) 0%, #3a6b4f 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.step-content {
    padding: 2rem;
}

.selection-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.selection-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.selection-card.selected {
    border-color: var(--green-dark);
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    box-shadow: 0 8px 25px rgba(46, 89, 65, 0.12);
    transform: translateY(-2px);
}

.selection-card.selected::after {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--green-dark);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.input-field {
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    font-size: 16px;
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 4px rgba(46, 89, 65, 0.1);
}

.textarea-field {
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    font-size: 16px;
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.textarea-field:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 4px rgba(46, 89, 65, 0.1);
}

.btn-primary {
    background: var(--yellow);
    color: var(--green-dark);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    font-size: 16px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--yellow-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--green-dark);
    border: 2px solid var(--green-light);
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-secondary:hover {
    border-color: var(--green-dark);
    background: #f0f9f2;
    transform: translateY(-1px);
}

.btn-skip {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-skip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--yellow) 0%, #ffd700 100%);
    height: 100%;
    transition: width 0.5s ease;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    margin: 0 6px;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--yellow);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--green-dark);
}

.required::after {
    content: ' *';
    color: #ef4444;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal.show .modal-content {
    transform: scale(1);
}

.emoji-large {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.date-range {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.flexible-option {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.flexible-option.selected {
    border-color: var(--green-dark);
    background: #f0fdf4;
}

.priority-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.priority-1 {
    background: #fef2f2;
    color: #dc2626;
}

.priority-2 {
    background: #fef3c7;
    color: #d97706;
}

.priority-3 {
    background: #f0f9ff;
    color: #2563eb;
}

.copy-button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.copy-button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.copy-button.copied {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.city-vignette {
    transition: all 0.2s ease;
    font-weight: 500;
}

.city-vignette:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.city-vignette:active {
    transform: translateY(0);
}

.assistant-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

/* Modal optimisée pour mobile */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
    }
    
    .assistant-modal .modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 85vh;
        margin: 0;
        animation: slide-up 0.3s ease-out;
    }
    
    @keyframes slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    /* Scroll plus visible dans modal mobile */
    .assistant-modal .modal-content {
        padding: 1.5rem 1rem 2rem;
    }
    
    .assistant-modal .modal-content > *:first-child {
        padding-top: 0.5rem;
    }
    
    /* Boutons collés en bas sur mobile */
    .assistant-modal .flex.space-x-3 {
        position: sticky;
        bottom: 0;
        background: white;
        padding-top: 1rem;
        padding-bottom: 0.5rem;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    }
}

.assistant-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.assistant-preview {
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 100px;
}

.quality-tag {
    display: inline-block;
    background: #e0f2fe;
    border: 1px solid #0891b2;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quality-tag.selected {
    background: var(--green-dark);
    color: white;
    border-color: var(--green-dark);
}

.quality-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.passion-tag {
    display: inline-block;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.passion-tag.selected {
    background: var(--yellow);
    color: var(--green-dark);
    border-color: var(--yellow-hover);
    font-weight: 600;
}

.passion-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.city-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.city-suggestion:hover {
    background-color: #f8fafc;
}

.city-suggestion:last-child {
    border-bottom: none;
}

.city-suggestion.highlighted {
    background-color: #f0f9ff;
    border-left: 3px solid var(--green-dark);
}

.city-suggestion-name {
    font-weight: 600;
    color: var(--green-dark);
}

.city-suggestion-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 1rem;
    }
    
    .step-card {
        border-radius: 16px;
    }
    
    .step-content {
        padding: 1.5rem;
    }

    .assistant-modal .modal-content {
        max-width: 95%;
        padding: 1rem;
    }
}

/* --- Compact options row for UX-friendly selection --- */
.options-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.options-row .selection-card {
    flex: 0 0 auto;
    min-width: 220px;
    scroll-snap-align: start;
}

/* Slightly compact look inside options row */
.options-row .selection-card .text-2xl {
    font-size: 1.25rem; /* compact icon size */
}

/* Desktop: allow wrapping and remove horizontal scroll if space allows */
@media (min-width: 768px) {
    .options-row {
        flex-wrap: wrap;
        overflow: visible;
    }
    .options-row .selection-card {
        min-width: calc(33% - 8px);
    }
}

/* ============================================
   NOUVELLES FONCTIONNALITÉS UX
   ============================================ */

/* Checkbox Cards - Zone de tap améliorée pour mobile */
.checkbox-card {
    display: block;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-height: 48px;
    position: relative;
}

.checkbox-card:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.checkbox-card:has(input:checked) {
    border-color: var(--green-dark);
    background: #f0fdf4;
    box-shadow: 0 2px 8px rgba(46, 89, 65, 0.1);
}

.checkbox-card:has(input:checked)::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--green-dark);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-icon {
    font-size: 1.25rem;
}

.checkbox-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Mobile: zone de tap encore plus grande */
@media (max-width: 768px) {
    .checkbox-card {
        padding: 14px 16px;
        min-height: 52px;
    }
    
    /* Meilleur spacing entre éléments */
    .step-content {
        padding: 1.5rem 1rem;
    }
    
    .step-content > .space-y-6 > * {
        margin-bottom: 2rem;
    }
    
    /* Input et textarea plus grands */
    .input-field, .textarea-field, select {
        font-size: 16px !important; /* Évite le zoom iOS */
        padding: 14px;
        min-height: 52px;
    }
    
    .textarea-field {
        min-height: 120px;
    }
    
    /* Boutons plus accessibles */
    .btn-primary, .btn-secondary {
        min-height: 52px;
        font-size: 16px;
        padding: 14px 24px;
    }
    
    .btn-assistant {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Headers plus compacts */
    .step-header {
        padding: 1.5rem 1rem;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
    }
}

/* Bouton Assistant discret */
.btn-assistant {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-assistant:hover {
    background: #f9fafb;
    border-color: var(--green-light);
    color: var(--green-dark);
    transform: translateY(-1px);
}

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

.assistant-icon {
    font-size: 14px;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

/* Badge facultatif motivant */
.optional-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

/* Carte de motivation */
.motivation-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin: 24px 0;
    animation: subtle-pulse 3s infinite;
}

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

.motivation-card h4 {
    color: #92400e;
    font-weight: 600;
    font-size: 0.95rem;
}

.motivation-card p {
    color: #78350f;
    margin-top: 4px;
}

/* Indicateur de sauvegarde automatique */
.autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #065f46;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.autosave-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.autosave-indicator.saving {
    border-color: #f59e0b;
    color: #92400e;
}

.autosave-icon {
    font-size: 18px;
}

@media (max-width: 768px) {
    .autosave-indicator {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Indicateur de temps par étape */
.time-estimate {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    color: white;
    margin-left: 8px;
}

/* Feedback positif - checkmark vert */
.field-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
    font-size: 18px;
    pointer-events: none;
    animation: checkmark-appear 0.3s ease;
}

@keyframes checkmark-appear {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Amélioration grids pour mobile */
@media (max-width: 640px) {
    .mobile-single-col {
        grid-template-columns: 1fr !important;
    }
}

/* Feedback tactile mobile */
@media (hover: none) and (pointer: coarse) {
    /* Éléments cliquables avec feedback */
    .checkbox-card:active,
    .selection-card:active,
    .btn-primary:active,
    .btn-secondary:active,
    .btn-assistant:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
    
    /* Highlight plus visible sur tap */
    input:focus, textarea:focus, select:focus {
        border-color: var(--green-dark) !important;
        box-shadow: 0 0 0 4px rgba(46, 89, 65, 0.15) !important;
    }
    
    /* Smooth scroll pour toute la page */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Amélioration des transitions globales */
* {
    -webkit-tap-highlight-color: rgba(46, 89, 65, 0.1);
    tap-highlight-color: rgba(46, 89, 65, 0.1);
}

/* Loading state pour boutons */
.btn-primary.loading,
.btn-secondary.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.btn-primary.loading::after,
.btn-secondary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 16px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin 0.6s linear infinite;
}

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