/**
 * FSA Eventi - Public Booking Form Styles
 *
 * Stili per il form di prenotazione eventi
 * I colori possono essere personalizzati dal pannello Impostazioni
 */

/* CSS Variables - Personalizzabili dal pannello admin */
:root {
    --fsa-eventi-primary-color: #806961;
    --fsa-eventi-background-color: #f9f9f9;
    --fsa-eventi-text-color: #333333;
    --fsa-eventi-border-color: #dddddd;
    --fsa-eventi-card-title-size: 24px;
    --fsa-eventi-card-subtitle-size: 14px;
    --fsa-eventi-card-label-size: 16px;
    --fsa-eventi-card-button-size: 14px;
    --fsa-eventi-card-padding: 25px 30px;
    --fsa-eventi-card-gap: 20px;
    --fsa-eventi-card-max-width: 650px;
    --fsa-eventi-font-family: inherit;
}

/* Container principale del form */
.fsa-eventi-booking-form {
    font-family: var(--fsa-eventi-font-family);
    background: var(--fsa-eventi-background-color);
    padding: 20px 0;
    margin: 30px 0;
    max-width: 100%;
}

.fsa-eventi-booking-form h3 {
    color: var(--fsa-eventi-text-color);
    margin-bottom: 20px;
    text-align: left;
    font-size: 24px;
    font-weight: 400;
}

/* Righe del form */
.fsa-eventi-form-row {
    margin-bottom: 15px;
}

.fsa-eventi-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    text-align: center;
}

.fsa-eventi-form-row input,
.fsa-eventi-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--fsa-eventi-border-color);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Pulsante submit */
.fsa-eventi-submit-btn {
    background: var(--fsa-eventi-primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.fsa-eventi-submit-btn:hover {
    background: var(--fsa-eventi-primary-color);
    opacity: 0.9;
}

.fsa-eventi-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Info evento */
.fsa-eventi-event-info {
    background: var(--fsa-eventi-primary-color);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid var(--fsa-eventi-primary-color);
}

.fsa-eventi-event-info h4 {
    margin: 0 0 10px 0;
    color: #fff;
}

.fsa-eventi-days-remaining {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.fsa-eventi-seats-remaining {
    font-size: 20px;
    color: #fff;
}

/* Messaggi */
.fsa-eventi-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.fsa-eventi-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fsa-eventi-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stati di caricamento */
.fsa-eventi-loading {
    opacity: 0.6;
    pointer-events: none;
}

.fsa-eventi-no-events {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Pulsante indietro */
.fsa-eventi-back-btn {
    background: #6c757d;
    color: white;
    padding: 13px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
}

.fsa-eventi-back-btn:hover {
    background: #5a6268;
}

/* Utility classes */
.fsa-eventi-hidden {
    display: none !important;
}

/* Validazione campi */
.fsa-eventi-field-error {
    color: #d63638;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.fsa-eventi-field-invalid {
    border-color: #d63638 !important;
    box-shadow: 0 0 3px rgba(214, 54, 56, 0.3);
}

.fsa-eventi-field-valid {
    border-color: #00a32a !important;
    box-shadow: 0 0 3px rgba(0, 163, 42, 0.3);
}

/* Selettore numerico */
.fsa-eventi-number-selector {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--fsa-eventi-border-color);
    border-radius: 4px;
    overflow: hidden;
}

.fsa-eventi-number-selector button {
    background: #f0f0f0;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: var(--fsa-eventi-text-color);
}

.fsa-eventi-number-selector button:hover {
    background: #e0e0e0;
}

.fsa-eventi-number-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fsa-eventi-number-selector input {
    border: none !important;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    width: 60px !important;
    background: var(--fsa-eventi-background-color);
    margin: 0;
}

/* Checkbox privacy */
.fsa-eventi-checkbox-row {
    display: flex;
    align-items: flex-start;
    margin: 15px 0;
    gap: 10px;
}

.fsa-eventi-checkbox-row input[type="checkbox"] {
    width: auto !important;
    margin-top: 3px;
    flex-shrink: 0;
}

.fsa-eventi-checkbox-row label {
    text-align: left !important;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.fsa-eventi-checkbox-row a {
    color: var(--fsa-eventi-primary-color);
    text-decoration: underline;
}

.fsa-eventi-checkbox-row a:hover {
    opacity: 0.8;
}

/* Layout speciale per form biglietti */
.fsa-eventi-tickets-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fsa-eventi-tickets-row label {
    margin-bottom: 0 !important;
    min-width: 120px;
    text-align: left;
}

.fsa-eventi-tickets-row .fsa-eventi-number-selector {
    flex-shrink: 0;
}

/* Date buttons grid layout - stile card orizzontale */
.fsa-eventi-dates-grid {
    display: flex;
    flex-direction: column;
    gap: var(--fsa-eventi-card-gap);
    margin-top: 10px;
    max-width: var(--fsa-eventi-card-max-width);
    width: 100%;
}

/* Nascondi elementi extra quando è presente il layout a card */
#all-dates-container-93 ~ #fsa-eventi-event-info-93,
#all-dates-container-93 ~ .fsa-eventi-form-row {
    display: none !important;
}

/* Regola generica per tutti i post ID */
[id^="all-dates-container-"] ~ [id^="fsa-eventi-event-info-"],
[id^="all-dates-container-"] ~ .fsa-eventi-form-row {
    display: none !important;
}

.fsa-eventi-date-button {
    background: #ffffff;
    border: 1px solid var(--fsa-eventi-border-color);
    border-radius: 8px;
    padding: var(--fsa-eventi-card-padding);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    color: var(--fsa-eventi-text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-date-button:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fsa-eventi-date-button-active {
    background: #ffffff !important;
    border-color: var(--fsa-eventi-primary-color) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
}

.fsa-eventi-date-button-active:hover {
    background: #ffffff !important;
}

.fsa-eventi-date-button .event-date-info {
    flex: 1;
}

.fsa-eventi-date-button .event-date-title {
    font-size: var(--fsa-eventi-card-title-size);
    color: var(--fsa-eventi-text-color);
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.fsa-eventi-date-button .event-date-subtitle {
    font-size: var(--fsa-eventi-card-subtitle-size);
    color: #888888;
    font-weight: 400;
}

.fsa-eventi-date-button .event-register-section {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.fsa-eventi-date-button .event-register-label {
    font-size: var(--fsa-eventi-card-label-size);
    color: var(--fsa-eventi-text-color);
    font-weight: 400;
}

.fsa-eventi-date-button .event-register-btn {
    background-color: var(--fsa-eventi-primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 35px;
    font-size: var(--fsa-eventi-card-button-size);
    font-weight: 600;
    letter-spacing: 1.5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.fsa-eventi-date-button-active .event-register-btn {
    opacity: 0.9;
}

/* Nascondi vecchi elementi date nel nuovo layout */
.fsa-eventi-date-button .date-day,
.fsa-eventi-date-button .date-number,
.fsa-eventi-date-button .date-month,
.fsa-eventi-date-button .date-time {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .fsa-eventi-booking-form {
        padding: 15px;
        max-width: 100%;
        margin: 15px 0;
    }

    .fsa-eventi-booking-form h3 {
        font-size: 20px;
    }

    .fsa-eventi-number-selector button {
        padding: 8px 12px;
        font-size: 16px;
    }

    .fsa-eventi-number-selector input {
        width: 50px !important;
    }

    .fsa-eventi-tickets-row {
        flex-direction: column;
        align-items: stretch;
    }

    .fsa-eventi-tickets-row label {
        min-width: auto;
        text-align: center;
    }

    .fsa-eventi-date-button {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px;
    }

    .fsa-eventi-date-button .event-register-section {
        width: 100%;
        align-items: stretch;
        margin-top: 20px;
    }

    .fsa-eventi-date-button .event-register-btn {
        width: 100%;
    }

    .fsa-eventi-date-button .event-date-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .fsa-eventi-booking-form {
        padding: 10px;
    }

    .fsa-eventi-form-row input,
    .fsa-eventi-form-row select {
        font-size: 16px; /* Previene zoom su iOS */
    }

    .fsa-eventi-checkbox-row {
        flex-direction: row;
        gap: 8px;
    }
}

/* ===========================
   REGISTRATION FORM STYLES
   =========================== */

/* Page Title */
.fsa-eventi-page-title {
    font-size: 20px;
    color: #6b6b6b;
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    font-family: var(--fsa-eventi-font-family);
}

/* Two-column grid layout */
.fsa-eventi-registration-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
    max-width: 750px;
}

/* Form Section (Left Column) */
.fsa-eventi-form-section {
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}

.fsa-eventi-form-section h2 {
    font-size: 18px;
    color: #6b6b6b;
    font-weight: 400;
    margin-bottom: 20px;
    font-family: var(--fsa-eventi-font-family);
}

/* Form Groups */
.fsa-eventi-form-group {
    margin-bottom: 18px;
}

.fsa-eventi-form-group label {
    display: block;
    font-size: 14px;
    color: #6b6b6b;
    margin-bottom: 6px;
    font-weight: 400;
    text-align: left;
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-required {
    color: #d32f2f;
    margin-left: 3px;
}

.fsa-eventi-form-group input[type="text"],
.fsa-eventi-form-group input[type="email"],
.fsa-eventi-form-group input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: #ffffff;
    color: #333333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

.fsa-eventi-form-group input::placeholder {
    color: #999999;
}

/* Checkbox Group dentro Form Group */
.fsa-eventi-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fsa-eventi-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.fsa-eventi-checkbox-group label {
    font-size: 13px;
    color: #6b6b6b;
    line-height: 1.5;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}

.fsa-eventi-checkbox-group a {
    color: var(--fsa-eventi-primary-color);
    text-decoration: underline;
}

.fsa-eventi-checkbox-group a:hover {
    opacity: 0.8;
}

/* Form Buttons */
.fsa-eventi-form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.fsa-eventi-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-btn-cancel {
    background-color: #e8e8e8;
    color: #6b6b6b;
}

.fsa-eventi-btn-cancel:hover {
    background-color: #d8d8d8;
}

.fsa-eventi-btn-submit {
    background-color: #6b5d56;
    color: #ffffff;
}

.fsa-eventi-btn-submit:hover {
    background-color: #5a4d47;
}

/* Summary Section (Right Column) */
.fsa-eventi-summary-section {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.fsa-eventi-summary-section h2 {
    font-size: 16px;
    color: #6b6b6b;
    font-weight: 400;
    margin-bottom: 20px;
    font-family: var(--fsa-eventi-font-family);
}

/* Participant Counter */
.fsa-eventi-participant-counter {
    margin-bottom: 30px;
}

.fsa-eventi-participant-counter p {
    font-size: 13px;
    color: #6b6b6b;
    margin-bottom: 12px;
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-counter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fsa-eventi-counter-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    background-color: #ffffff;
    color: #333333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-counter-btn:hover {
    border-color: #6b5d56;
    color: #6b5d56;
}

.fsa-eventi-counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #d0d0d0;
    color: #333333;
}

.fsa-eventi-counter-value {
    font-size: 24px;
    color: #333333;
    font-weight: 400;
    min-width: 40px;
    text-align: center;
    font-family: var(--fsa-eventi-font-family);
}

/* Participant Display */
.fsa-eventi-participant-display {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.fsa-eventi-participant-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #6b6b6b;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    font-family: var(--fsa-eventi-font-family);
}

.fsa-eventi-participant-icon::before {
    content: "👤";
    font-size: 18px;
}

.fsa-eventi-participant-number {
    font-size: 48px;
    color: #333333;
    font-weight: 300;
    font-family: var(--fsa-eventi-font-family);
}

/* Responsive for registration form */
@media (max-width: 968px) {
    .fsa-eventi-registration-wrapper {
        grid-template-columns: 1fr;
    }

    .fsa-eventi-page-title {
        font-size: 28px;
    }

    .fsa-eventi-form-section,
    .fsa-eventi-summary-section {
        padding: 30px 25px;
    }
}
