﻿/* ==========================================================================
   STILE DI BASE PER PRESTOMED
   ========================================================================== */

/* --- PALETTE COLORI --- */
:root {
    /* Colori Principali */
    --primary-color: #5387b9;        /* Medi-Click Blue */
    --primary-color-dark: #3e6690;
    --secondary-color: #fbf9ec;      /* Medi-Click Cream */
    --accent-color: #f78970;         /* Medi-Click Coral */
    --teal-color: #88d3ce;           /* Medi-Click Teal */
    
    /* Testo e Sfondi */
    --text-color: #2c3e50;
    --text-color-light: #6c757d;
    --background-color: #fbf9ec;
    --border-color: #dee2e6;

    /* Alias per compatibilitÃ  (Rebranding/Wizard) */
    --color-bg: var(--background-color);
    --color-primary: var(--primary-color);
    --color-secondary: var(--teal-color);
    --color-accent: var(--accent-color);
    --text-dark: var(--text-color);
}

/* --- RESET E STILI GLOBALI --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(83, 135, 185, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(247, 137, 112, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(136, 211, 206, 0.2) 0%, transparent 50%);
    background-attachment: fixed;
    padding-top: 80px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-family: 'Lexend', sans-serif;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; text-align: center; }
h3 { font-size: 1.4rem; }
p { margin-bottom: 1rem; color: var(--text-color-light); }
a { text-decoration: none; color: var(--primary-color); }

.page-container {
    padding: 3rem 0;
    background-color: transparent;
}

/* --- HEADER --- */
header {
    background: transparent;
    padding: 1rem 0;
    border-bottom: 1px solid transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

header.scrolled {
    background: rgba(251, 249, 236, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo-link img {
    height: 40px;
    transition: height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

header.scrolled .logo-link img {
    height: 30px;
}

.fav-link {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fav-link .fav-text {
    transition: max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease, margin-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-block;
    vertical-align: middle;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    font-size: 1rem;
}

header.scrolled .fav-link .fav-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
}

header.scrolled .fav-link {
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: transparent !important;
    background-color: rgba(83, 135, 185, 0.1);
    font-size: 0;
}

header.scrolled .fav-link i {
    font-size: 1rem;
}

/* Language Selector */
.lang-selector-container {
    margin-left: 15px;
    position: relative;
    display: inline-block;
}

.lang-selector {
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    font-family: 'Lexend', sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: auto;
}

.lang-selector:hover {
    background-color: rgba(83, 135, 185, 0.1);
}

header.scrolled .lang-selector {
    border-color: var(--text-color);
    color: var(--text-color);
}

/* --- PULSANTI --- */
.button-primary {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Lexend', sans-serif;
    transition: background-color 0.3s ease, transform 0.2s;
}

.button-primary:hover {
    background-color: #e07a60;
    transform: scale(1.05);
}

.button-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-color);
    padding: 12px 24px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.large-button {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.button-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- PULSANTE INSTALLA APP --- */
#install-app-btn {
    margin-top: 2rem;
    background-color: rgba(247, 137, 112, 0.1);
    border: 1px solid rgba(247, 137, 112, 0.2);
    border-radius: 30px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(247, 137, 112, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

#install-app-btn i {
    margin-right: 10px;
}

#install-app-btn:hover {
    background-color: rgba(247, 137, 112, 0.2);
    color: #e07a60;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(247, 137, 112, 0.2);
}

/* --- SEZIONE HERO --- */
.hero {
    padding: 4rem 0;
    text-align: center;
    background-color: transparent;
    position: relative;
    overflow-x: hidden;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    color: var(--text-color);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.6);
    color: var(--text-color);
}

.hero-logo {
    height: 200px;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 1s forwards;
    opacity: 0;
}

/* --- IMMAGINI LATERALI HERO --- */
.hero-bg-img {
    position: absolute;
    bottom: 0;
    z-index: 1;
    height: 88%;
    max-height: 600px;
    width: auto;
    pointer-events: none;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.left-img {
    left: 2%;
    animation: fadeInLeft 1s ease-out 0.5s forwards;
}

.right-img {
    right: 2%;
    animation: fadeInRight 1s ease-out 0.5s forwards;
}

.right-img-alt {
    right: 2%;
    animation: fadeInRight 1s ease-out 0.5s forwards;
    display: none;
}

/* --- HERO MOBILE GLASS WRAPPER --- */
.hero-mobile-glass {
    position: relative;
}

/* Friendly Container */
.friendly-container {
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.1);
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.friendly-title {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Lexend', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* --- BARRA DI RICERCA --- */
.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.search-hub {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 18px 20px;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 18px 40px rgba(44, 62, 80, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.search-hub::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 15%, rgba(136, 211, 206, 0.18), transparent 40%),
                radial-gradient(circle at 85% 10%, rgba(247, 137, 112, 0.15), transparent 38%);
}

.search-segment {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-segment .friendly-title {
    margin-bottom: 0.2rem;
}

.search-segment-caption {
    width: 100%;
    margin-top: -4px;
    margin-bottom: 4px;
    color: var(--text-color-light);
    font-size: 0.95rem;
}

.search-separator {
    position: relative;
    height: 1px;
    margin: 16px 2px;
    background: linear-gradient(90deg, rgba(83, 135, 185, 0), rgba(83, 135, 185, 0.4), rgba(83, 135, 185, 0));
}

.search-separator::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(247, 137, 112, 0.18);
}

.search-hub .search-field {
    background-color: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(83, 135, 185, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
}

.search-hub .search-field:focus-within {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(83, 135, 185, 0.14);
}

.search-hub .button-primary {
    min-width: 170px;
}

.search-bar .friendly-title {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: none;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.search-field i {
    color: var(--text-color-light);
}

.search-field input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.05rem;
    font-family: 'Inter', sans-serif;
}

#locate-me-btn, #wizard-locate-btn {
    cursor: pointer;
    color: var(--primary-color);
    transition: transform 0.2s ease, color 0.2s ease;
}

#locate-me-btn:hover, #wizard-locate-btn:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* Stili per l'autocompletamento */
.search-field-wrapper {
    position: relative;
}

.suggestions-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: var(--secondary-color);
}

/* --- SEZIONE "COME FUNZIONA" --- */
.how-it-works {
    padding: 5rem 0;
}

.how-it-works .steps {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.step .step-icon {
    font-size: 2.5rem;
    color: #88d3ce;
    margin-bottom: 1rem;
}

/* --- PAGINA PER I MEDICI --- */
.hero-medici {
    padding: 6rem 0;
    text-align: center;
    background-color: var(--primary-color);
    color: #fff;
}

.hero-medici h1 {
    color: #fff;
}

.hero-medici p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    color: rgba(255, 255, 255, 0.9);
}

.benefits {
    padding: 5rem 0;
    background-color: rgba(255, 255, 255, 0.4);
}

.benefits-grid {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.benefit-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-section-medici {
    padding: 5rem 0;
    text-align: center;
    background-color: transparent;
}

.contact-section-medici p {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- SEZIONE FAQ --- */
.faq-section {
    padding: 5rem 0;
    background-color: transparent;
}

.faq-container {
    max-width: 800px;
    margin: 3rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.07);
    transition: box-shadow 0.3s ease;
}

.faq-item summary {
    padding: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item[open] {
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.1);
}

.faq-item p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
}

/* --- PAGINA CHI SIAMO --- */
.hero-chi-siamo {
    padding: 5rem 0;
    text-align: center;
    background-color: transparent;
}

.hero-chi-siamo h1 {
    color: var(--text-color);
}

.hero-chi-siamo p {
    font-size: 1.3rem;
    max-width: 600px;
    margin: 0 auto;
}

.mission-values {
    padding: 5rem 0;
    background-color: rgba(255, 255, 255, 0.4);
}

.mission-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 5rem;
}

.mission-text {
    flex: 1;
}

.mission-text h2 {
    text-align: left;
}

.mission-image {
    flex: 1;
}

.mission-image img {
    width: 100%;
    border-radius: 8px;
}

.values-grid {
    display: flex;
    gap: 2rem;
    text-align: center;
}

.value-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* --- PAGINA RISULTATI RICERCA --- */
.page-title {
    text-align: left;
    margin-bottom: 2rem;
}

.search-results-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Pulsante Toggle Filtri (Mobile) */
.filters-toggle-btn {
    display: none;
    width: 100%;
    padding: 15px;
    background-color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    margin-bottom: 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.07);
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.filters-toggle-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.1);
}

