.tgb-booking {
    max-width: 900px;
    margin: 30px auto;
    padding: 24px;
    border-radius: 18px;
    background: #f9fafb;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    box-sizing: border-box;
}

.tgb-step h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 600;
}

.tgb-step-help {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Cards griglia (servizi, professionisti) */

.tgb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.tgb-card {
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tgb-card strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.tgb-card small {
    font-size: 0.8rem;
    color: #6b7280;
}

.tgb-card:hover {
    box-shadow: 0 12px 30px rgba(148, 163, 184, 0.4);
    transform: translateY(-1px);
    border-color: #4f46e5;
}

.tgb-card-selected {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px #4f46e5;
}

/* Professionisti */

.tgb-pro-photo {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.tgb-pro-body {
    flex: 1 1 auto;
}

/* Bottoni */

.tgb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 8px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.tgb-btn-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.tgb-btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.tgb-btn-secondary {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111827;
}

.tgb-btn-secondary:hover {
    background: #d1d5db;
}

.tgb-btn-light {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

.tgb-btn-whatsapp {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
}

.tgb-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.tgb-row-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Calendario */

.tgb-calendar-wrap {
    margin-top: 12px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
}

.tgb-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

#tgb-cal-title {
    font-weight: 600;
}

.tgb-calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.tgb-calendar th,
.tgb-calendar td {
    width: 14.285%;
    text-align: center;
    padding: 6px 0;
}

.tgb-calendar th {
    color: #6b7280;
    font-weight: 500;
}

.tgb-day {
    cursor: pointer;
    border-radius: 8px;
    margin: 2px;
    padding: 10px 0;
    border: 1px solid #86efac;
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.tgb-day:hover {
    background: #bbf7d0;
    transform: scale(1.05);
}

.tgb-day-unavailable {
    cursor: default;
    color: #9ca3af;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    opacity: 0.6;
}

.tgb-day-unavailable:hover {
    background: #f3f4f6;
    transform: none;
}

.tgb-day-selected {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tgb-day-empty {
    color: transparent;
}

.tgb-calendar-legend {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    gap: 12px;
    align-items: center;
}

.tgb-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 4px;
}

.tgb-dot-available {
    background: #22c55e;
}

.tgb-dot-unavailable {
    background: #9ca3af;
}

/* Modal slot orari */

.tgb-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.tgb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.tgb-modal-dialog {
    position: relative;
    max-width: 520px;
    margin: 80px auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.5);
}

.tgb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tgb-modal-header h4 {
    margin: 0;
    font-size: 1rem;
}

.tgb-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.tgb-slot {
    border-radius: 999px;
    border: 1px solid #d1fae5;
    background: #ecfdf5;
    color: #166534;
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
}

.tgb-slot-selected {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
}

/* Recap + form */

.tgb-recap {
    background: #eef2ff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.tgb-recap p {
    margin: 0 0 4px;
}

.tgb-form .tgb-field {
    margin-bottom: 10px;
}

.tgb-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tgb-field input,
.tgb-field textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.tgb-error {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.85rem;
}

.tgb-success {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #166534;
    font-size: 0.85rem;
}

/* Responsive */

@media (max-width: 640px) {
    .tgb-booking {
        margin: 0;
        padding: 12px;
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .tgb-grid {
        grid-template-columns: 1fr;
    }

    .tgb-calendar-wrap {
        padding: 10px;
        margin: 8px 0 12px;
        border-radius: 12px;
    }

    .tgb-calendar th,
    .tgb-calendar td {
        padding: 4px 0;
    }

    .tgb-day {
        padding: 8px 0;
        margin: 1px;
        border-radius: 6px;
        font-size: 0.78rem;
    }

    .tgb-modal-dialog {
        margin: 40px 12px;
    }
}
