/* Comparateur Énergie WP - Styles publics */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

/* Container principal */
#comparateur-energie-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
}

/* Header */
.comparateur-header {
    text-align: center;
    margin-bottom: 40px;
}

.comparateur-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comparateur-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
}

/* Barre de progression */
.comparateur-progress {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #059669);
    width: 20%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-steps .step {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-steps .step.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.progress-steps .step.completed {
    color: var(--success-color);
    background-color: rgba(5, 150, 105, 0.1);
}

/* Formulaire */
#comparateur-form {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.form-steps {
    padding: 40px;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

.form-step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.step-description {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Options radio et checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.radio-option input,
.checkbox-option input {
    margin: 0;
    margin-right: 12px;
    width: auto;
}

.radio-content,
.checkbox-content {
    flex: 1;
}

.radio-content strong,
.checkbox-content strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.radio-content small,
.checkbox-content small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Toggle de consommation */
.consumption-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 4px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.toggle-option {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    border-radius: calc(var(--border-radius) - 4px);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.toggle-option input {
    display: none;
}

.toggle-option input:checked + span {
    background-color: white;
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* Navigation du formulaire */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 120px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #047857;
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Résultats */
.results-container {
    margin-top: 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.results-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Liste des offres */
.offers-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.offer-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

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

.offer-card.best-offer {
    border-color: var(--success-color);
    box-shadow: 0 0 0 1px var(--success-color), var(--shadow-lg);
}

.best-offer-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--success-color), #10b981);
    color: white;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-bottom-left-radius: var(--border-radius);
    z-index: 1;
}

.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 0;
}

.offer-provider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-logo {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border-radius: 50%;
}

.provider-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-color);
}

.offer-type {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-right: 8px;
}

.green-badge {
    display: inline-block;
    background-color: var(--success-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.offer-rating {
    text-align: right;
}

.stars {
    margin-bottom: 4px;
}

.star {
    color: #d1d5db;
    font-size: 1.2rem;
}

.star.filled {
    color: #fbbf24;
}

.rating-value {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.offer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
}

.offer-price {
    text-align: center;
}

.annual-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 8px;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.period {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.savings {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.offer-services h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.offer-services ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offer-services li {
    padding: 4px 0;
    font-size: 0.875rem;
    color: var(--text-color);
}

.offer-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.offer-actions .btn {
    flex: 1;
}

.offer-commitment {
    background-color: var(--light-bg);
    padding: 12px 24px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* Conseils d'énergie */
.energy-tips {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.energy-tips h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.energy-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.energy-tips li {
    padding: 8px 0;
    position: relative;
    padding-left: 24px;
}

.energy-tips li::before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 8px;
}

/* Actions des résultats */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages d'erreur */
.error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.success-message {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    #comparateur-energie-container {
        padding: 16px;
    }
    
    .comparateur-header h2 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-steps {
        padding: 24px;
    }
    
    .form-navigation {
        padding: 16px 24px;
        flex-direction: column;
        gap: 12px;
    }
    
    .form-navigation .btn {
        width: 100%;
    }
    
    .offer-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .offer-actions {
        flex-direction: column;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .progress-steps .step {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .price {
        font-size: 2.5rem;
    }
    
    .offer-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .offer-rating {
        text-align: left;
    }
}

