/* --- 1. IMPOSTAZIONI GLOBALI E COLORI --- */
:root {
    /* La tua palette di colori */
    --orange: #ff7a00;
    --dark: #222;
    --mid: #444;
    --light: #ffffff;
    --muted: #9aa0a6;
    --bg: #0f0f0f;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: var(--dark);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--mid);
}

/* Stile per il logo (se presente) */
.header-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    max-width: 200px;
    height: auto;
}

h1 {
    color: var(--light);
    font-weight: 800;
    font-size: 32px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

h2, h4 {
    color: var(--light);
    font-weight: 700;
    margin-bottom: 10px;
}

p {
    text-align: center;
    margin-top: 0;
    margin-bottom: 40px;
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--mid);
    margin: 40px 0;
}

/* --- 2. STILI PER I MODULI E GLI INPUT --- */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
    color: var(--muted);
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
.time-select { /* Stile unificato per input e select */
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mid);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--dark);
    color: var(--light);
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
.time-select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.2);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group label a {
    color: var(--orange);
    text-decoration: underline;
    font-weight: 600;
}

/* Stile per la griglia a due colonne */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group label a { color: var(--orange); text-decoration: underline; font-weight: 600; }

/* Stile per il contenitore dei selettori data */
.date-select-group { display: flex; gap: 10px; }
.date-select-group select {
    flex: 1; width: 100%; padding: 12px 15px; border: 1px solid var(--mid);
    border-radius: 8px; background-color: var(--dark); color: var(--light);
    font-size: 16px; appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239aa0a6%22%20d%3D%22M287%2C114.7L154.7%2C247.1c-2.7%2C2.7-6.2%2C4-9.6%2C4s-6.9-1.3-9.6-4L5.4%2C114.7c-5.3-5.3-5.3-13.8%2C0-19.1s13.8-5.3%2C19.1%2C0l120.3%2C120.3L267.9%2C95.6c5.3-5.3%2C13.8-5.3%2C19.1%2C0C292.3%2C100.9%2C292.3%2C109.4%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}

/* --- 3. STILI PER L'INTERFACCIA A PASSI --- */
.booking-step {
    border-top: 1px solid var(--mid);
    padding-top: 30px;
    margin-top: 30px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--orange);
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-right: 15px;
}

/* Stili per il Calendario */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--light);
}

.calendar-header button {
    background: none;
    border: 1px solid var(--mid);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    color: var(--muted);
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    background-color: var(--mid);
    color: var(--orange);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 5px;
}

.calendar-weekdays div {
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    padding-bottom: 10px;
}

.calendar-day {
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--light);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.calendar-day:not(.empty):not(.past):hover {
    background-color: var(--mid);
}

.calendar-day.selected {
    background-color: var(--orange);
    color: white !important;
    font-weight: 700;
    border-radius: 8px; /* Forma a rettangolo stondato */
}

.calendar-day.past {
    color: #444;
    cursor: not-allowed;
}

/* Stili per le Pillole di selezione (Durata) */
.choice-group {
    display: flex;
    gap: 10px;
}

.radio-pill {
    flex-grow: 1;
}

.radio-pill input {
    display: none;
}

.radio-pill label {
    display: block;
    text-align: center;
    border: 1px solid var(--mid);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.radio-pill input:checked + label {
    background-color: var(--orange);
    border-color: var(--orange);
    color: white;
}

/* Stile per il menu a tendina dell'orario */
.time-select {
    -webkit-appearance: none;
    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='%239aa0a6' 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 1rem center;
    background-size: 1em;
    cursor: pointer;
}

/* --- 4. STILI PER PULSANTI E PAGINE FINALI --- */
.hidden {
    display: none;
}

button[type="submit"],
.button-link {
    width: 100%;
    padding: 16px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    margin-top: 30px;
    text-decoration: none;
    display: block;
}

button[type="submit"]:hover,
.button-link:hover {
    background: var(--orange);
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.summary {
    background-color: var(--mid);
    border-left: 4px solid var(--orange);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 25px;
}

.confirmation-box,
.error-box {
    text-align: center;
}

.tickets-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.ticket-card {
    background-color: var(--mid);
    border: 1px solid var(--mid);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.qr-code {
    width: 150px;
    height: 150px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: white;
    padding: 5px;
}

.error-message {
    background-color: #4c1d23;
    border: 1px solid #7f1d1d;
    color: #fecaca;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Stili specifici per la pagina di errore */
body.error-page .header-logo {
    margin: 40px auto; /* Centra il logo orizzontalmente e aggiunge un po' di spazio */
    display: block; /* Assicura che i margini automatici funzionino */
}

button:disabled {
    background-color: var(--mid);
    cursor: not-allowed;
    filter: brightness(0.7);
}

/* Stili per Pop-up (Modale) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--dark);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--mid);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
}

.modal-text {
    margin: 20px 0;
}

/* --- REGOLE AGGIUNTE PER ALLINEARE A SINISTRA --- */
.modal-text p,
.modal-text ul,
.modal-text h3,
.modal-text h4 {
    text-align: left;
}

/* Allinea a sinistra anche gli elementi della lista */
.modal-text ul li {
    text-align: left;
    margin-bottom: 10px; /* Aggiunge un po' di spazio tra i punti della lista */
}

/* --- 5. ADATTABILITÀ PER MOBILE --- */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .tickets-container {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------Stile per il contenitore dei selettori data----------------------------- */
.date-select-group {
    display: flex; /* Mette Giorno, Mese, Anno sulla stessa riga */
    gap: 10px; /* Spazio tra i selettori */
}

/* Stile per i singoli selettori (Giorno, Mese, Anno) */
.date-select-group select {
    flex: 1; /* Distribuisce lo spazio equamente tra i selettori */
    width: 100%; /* Occupa lo spazio disponibile */
    padding: 12px 15px; /* Spaziatura interna come i tuoi input */
    border: 1px solid #444; /* Bordo simile ai tuoi input */
    border-radius: 8px; /* Angoli arrotondati */
    background-color: #333; /* Sfondo scuro */
    color: #E0E0E0; /* Testo chiaro */
    font-size: 16px; /* Dimensione font */
    appearance: none; /* Rimuove lo stile di default del browser per i select */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer; /* Indica che è cliccabile */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23E0E0E0%22%20d%3D%22M287%2C114.7L154.7%2C247.1c-2.7%2C2.7-6.2%2C4-9.6%2C4c-3.4%2C0-6.9-1.3-9.6-4L5.4%2C114.7c-5.3-5.3-5.3-13.8%2C0-19.1c5.3-5.3%2C13.8-5.3%2C19.1%2C0l120.3%2C120.3L267.9%2C95.6c5.3-5.3%2C13.8-5.3%2C19.1%2C0C292.3%2C100.9%2C292.3%2C109.4%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E'); /* Freccia personalizzata */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.date-select-group select:focus {
    outline: none; /* Rimuove l'outline di default al focus */
    border-color: #007bff; /* Bordo colorato al focus (es. blu) */
}

/* Assicurati che il tuo form-group contenga questi stili per un layout corretto */
.form-group {
    margin-bottom: 20px; /* Spazio tra i gruppi di form */
}

/* Stile per la sezione informazioni in prenoto3.php */
.info-section {
    text-align: left;
    margin-top: 30px;
    padding: 20px;
    background-color: var(--mid);
    border-radius: 8px;
}

.info-section h3 {
    margin-top: 0;
    color: var(--light);
}

.info-section ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.info-section ul li {
    margin-bottom: 10px;
}