.filters-sidebar {
    flex: 0 0 280px;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.filters-sidebar h3 {
    margin-bottom: 1.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h4 {
    margin-bottom: 0.8rem;
}

.filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
    font-size: 1rem;
    color: var(--text-color);
    transition: color 0.2s;
}

.filter-group label:hover {
    color: var(--primary-color);
}

/* Checkbox Custom */
.filter-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    flex-shrink: 0;
}

.filter-group input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-group input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Select Custom */
.filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235387b9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.filter-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(83, 135, 185, 0.1);
}

/* --- SLIDER PREZZO (Custom Style) --- */
#price-slider {
    -webkit-appearance: none;
    width: 100%;
    margin: 10px 0;
    background: transparent;
}

#price-slider:focus {
    outline: none;
}

/* Track Styles (La barra) */
#price-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 6px;
}

#price-slider::-moz-range-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 6px;
}

/* Thumb Styles (Il pallino) */
#price-slider::-webkit-slider-thumb {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #f78970;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

#price-slider::-moz-range-thumb {
    height: 28px;
    width: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f78970;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Testo valore prezzo sotto lo slider */
#price-value {
    display: block;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 10px;
    color: var(--primary-color);
}

.results-list {
    flex: 1;
}

.doctor-card {
    display: flex;
    gap: 1.5rem;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.doctor-card:hover {
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.12);
    transform: translateY(-4px);
}

