/**
 * Stili Frontend per Parrocchia Prenotazione Sale
 */

.pps-wrapper {
    max-width: 1100px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

.pps-wrapper * {
    box-sizing: border-box;
}

/* Header */
.pps-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F4EFEA;
    border: 1px solid #E2DAD0;
    color: #1C1917;
    padding: 26px 30px;
    border-radius: 14px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(28, 25, 23, 0.04);
}

.pps-header-text h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    color: #1C1917;
    font-weight: 800;
}

.pps-header-text p {
    margin: 0;
    color: #78716C;
    font-size: 14.5px;
}

/* Legenda */
.pps-legend-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.pps-legend-title {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.pps-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pps-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.pps-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Navigazione Mese */
.pps-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.pps-month-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    text-transform: capitalize;
}

.pps-nav-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pps-nav-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: scale(1.05);
}

/* Calendario Grid */
.pps-calendar-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.pps-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    padding: 12px 0;
}

.pps-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #cbd5e1;
    gap: 1px;
}

.pps-cal-day {
    background: #ffffff;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    height: 96px;
    max-height: 96px;
    overflow: hidden;
    padding: 6px 7px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    flex-direction: column;
}

.pps-cal-day:hover {
    background: #f1f5f9;
}

.pps-cal-day.pps-other-month {
    background: #f8fafc;
    color: #94a3b8;
    opacity: 0.6;
}

.pps-cal-day.pps-today {
    background: #eff6ff;
}

.pps-cal-day.pps-today .pps-day-num {
    background: #B84A2A;
    color: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.pps-cal-day.pps-selected {
    box-shadow: inset 0 0 0 2px #B84A2A;
    background: #fdf8f6;
}

.pps-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.pps-day-num {
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.pps-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
    overflow: hidden;
    min-width: 0;
}

.pps-event-pill {
    display: block;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 1.35;
    padding: 2px 5px;
    border-radius: 4px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.pps-more-badge {
    display: block;
    max-width: 100%;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    padding: 1px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
/* Stato di caricamento calendario */
@keyframes ppsSpin {
    to { transform: rotate(360deg); }
}

.pps-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid #ebdcd4;
    border-top-color: #B84A2A;
    border-radius: 50%;
    animation: ppsSpin 0.75s linear infinite;
}

.pps-calendar-loading {
    grid-column: 1 / -1;
    background: #ffffff;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    min-height: 200px;
}

/* Popup dettaglio giorno: sfondo scuro a tutto schermo, popup centrato */
.pps-day-detail-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100000;
    background: rgba(20, 15, 12, 0.6);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Blocca lo scroll della pagina mentre il popup e' aperto */
html.pps-modal-open,
html.pps-modal-open body {
    overflow: hidden;
}

.pps-day-detail-overlay .pps-day-detail-panel,
.pps-day-detail-overlay .pps-day-detail-panel#pps-day-detail-panel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 20px 22px;
    margin: 0;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
    animation: ppsFadeIn 0.25s ease;
    outline: none;
}

@keyframes ppsFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.pps-day-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pps-day-detail-header h4 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
}

.pps-close-detail {
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
}

.pps-detail-item {
    background: #ffffff;
    border-radius: 6px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modulo di Prenotazione */
.pps-booking-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 35px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.pps-section-title h3 {
    margin: 0 0 6px 0;
    font-size: 22px;
    color: #0f172a;
}

.pps-section-title p {
    margin: 0 0 25px 0;
    color: #64748b;
    font-size: 15px;
}

.pps-form-group-block {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.pps-group-heading {
    margin: 0 0 15px 0;
    font-size: 17px;
    color: #1e3a8a;
    font-weight: 600;
}

.pps-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.pps-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.pps-field {
    display: flex;
    flex-direction: column;
}

.pps-field-full {
    grid-column: span 2;
}

.pps-field label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #334155;
}

.pps-field input,
.pps-field select,
.pps-field textarea {
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pps-field input:focus,
.pps-field select:focus,
.pps-field textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pps-hint {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

/* Card Selezione Multi-Sala */
.pps-sale-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

.pps-sale-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.pps-sale-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pps-sale-card-inner {
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
    height: 100%;
}

.pps-sale-card:hover .pps-sale-card-inner {
    border-color: #94a3b8;
    background: #ffffff;
    transform: translateY(-2px);
}

.pps-sale-checkbox:checked + .pps-sale-card-inner {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.pps-sale-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pps-card-color-bar {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}

.pps-sale-name {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
}

.pps-dotazioni-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 6px 0; padding: 0; color: #475569; }
.pps-dotazioni-list .pps-dotazione { display: inline-flex; margin: 0; padding: 0; }
.pps-dotazioni-list .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pps-sale-cap {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.pps-sale-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* Box Notice */
/* Casella consenso privacy (stesso aspetto del form contatti del tema) */
.pps-privacy-check { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 18px; font-size: .95rem; line-height: 1.45; }
.pps-privacy-check input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: #b84a2a; }
.pps-privacy-check label { margin: 0; font-weight: 500; }
.pps-privacy-check a { text-decoration: underline; }

.pps-notice-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #92400e;
    line-height: 1.5;
}

.pps-notice-box p {
    margin: 0;
}

/* Pulsanti */
.pps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
}

.pps-btn-primary {
    background: #B84A2A;
    color: #ffffff;
}

.pps-btn-primary:hover {
    background: #96381C;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(184, 74, 42, 0.3);
}

.pps-btn-outline {
    background: transparent;
    border: 1.5px solid #B84A2A;
    color: #B84A2A;
}

.pps-btn-outline:hover {
    background: #F7EFEA;
}

.pps-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.pps-btn-large {
    padding: 14px 32px;
    font-size: 16px;
    width: 100%;
}

.pps-submit-container {
    margin-top: 10px;
}

/* Alert Feedback */
.pps-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.pps-alert-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.pps-alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .pps-header-box {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    .pps-grid-3,
    .pps-grid-2 {
        grid-template-columns: 1fr;
    }
    .pps-field-full {
        grid-column: span 1;
    }
    .pps-booking-section {
        padding: 20px;
    }
    .pps-cal-day {
        min-height: 65px;
        padding: 4px;
    }
    .pps-event-pill {
        font-size: 9px;
        padding: 1px 3px;
    }
}

/* Loading State for Calendar Grid */
.pps-calendar-loading {
    grid-column: 1 / span 7 !important;
    width: 100% !important;
    min-height: 220px;
    background: #ffffff;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px;
    padding: 60px 20px;
    text-align: center;
}

.pps-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3.5px solid #ebdcd4;
    border-top-color: #B84A2A;
    border-radius: 50%;
    display: inline-block;
    animation: ppsSpin 0.8s linear infinite;
}

@keyframes ppsSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

