/* stile_prenota.css - Stile per pagina di prenotazione - VERSIONE PULITA */

/* ========================================== */
/* RESET BASE                                 */
/* ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* ========================================== */
/* CONTAINER PRINCIPALE                       */
/* ========================================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* ========================================== */
/* NAVIGAZIONE E LINK                         */
/* ========================================== */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.back-link:hover {
    text-decoration: underline;
    color: #5a67d8;
}

/* ========================================== */
/* TITOLI E SEZIONE INFO CENA                 */
/* ========================================== */
h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #444;
}

.cena-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.cena-info h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.8em;
}

.cena-info .data {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.cena-info .descrizione {
    font-size: 1rem;
    color: #555;
    margin-top: 15px;
}

/* ========================================== */
/* DISPONIBILITÀ POSTI                        */
/* ========================================== */
.disponibilita {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    border-left: 5px solid #28a745;
    transition: all 0.3s ease;
}

.disponibilita.scarsi {
    border-left-color: #ffc107;
    background: #fff3cd;
    animation: pulse 2s infinite;
}

.disponibilita.esaurito {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.posti-info {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.posti-esauriti {
    color: #dc3545;
    font-size: 1.3em;
}

.occupazione-info {
    font-size: 0.85em;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

.esaurito-text {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 1rem;
}

/* Animazione pulse per posti scarsi */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========================================== */
/* BARRA DI PROGRESSO                         */
/* ========================================== */
.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    transition: width 0.6s ease;
    border-radius: 10px;
}

.progress-fill.low { 
    background: linear-gradient(90deg, #28a745, #20c997); 
}

.progress-fill.medium { 
    background: linear-gradient(90deg, #ffc107, #fd7e14); 
}

.progress-fill.high { 
    background: linear-gradient(90deg, #dc3545, #e74c3c); 
}

.progress-fill.loading-progress {
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 100% !important;
    animation: pulse 1s infinite;
}

/* ========================================== */
/* ALERT E MESSAGGI                           */
/* ========================================== */
.alert {
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ========================================== */
/* NOTE INFORMATIVE                           */
/* ========================================== */
.form-note {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    font-size: 0.9em;
    line-height: 1.6;
}

.required-star {
    color: #dc3545;
    font-weight: bold;
}

/* ========================================== */
/* FIELDSET E FORM STRUCTURE                  */
/* ========================================== */
fieldset {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px 20px;
    margin-bottom: 25px;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

fieldset:hover {
    border-color: #dee2e6;
}

fieldset legend {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 15px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

/* ========================================== */
/* LAYOUT FORM ROWS                           */
/* ========================================== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row > div {
    flex: 1;
}

/* ========================================== */
/* LABELS E INPUT STYLING                     */
/* ========================================== */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.required-field::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover {
    border-color: #bbb;
}

/* Placeholder styling */
input::placeholder {
    color: #aaa;
    font-style: italic;
}

/* ========================================== */
/* FIELD INFO E HELP TEXT                     */
/* ========================================== */
.field-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* ========================================== */
/* PULSANTI                                   */
/* ========================================== */
.submit-section {
    text-align: center;
    margin-top: 30px;
}

button[type="submit"] {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 200px;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.prenota-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 1em;
}

.prenota-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* ========================================== */
/* LOADING E STATI                            */
/* ========================================== */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loading-bar {
    margin: 15px 0;
}

.loading-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.form-disabled {
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
}

/* ========================================== */
/* SEZIONE ESAURITO                           */
/* ========================================== */
.esaurito-section {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.esaurito-message {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

/* ========================================== */
/* RESPONSIVE DESIGN                          */
/* ========================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row > div {
        width: 100%;
        margin-bottom: 0;
    }
    
    .cena-info h2 {
        font-size: 1.5em;
    }
    
    .cena-info .data {
        font-size: 1.1em;
    }
    
    fieldset {
        padding: 20px 15px;
    }
    
    fieldset legend {
        padding: 8px 12px;
        font-size: 1em;
    }
    
    button[type="submit"] {
        width: 100%;
        padding: 15px;
        font-size: 1.1em;
    }
    
    .back-link {
        font-size: 0.9em;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 10px;
        border-radius: 8px;
    }
    
    .cena-info {
        padding: 15px;
    }
    
    .cena-info h2 {
        font-size: 1.3em;
    }
    
    .disponibilita {
        padding: 15px;
    }
    
    .posti-info {
        font-size: 1.1em;
    }
    
    fieldset {
        padding: 15px 12px;
        margin-bottom: 20px;
    }
    
    fieldset legend {
        padding: 6px 10px;
        font-size: 0.95em;
    }
    
    .form-note {
        padding: 12px;
        font-size: 0.85em;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="file"] {
        padding: 12px;
        font-size: 16px; /* Previene zoom su iOS */
    }
    
    .field-info {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    
    button[type="submit"] {
        font-size: 1em;
        padding: 12px;
    }
}

/* ========================================== */
/* PRINT STYLES                               */
/* ========================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        max-width: none;
        margin: 0;
        padding: 20px;
    }
    
    .back-link,
    .loading,
    button,
    .prenota-btn {
        display: none !important;
    }
    
    .alert {
        border: 2px solid #333;
        background: white !important;
        color: #333 !important;
    }
    
    fieldset {
        border: 1px solid #333;
        background: white;
    }
    
    input {
        border: 1px solid #333;
        background: white;
    }
}

/* ========================================== */
/* ACCESSIBILITY ENHANCEMENTS                 */
/* ========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible per navigazione keyboard */
input:focus-visible,
button:focus-visible,
.back-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Miglioramenti contrasto per accessibilità */
@media (prefers-contrast: high) {
    .field-info {
        background: #e9ecef;
        border-left-color: #333;
    }
    
    fieldset {
        border-color: #333;
    }
    
    input {
        border-color: #333;
    }
}

/* ========================================== */
/* UTILITIES                                  */
/* ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }