:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

#network-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fef3c7;
    border-bottom: 1px solid #f59e0b;
    color: #92400e;
    padding: 10px 20px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

#network-banner button {
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

#network-banner button:hover {
    background: #d97706;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.wizard-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
}

/* ── Header ── */
.shop-header {
    text-align: center;
    margin-bottom: 30px;
}

.shop-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.shop-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
}

.shop-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Indicatori step ── */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 40px;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 1;
}

.step-dot {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-dot.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.step-dot.completed {
    border-color: var(--primary);
    background: var(--bg-card);
    color: var(--primary);
}

/* ── Form step ── */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

/* ── Campi del form (scoped a .form-group per non interferire con flatpickr calendar) ── */
.form-group select {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230284c7' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px 18px;
}

.form-group select.select-placeholder { color: var(--text-muted); }

.form-group select:hover { border-color: #93c5fd; }

.form-group select:focus {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-main);
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover,
.form-group input[type="tel"]:hover,
.form-group input[type="date"]:hover { border-color: #93c5fd; }

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="date"]:focus {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* Input data nativo */

/* ── Tema flatpickr calendario popup ── */
.flatpickr-calendar {
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    padding: 8px;
    width: 280px;
}

.flatpickr-months {
    padding: 4px 0 8px;
    align-items: center;
}

.flatpickr-month {
    height: 36px;
    color: var(--text-main);
}

.flatpickr-current-month {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding-top: 4px;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: var(--primary) !important;
    fill: var(--primary) !important;
    padding: 4px 8px;
    top: 8px;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: var(--primary-hover) !important;
}

.flatpickr-weekdays { margin-bottom: 4px; }

.flatpickr-weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.flatpickr-day {
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-main);
    height: 36px;
    line-height: 36px;
    max-width: 36px;
    border: none;
}

.flatpickr-day:hover {
    background: #e0f2fe;
    color: var(--primary);
    border: none;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: none;
}

.flatpickr-day.today {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.flatpickr-day.today:hover { background: #e0f2fe; }

.flatpickr-day.today.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #cbd5e1;
    background: transparent;
    cursor: not-allowed;
}

.numInputWrapper:hover { background: transparent; }
.numInputWrapper span { display: none; }

/* ── Griglia orari ── */
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 10px;
}

.time-slot { position: relative; }

.time-slot input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.time-slot label {
    display: block;
    text-align: center;
    padding: 10px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0;
}

.time-slot label:hover {
    border-color: var(--primary);
    background: rgba(2, 132, 199, 0.02);
}

.time-slot input[type="radio"]:checked + label {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.time-slot input[type="radio"]:disabled + label {
    background: #f1f5f9;
    color: #cbd5e1;
    border-color: #e2e8f0;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}

.time-slot input[type="radio"]:disabled + label:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #cbd5e1;
}

/* ── Bottoni navigazione ── */
.buttons-container {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-prev {
    background: transparent;
    color: var(--text-muted);
}

.btn-prev:hover {
    color: var(--text-main);
    background: var(--bg-body);
}

.btn-next,
.btn-submit,
.btn-restart {
    background: var(--primary);
    color: white;
    margin-left: auto;
}

.btn-next:hover,
.btn-submit:hover,
.btn-restart:hover {
    background: var(--primary-hover);
}

/* ── Utilità ── */
.hidden { display: none !important; }

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.2s ease;
}

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

/* ── Schermata di successo ── */
.booking-success {
    text-align: center;
    padding: 30px 10px;
    animation: fadeIn 0.5s ease forwards;
}

.success-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
}

.success-svg {
    width: 80px;
    height: 80px;
    stroke: #22c55e;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.success-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: drawCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.success-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.success-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* ── Selezione sede ── */
.office-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.office-card { position: relative; cursor: pointer; }

.office-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.office-card label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: var(--bg-body);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.office-card label:hover {
    border-color: var(--primary);
    background: rgba(2, 132, 199, 0.02);
}

.office-card input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: rgba(2, 132, 199, 0.05);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.office-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #e0f2fe;
    border-radius: 50%;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.office-card input[type="radio"]:checked + label .office-icon {
    background: var(--primary);
    color: white;
}

.office-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.office-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.office-address {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}
