/* Sito Pubblico Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Il sito è chiaro, e lo dice. Senza uno sfondo dichiarato un browser in
   modalità scura dipinge la pagina di nero: finché in alto c'era il riquadro
   blu non si notava, ma il logo è grigio antracite e sul nero sparisce. */
:root {
    color-scheme: light;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2c3e50;
    background: #ffffff;
    line-height: 1.6;
}

/* Header */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Il logo accanto al nome e non al suo posto: ridotto a 44 pixel la
   scritta dentro la lampadina non si legge più, e il nome deve restare. */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #2e2e30;
    text-decoration: none;
}

.logo img {
    height: 44px;
    width: auto;
}

.nav-links a {
    color: #2c3e50;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: #1f5b45;
}

/* Hero: il logo su fondo chiaro accanto alla foto, non sopra. Il logo è
   grigio antracite e su una foto scura sparirebbe; schiarirlo per farlo
   leggere vorrebbe dire usare un logo che non è il loro. */
.hero {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) 3fr;
    gap: 2.5rem;
    align-items: center;
    padding: 2.5rem 2rem;
}

.hero-testo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.hero-logo {
    width: 140px;
    height: auto;
    margin-bottom: 0.8rem;
}

.hero h1 {
    font-size: 2.6rem;
    line-height: 1.1;
    color: #2e2e30;
}

.hero p {
    font-size: 1.2rem;
    color: #7a6f66;
}

.hero-foto {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Galleria: la foto al lavoro e l'ingresso affiancati alla stessa altezza,
   la poltrona sotto a tutta larghezza. Con 2 colonne contro 1 l'ingresso,
   che è verticale, perde solo un decimo in altezza invece di mezza foto. */
.galleria-griglia {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.8rem;
}

.galleria-griglia figure {
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
}

.galleria-griglia img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-lavoro {
    aspect-ratio: 3 / 2;
}

.foto-poltrona {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 6;
}

/* Lo schienale sta un po' sopra il centro: centrato si tagliava la testiera. */
.foto-poltrona img {
    object-position: 50% 40%;
}

@media (max-width: 760px) {
    /* Col logo in più, a 375 pixel il nome andava a capo e "Chi siamo" si
       spezzava su due righe. Tutto su una: c'è posto, bastava non sprecarlo. */
    .site-header nav {
        padding: 0.6rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
        white-space: nowrap;
    }

    .logo img {
        height: 36px;
    }

    .nav-links a {
        margin-left: 1rem;
        white-space: nowrap;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .hero-testo {
        align-items: center;
    }

    .hero-logo {
        width: 100px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .galleria-griglia {
        grid-template-columns: 1fr;
    }

    .foto-ingresso {
        aspect-ratio: 4 / 5;
    }

    .foto-poltrona {
        aspect-ratio: 3 / 2;
    }
}

/* Sections */
section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1f5b45;
    font-size: 1.8rem;
}

/* Orari */
.orari-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.orario-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.giorno {
    font-weight: 600;
    text-transform: capitalize;
}

.ore {
    color: #555;
}

/* Servizi */
.servizi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.servizio-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.servizio-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.servizio-card .prezzo {
    display: block;
    color: #1f5b45;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.servizio-card .durata {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Operatori */
.operatori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.operatore-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.operatore-foto {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    /* Le foto vere non arriveranno quadrate: si ritagliano invece di
       deformare la faccia di qualcuno. */
    object-fit: cover;
}

/* Contatti */
.contatti {
    text-align: center;
}

.contatti-azioni {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

/* Due bottoni della stessa misura: nessuno dei due è "quello secondario". */
.contatto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-width: 15rem;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.contatto:focus-visible {
    outline: 3px solid #1f5b45;
    outline-offset: 3px;
}

.contatto-chat {
    background: #1f5b45;
    color: #ffffff;
}

.contatto-chat:hover {
    background: #174535;
}

/* Il verde di WhatsApp è quello che la gente riconosce: non si cambia. */
.contatto-whatsapp {
    background: #ffffff;
    color: #128c4a;
    border-color: #25d366;
}

.contatto-whatsapp:hover {
    background: #25d366;
    color: #ffffff;
}

.contatti-numero {
    margin-top: 0.9rem;
    color: #7f8c8d;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .contatto {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contatto {
        transition: none;
    }
}

/* Page content */
.page-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-content h1 {
    color: #1f5b45;
    margin-bottom: 1.5rem;
}

.page-content p {
    margin-bottom: 1rem;
    color: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: #2e2e30;
    color: white;
    margin-top: 2rem;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1f5b45;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.4);
    transition: transform 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    /* Il listino ha voci lunghe e il bot propone elenchi di orari: in 360px
       andava tutto a capo e si leggeva male. Si adatta alla finestra, così su
       schermi piccoli non esce dal bordo. */
    width: min(440px, calc(100vw - 40px));
    height: min(640px, calc(100vh - 140px));
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel.hidden {
    display: none;
}

.chat-header {
    background: #1f5b45;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-header-azioni {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-close,
.chat-restart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.chat-restart {
    font-size: 1.25rem;
    opacity: 0.85;
}

.chat-restart:hover,
.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    /* L'altezza la decide il riquadro: qui basta occupare lo spazio rimasto
       fra intestazione e casella di scrittura. */
    min-height: 0;
}

.message {
    margin-bottom: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
    /* Il bot manda elenchi su più righe: senza questo il browser li appiattisce
       tutti su una riga sola e il listino diventa illeggibile. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message.bot {
    background: #f1f3f4;
    align-self: flex-start;
}

.message.user {
    background: #1f5b45;
    color: white;
    margin-left: auto;
}

/* Sta scrivendo: i tre puntini che si alzano a turno.
   Una risposta può richiedere qualche secondo, perché dietro c'è il modello e
   spesso anche una lettura dei calendari. Senza nessun segnale il riquadro
   sembra fermo e il cliente riscrive, o se ne va. */
.message.sta-scrivendo {
    display: flex;
    gap: 4px;
    align-items: center;
    width: fit-content;
}

.message.sta-scrivendo span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9aa0a6;
    animation: puntino 1.2s infinite ease-in-out;
}

.message.sta-scrivendo span:nth-child(2) {
    animation-delay: 0.2s;
}

.message.sta-scrivendo span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes puntino {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Chi ha chiesto di ridurre le animazioni non deve vedere niente muoversi */
@media (prefers-reduced-motion: reduce) {
    .message.sta-scrivendo span {
        animation: none;
        opacity: 0.7;
    }
}

.chat-input-area {
    display: flex;
    padding: 0.8rem;
    border-top: 1px solid #eee;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

#chat-input:focus {
    border-color: #1f5b45;
}

.chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1f5b45;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send:hover {
    background: #174535;
}

/* Chat Option Buttons */
.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    padding: 0 0.2rem;
}

.chat-option-btn {
    padding: 0.5rem 0.9rem;
    border: 2px solid #1f5b45;
    background: white;
    color: #1f5b45;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    /* I nomi del listino sono lunghi: il bottone va a capo invece di uscire
       dal riquadro della chat. */
    max-width: 100%;
    white-space: normal;
    text-align: left;
    transition: all 0.15s;
}

.chat-option-btn:hover {
    background: #1f5b45;
    color: white;
}

.chat-option-btn.con-faccia {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0.35rem;
}

.faccia-operatore {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 40px);
        right: -10px;
    }
}
