/* ============================================================
   STYLES PERSONNALISÉS — Comparateur Mutuelle Santé
   ============================================================ */

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-feature-settings: 'cv02', 'cv03', 'cv04';
}

/* ---------- Sélection de texte ---------- */
::selection {
    background-color: #2563eb;
    color: white;
}

/* ---------- Scrollbar personnalisée ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---------- Radio cards sélectionnés ---------- */
.radio-card.selected > div {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
    box-shadow: 0 0 0 1px #2563eb inset;
}

.radio-card.selected {
    outline: none;
}

/* ---------- Transitions smooth sur les éléments interactifs ---------- */
button, a, input, select, .radio-card {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Animation d'entrée ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* ---------- Classes d'animation ---------- */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out both;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out both;
}

/* ---------- Transition des étapes du formulaire ---------- */
.step {
    animation: fadeInUp 0.4s ease-out both;
}

.step.hidden {
    display: none;
}

/* ---------- Boutons radio-card focus-state ---------- */
.radio-card:focus-visible > div {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* ---------- Bouton loading spinner ---------- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---------- Card hover decoration ---------- */
.offer-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.offer-card:hover {
    transform: translateY(-4px);
}

/* ---------- Badge "Recommandé" ---------- */
.featured-ribbon {
    position: relative;
    overflow: hidden;
}
.featured-ribbon::before {
    content: ''; 
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: #fbbf24;
    transform: rotate(45deg);
    z-index: 1;
}

/* ---------- Sticky header state ---------- */
.header-scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
}

/* ---------- Notification toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #111827;
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90vw;
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success {
    background: #065f46;
}
.toast.error {
    background: #991b1b;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
    .text-6xl {
        font-size: 2.5rem;
        line-height: 1.15;
    }
    h1 {
        font-size: 2.2rem !important;
    }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------- Form error states ---------- */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}
.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* ---------- Autocomplétion (adresse / ville) ---------- */
.suggestions-box {
    display: none;
}
.suggestions-box.visible {
    display: block;
    animation: fadeIn 0.15s ease-out;
}
.suggestions-box .suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.12s ease;
}
.suggestions-box .suggestion-item:last-child {
    border-bottom: none;
}
.suggestions-box .suggestion-item:hover,
.suggestions-box .suggestion-item.active {
    background-color: #eff6ff;
    color: #1d4ed8;
}
.suggestions-box .suggestion-item .suggestion-icon {
    margin-right: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}
.suggestions-box .suggestion-item .suggestion-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.suggestions-box .suggestion-item .suggestion-sub {
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
    flex-shrink: 0;
}
.suggestions-box .suggestions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    color: #9ca3af;
    font-size: 13px;
}
.suggestions-box .suggestions-empty {
    padding: 14px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* Indicateur "validé" sur les champs */
.input-valid {
    border-color: #10b981 !important;
}
.input-valid:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Spinner de chargement mini (suggestions) */
.mini-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