.doctor-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.doctor-info {
    flex: 1;
}

.doctor-info h3 {
    margin-bottom: 0.25rem;
    color: var(--text-color);
    padding-right: 40px;
}

.doctor-info .specialization {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.doctor-info .address {
    font-size: 0.9rem;
}

/* Stile per il link esteso */
.stretched-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    background-color: rgba(0,0,0,0);
}

.no-results {
    display: none;
    text-align: center;
    padding: 3rem;
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.no-results h3 {
    color: var(--text-color);
}

/* --- PAGINA PROFILO MEDICO --- */
.profile-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-main {
    flex: 1;
}

.profile-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 20px;
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    background-color: rgba(255, 255, 255, 0.65);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.08);
    border-top: 4px solid var(--primary-color);
    position: relative;
    top: auto;
    z-index: 1;
}

/* Box Rating nell'Header */
.header-rating {
    display: none;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.header-rating .stars-display {
    color: #f1c40f;
    font-size: 1rem;
    margin-bottom: 0;
}

.header-rating span {
    font-weight: 700;
    color: var(--text-color);
}

.header-rating a {
    font-size: 0.85rem;
    color: var(--text-color-light);
    text-decoration: underline;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.profile-summary h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    color: var(--text-color);
}

.profile-summary .specialization {
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-block;
    background-color: rgba(83, 135, 185, 0.1);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Link indirizzo cliccabile */
.address-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}
.address-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    width: 100%;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-details ul {
    list-style-position: inside;
    padding-left: 1rem;
}

/* Stili per i Tab */
.tabs {
    border-bottom: 1px solid var(--border-color);
    border-bottom: none;
    margin-bottom: 1.5rem;
    display: inline-flex;
    background-color: #f8f9fa;
    padding: 6px;
    border-radius: 12px;
    gap: 5px;
}

.tab-link {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    padding: 10px 20px;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    color: var(--text-color-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    transition: all 0.2s ease;
}

.tab-link.active, .tab-link:hover {

    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(0,0,0,0.03);
}

.tab-link.active {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.price-list {
    list-style: none;
    padding: 0;
}

.price-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.price-list li:hover {
    background-color: #f9f9f9;
}

.price-list li strong {
    color: var(--accent-color);
    font-size: 1.2rem;
    background: #fff5f2; /* Sfondo corallo chiarissimo */
    padding: 4px 10px;
    border-radius: 6px;
}

/* Modulo di contatto nella sidebar */
.contact-form-box {
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.form-group-checkbox input {
    margin-top: 4px;
}

.button-primary.full-width {
    width: 100%;
    text-align: center;
}

/* Stili per i messaggi di stato del form */
#form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none; /* Nascosto di default, appare dopo l'invio */
}

.status-success {
    display: block;
    background-color: #d4edda;
    color: #155724;
}

.status-error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
}

/* --- FOOTER --- */
footer {
    background-color: var(--text-color);
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}

footer .footer-links {
    margin-bottom: 1rem;
}

footer .footer-links a {
    color: #fff;
    margin: 0 10px;
    transition: text-decoration 0.3s ease;
}

footer .footer-links a:hover {
    text-decoration: underline;
}

footer .copyright {
    color: #ccc;
    font-size: 0.9rem;
    margin: 0;
}

/* --- MODAL PER IMMAGINE INGRANDITA --- */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    cursor: pointer;
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: 1px solid rgba(255, 255, 255, 0.4);
    outline: none;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--primary-color);
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Wizard Modal */
.wizard-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(83, 135, 185, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.wizard-card {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin: auto;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.step-content { display: none; }
.step-content.active { display: block; }

.wizard-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.wizard-btn-opt {
    padding: 15px; border: 2px solid #eee; border-radius: 10px; background: white; cursor: pointer; font-weight: bold; color: var(--color-primary);
}
.wizard-btn-opt:hover, .wizard-btn-opt.selected {
    border-color: var(--color-secondary); background-color: var(--color-secondary); color: white;
}

.close-wizard {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color-light);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 100;
}

.close-wizard:hover {
    color: var(--accent-color);
    background-color: rgba(0,0,0,0.05);
    transform: rotate(90deg);
}

/* --- NUOVI STILI PER WIZARD COMPLESSO --- */
.wizard-scroll-container {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.wizard-question {
    margin-bottom: 25px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.wizard-question:last-child {
    border-bottom: none;
}

.wizard-question label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.wizard-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.wizard-radio-btn {
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60px;
    gap: 8px;
}

.wizard-radio-btn:hover {
    border-color: var(--teal-color);
    background-color: rgba(136, 211, 206, 0.1);
}

.wizard-radio-btn.selected {
    background-color: var(--teal-color);
    color: white;
    border-color: var(--teal-color);
    box-shadow: 0 4px 10px rgba(136, 211, 206, 0.4);
}

/* Stile specifico per le icone dentro i pulsanti */
.wizard-radio-btn i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

/* Icone piÃ¹ piccole per lo step Fattori (Step 6) dove ci sono molte opzioni */
#q-exac .wizard-radio-btn i,
#q-rel .wizard-radio-btn i {
    font-size: 1.1rem;
}

.wizard-text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-top: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    display: none;
    background-color: #fafafa;
}

.wizard-text-input.visible {
    display: block;
    animation: fadeIn 0.3s;
}

.wizard-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ANIMAZIONI TRANSIZIONE STEP WIZARD --- */
.step-content.fade-in {
    animation: fadeInStep 0.4s forwards;
}

.step-content.fade-out {
    animation: fadeOutStep 0.3s forwards;
    display: block !important;
}

@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutStep {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* --- PROGRESS BAR WIZARD --- */
.wizard-progress-track {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    margin-top: 40px;
    overflow: hidden;
}

.wizard-step-counter {
    display: none;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-bottom: 25px;
    font-weight: 700;
}

.wizard-progress-bar {
    height: 100%;
    background-color: var(--color-secondary);
    width: 0%;
    transition: width 0.4s ease-in-out;
}

/* --- CONTROLLI SLIDER WIZARD --- */
.slider-controls {
    display: flex;
    justify-content: space-between;
    margin-top: -10px;
    margin-bottom: 20px;
    gap: 10px;
}

/* --- BOX CONTATTO RISULTATI --- */
.contact-box-result {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

/* --- SEZIONE TESTIMONIALS --- */
.testimonials {
    padding: 5rem 0;
    background-color: transparent;
    text-align: center;
}

.testimonials-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.testimonials-carousel::-webkit-scrollbar {
    display: none;
}

.testimonials-carousel.active {
    cursor: grabbing;
    scroll-snap-type: none;
}

.testimonial-card {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.12);
}

.testimonial-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--teal-color);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.testimonial-name {
    margin-bottom: 0.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.testimonial-role {
    font-size: 0.85rem;
    color: var(--text-color-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SEZIONE PARTNERS (COLLABORATORI) --- */
.partners {
    padding: 4rem 0;
    background-color: rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.partners h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.partners-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.partners-track {
    display: flex;
    width: calc(200px * 12);
    animation: scrollPartners 30s linear infinite;
}

.partner-logo {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: color 0.3s;
}

.partner-logo:hover {
    color: var(--primary-color);
}

/* --- ADMIN PANEL STYLES --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.action-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    color: white;
}

.action-btn.edit { background-color: #f39c12; }
.action-btn.delete { background-color: #e74c3c; }

/* Admin Modal */
.admin-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.admin-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 28px;
    cursor: pointer;
}

.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

/* --- STILE INFO STUDIO (PROFILO MEDICO) --- */
.doctor-services {
    margin-top: 2rem;
    background: #fbfbfb;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.doctor-services ul {
    list-style: none !important;
    padding: 0 !important;
}
.doctor-services li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}
.doctor-services li i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
    color: var(--teal-color);
    background-color: rgba(136, 211, 206, 0.15);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* --- ANIMAZIONI SCROLL (FADE-IN STAGGERED) --- */
.how-it-works .step {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.how-it-works.is-visible .step {
    opacity: 1;
    transform: translateY(0);
}

.how-it-works.is-visible .step:nth-child(1) { transition-delay: 0.1s; }
.how-it-works.is-visible .step:nth-child(2) { transition-delay: 0.3s; }
.how-it-works.is-visible .step:nth-child(3) { transition-delay: 0.5s; }
.how-it-works.is-visible .step:nth-child(4) { transition-delay: 0.7s; }

/* --- SEGNALIBRI CARD (Bookmark Badges) --- */
.card-bookmarks {
    position: absolute;
    top: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
    pointer-events: none;
}

.bookmark-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    color: #fff;
    border-radius: 6px 0 0 6px;
    font-size: 1.1rem;
    box-shadow: -2px 2px 5px rgba(0,0,0,0.15);
    pointer-events: auto;
    transition: transform 0.2s ease;
}

.bookmark-badge:hover {
    transform: translateX(-3px);
}

.bookmark-badge.job { background-color: #9b59b6; }
.bookmark-badge.parking { background-color: #5387b9; }
.bookmark-badge.disability { background-color: #2e7d32; }


@keyframes scrollPartners {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 6)); }
}

/* --- ANIMAZIONE PULSE PER BOTTONE WIZARD --- */
@keyframes pulse-accent {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(247, 137, 112, 0.7);
    }
    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(247, 137, 112, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(247, 137, 112, 0);
    }
}

#start-wizard-btn {
    animation: pulse-accent 2s infinite;
}

/* --- ANIMAZIONE ENTRATA CARD --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animazione pulsazione per pulsante installa app */
@keyframes gentle-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(247, 137, 112, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 8px 25px rgba(247, 137, 112, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(247, 137, 112, 0.4);
    }
}

/* --- ANIMAZIONE TITOLI DI PAGINA AL CARICAMENTO --- */
.hero h1,
.page-title,
.profile-header .profile-summary h1,
.hero-chi-siamo h1,
.hero-medici h1,
.admin-header h1,
.page-container > .container > h1 {
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
    opacity: 0; 
}

/* --- ANIMAZIONE PARAGRAFI E SOTTOTITOLI --- */
.hero p,
.hero-chi-siamo p,
.hero-medici p,
.profile-summary .specialization,
.profile-summary .profile-locations {
    animation: fadeInUp 0.8s ease-out 1.4s forwards;
    opacity: 0;
}

.profile-summary .profile-actions {
    animation: fadeInUp 0.8s ease-out 1.6s forwards;
    opacity: 0;
}

/* --- SKELETON LOADER --- */
.skeleton-card {
    display: flex;
    gap: 1.5rem;
    background-color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}

.skeleton {
    background-color: #e0e0e0;
    border-radius: 4px;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

.skeleton-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.skeleton-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

/* --- LINK INFORMATIVO --- */
.info-link {
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 700;
    display: inline-block;
    margin-top: 5px;
}

/* --- MODAL INFORMATIVO --- */
.info-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.info-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-info-modal {
    position: absolute;
    right: 15px; top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.close-info-modal:hover { color: var(--accent-color); }

/* --- VALIDAZIONE ERRORI WIZARD --- */
.input-error {
    border: 2px solid #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.05);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- LOADER ANIMATO --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader-wrapper.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 100px;
    animation: pulse-logo 1.5s infinite ease-in-out;
}

@keyframes pulse-logo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- ANIMAZIONE RIMBALZO TARGET (SCROLL) --- */
@keyframes bounce-target {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-20px); } /* Punto piÃ¹ alto del rimbalzo */
    50% { transform: translateY(8px); }  /* Scende oltre la posizione finale (effetto elastico) */
    70% { transform: translateY(-10px); } /* Secondo rimbalzo, piÃ¹ piccolo */
    90% { transform: translateY(3px); }  /* Assestamento finale prima di fermarsi */
}

.bounce-target {
    animation: bounce-target 1.2s ease-out; /* Durata leggermente aumentata per apprezzare l'effetto */
}

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.5s ease-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

/* --- CAROSELLO MEDICI CORRELATI --- */
.related-doctors-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.related-doctors-carousel::-webkit-scrollbar {
    display: none;
}

/* Stile specifico per le card dentro il carosello */
.related-doctors-carousel .doctor-card {
    flex: 0 0 260px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    scroll-snap-align: start;
    height: auto;
}

.related-doctors-carousel .doctor-photo {
    width: 90px;
    height: 90px;
    margin-bottom: 10px;
}

.related-doctors-carousel .doctor-info h3 {
    padding-right: 0;
}

/* --- NAVIGAZIONE CAROSELLO (FRECCE) --- */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.2s;
    opacity: 0.9;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.prev-btn { left: -15px; }
.next-btn { right: -15px; }

/* --- SISTEMA PREFERITI --- */
.favorite-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #cbd5e0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
}

.favorite-btn i {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.favorite-btn.active {
    color: #e74c3c;
}

.favorite-btn:hover {
    transform: scale(1.15);
    color: #ff6b6b;
}

/* Posizionamento pulsante cuore nella card */
.doctor-card .favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* --- SEZIONE RECENSIONI --- */
.reviews-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.big-rating {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
}

.stars-display {
    color: #f1c40f;
    font-size: 1.2rem;
}

.review-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reviewer-name {
    font-weight: 700;
}

.review-date {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.verified-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Stelle nel form modale */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    font-size: 1.5rem;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #f1c40f;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

/* --- TABLET & SMALL LAPTOP (max-width: 1200px) --- */
@media (max-width: 1200px) {
    .hero-bg-img {
        height: 65%;
        opacity: 0.8;
    }
}

/* --- MOBILE & TABLET (max-width: 768px) --- */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    body {
        padding-top: 72px;
    }

    .container {
        padding: 0 14px;
    }

    /* Typography */
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }

    /* Header & Nav */
    header {
        padding: 0.6rem 0;
    }

    header .container {
        gap: 8px;
    }

    header .logo-link img {
        height: 32px;
    }

    header nav {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    header .button-secondary.fav-link {
        padding: 8px 10px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .hero-logo {
        height: 180px;
        margin: 0 auto 2rem;
    }

    header .button-secondary {
        padding: 8px 12px;
    }
    
    .lang-selector-container {
        margin-left: 5px;
    }
    .lang-selector {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .homepage .fav-link .fav-text {
        display: none !important;
    }

    .hero {
        padding: 2.4rem 0 1.5rem;
    }

    .hero h1 {
        font-size: 1.72rem !important;
        line-height: 1.2;
        margin-top: 0 !important;
    }

    .hero p {
        font-size: 1rem;
        max-width: 100%;
        padding: 0 4px;
    }

    /* Hero Images */
    .hero-bg-img {
        display: none !important;
    }
    .left-img { left: auto; }
    .right-img { right: auto; }

    /* Search Bar */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        background-color: rgba(255, 255, 255, 0.74);
        box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* Ombra piÃ¹ marcata */
        gap: 15px; /* Spazio tra i campi */
    }
    .search-hub {
        padding: 14px;
        border-radius: 16px;
    }
    .search-segment {
        gap: 10px;
    }
    .search-segment .friendly-title {
        font-size: 1.05rem;
    }
    .search-segment-caption {
        margin-bottom: 0;
        font-size: 0.88rem;
        line-height: 1.35;
    }
    .search-separator {
        margin: 14px 0;
    }
    .search-field {
        background-color: #f4f6f8; /* Box grigio chiaro per affordance input */
        border: 1px solid #e1e4e8;
        border-radius: 12px;
        padding: 12px 15px;
        margin-bottom: 0;
        /* Reset dello stile desktop/precedente */
        border-bottom: 1px solid #e1e4e8; 
    }
    .search-field input {
        background: transparent; /* Assicura che l'input non copra lo sfondo grigio */
    }
    .search-field:focus-within {
        background-color: #fff;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(83, 135, 185, 0.15);
    }
    .search-bar button {
        width: 100%;
        margin-top: 5px;
        padding: 15px; /* Area di tocco piÃ¹ ampia */
    }

    .search-hub .button-primary {
        min-width: 0;
    }

    /* Friendly Container (Wizard) Mobile */
    .friendly-container {
        background-color: #ffffff; /* Sfondo bianco solido */
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        border: 1px solid rgba(0,0,0,0.05);
        padding: 25px 20px;
    }
    .friendly-container #start-wizard-btn {
        width: 100%;
        padding: 15px;
    }

    /* Sections Layout */
    .how-it-works .steps,
    .benefits-grid,
    .search-results-layout,
    .profile-layout,
    .mission-content,
    .values-grid {
        flex-direction: column;
    }

    .page-title { text-align: center; }

    /* Filters (Search Results) */
    .filters-toggle-btn { display: flex; }
    .filters-sidebar {
        width: 100%;
        flex: auto;
        max-height: 0;
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
        transition: max-height 0.5s ease-out, padding 0.5s ease-out, margin-bottom 0.5s ease-out;
    }
    .filters-sidebar.show {
        max-height: 2000px;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    .filters-sidebar #insurance-filter { width: 100%; }

    /* Results List */
    .results-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .doctor-card { width: 100%; }

    /* Profile Page */
    .profile-main { width: 100%; min-width: 0; }
    .profile-sidebar { position: static; width: 100%; }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 1rem;
        width: 100%;
    }
    .profile-summary { width: 100%; min-width: 0; word-wrap: break-word; }
    .profile-photo { width: 150px; height: 150px; margin-bottom: 1rem; }
    .profile-summary .specialization { white-space: normal; display: inline-block; max-width: 100%; }
    .profile-summary h1 { font-size: 1.6rem; word-wrap: break-word; }
    
    .profile-actions {
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .action-buttons { flex-shrink: 0; gap: 5px; flex-wrap: nowrap; }
    .action-buttons button {
        width: 40px; height: 40px; padding: 0 !important;
        border-radius: 50%; font-size: 0 !important;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .action-buttons button i { font-size: 1.1rem; margin: 0; }

    .header-rating {
        flex-shrink: 1; padding: 4px 8px; font-size: 0.8rem;
        min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .header-rating .stars-display { font-size: 0.8rem; }

    /* Tabs & Details */
    .tabs {
        display: flex; justify-content: center; margin: 0 auto 1.5rem auto;
        width: 100%; flex-wrap: wrap;
    }
    .tab-link { flex: 1; padding: 10px 5px; font-size: 0.95rem; }
    .profile-details { width: 100%; min-width: 0; }

    .price-list li {
        flex-direction: column; align-items: flex-start; gap: 0.5rem;
        width: 100%; padding: 10px;
    }
    .price-list li span { width: 100%; word-wrap: break-word; overflow-wrap: break-word; }
    .price-list li strong { align-self: flex-end; }

    .doctor-services, #bio-content, .profile-details {
        word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;
    }

    /* Carousels */
    .testimonials-carousel {
        margin-left: -20px; margin-right: -20px;
        padding: 1.5rem 20px; gap: 1rem;
    }
    .testimonial-card { flex: 0 0 280px; padding: 1.5rem; }
    .carousel-btn { display: none; }

    /* Wizard */
    .wizard-card { padding: 20px; }
    .wizard-progress-track { height: 6px; margin-bottom: 15px; }
    .close-wizard { top: 5px; right: 5px; width: 40px; height: 40px; font-size: 2rem; }
    
    /* Misc */
    .patologie-img { display: block; width: 80px !important; }
    .search-results-layout { align-items: stretch; }

    .how-it-works,
    .testimonials {
        padding: 3.2rem 0;
    }

    footer .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 14px;
    }

    footer .footer-links a {
        margin: 0;
    }

    /* --- ADMIN PANEL RESPONSIVE --- */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .admin-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .admin-controls button {
        width: 100%;
        margin-left: 0 !important; /* Override dello stile inline */
    }

    .admin-table {
        min-width: 700px; /* Forza lo scroll orizzontale per non schiacciare i dati */
    }

    /* Modal Form Responsive */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
    }

    .form-img-container {
        display: none; /* Nasconde l'immagine decorativa su mobile */
    }
}

/* --- SMALL MOBILE (max-width: 375px) --- */
@media (max-width: 426px) {
    h1 { font-size: 1.65rem; }
    h2 { font-size: 1.45rem; }

    .hero-logo {
        height: 145px;
        margin-bottom: 1.2rem;
    }

    .hero-bg-img { display: none !important; }

    .search-field input {
        font-size: 0.95rem;
    }

    .search-segment .friendly-title {
        font-size: 0.98rem;
    }

    .search-segment-caption {
        font-size: 0.84rem;
    }

    .left-img { left: auto; }
    .right-img { display: none; }
    .right-img-alt { display: none !important; }
}


