/**
 * Styles pour le simulateur solaire frontend
 */

/* Reset et styles de base */
.simulateur-container {
    max-width: 800px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

.simulateur-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.simulateur-card.large {
    max-width: 900px;
}

/* En-tête du simulateur */
.simulateur-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.simulateur-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.simulateur-header p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Barre de progression */
.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    background: white;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    display: block;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.step-title {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Formulaire */
.simulateur-form {
    padding: 2rem;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-step h4 {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Groupes de champs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Cases à cocher */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0 !important;
}

.checkbox-label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
}

.checkbox-label input[type="checkbox"]:checked + span,
.checkbox-label:has(input[type="checkbox"]:checked) {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Géolocalisation */
.geolocation-info {
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Estimation en temps réel */
.estimation-preview {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.estimation-card h5 {
    margin: 0 0 1rem 0;
    color: #1e40af;
    font-weight: 600;
}

.estimation-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e40af;
    margin: 0.5rem 0;
}

.estimation-preview small {
    color: #3b82f6;
    font-weight: 500;
}

/* Navigation du formulaire */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    gap: 1rem;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem 2rem;
}

.spinner {
    border: 4px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Résultats */
.results {
    padding: 2rem;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.result-card.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.result-card.secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
}

.result-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.result-card small {
    opacity: 0.9;
}

.result-note {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    margin-top: 1rem;
}

/* Résultats finaux */
.final-results {
    text-align: center;
}

.final-results h3 {
    color: #10b981;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.result-item {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.result-item strong {
    display: block;
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.result-item span {
    color: #6b7280;
    font-size: 0.9rem;
}

.success-message {
    background: #dcfce7;
    color: #166534;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border: 2px solid #16a34a;
}

/* Résultats détaillés */
.detailed-results h3 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card.highlight {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.results-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.detail-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.detail-section h5 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1rem;
}

.detail-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
}

.detail-section li:last-child {
    border-bottom: none;
}

.next-steps {
    background: #eff6ff;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #3b82f6;
    margin: 2rem 0;
}

.next-steps h4 {
    color: #1e40af;
    margin-bottom: 1rem;
}

.contact-info {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.contact-info li {
    padding: 0.25rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* RGPD */
.rgpd-consent {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #f59e0b;
    margin-top: 1rem;
}

.rgpd-consent label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0 !important;
    font-size: 0.9rem;
    line-height: 1.4;
}

.rgpd-consent input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
    margin-top: 0.2rem !important;
}

/* Autocomplétion d'adresse */
.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

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

.address-suggestion:hover {
    background: #f9fafb;
}

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

.form-group {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .simulateur-container {
        margin: 1rem;
    }
    
    .simulateur-form {
        padding: 1.5rem;
    }
    
    .simulateur-header {
        padding: 1.5rem;
    }
    
    .simulateur-header h3 {
        font-size: 1.5rem;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .result-cards,
    .results-grid,
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .results-details {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .simulateur-header h3 {
        font-size: 1.3rem;
    }
    
    .simulateur-header p {
        font-size: 1rem;
    }
    
    .form-step h4 {
        font-size: 1.2rem;
    }
    
    .result-card h5 {
        font-size: 1.5rem;
    }
    
    .estimation-value {
        font-size: 1.5rem;
    }
}

/* Animations et transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card,
.detail-section {
    animation: fadeInUp 0.3s ease;
}

/* Success animation */
.success-animation {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    display: none;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    max-width: 200px;
    display: none;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}
