:root {
    --brand: #363e53;
    --brand-dark: #252b3b;
    --brand-light: #eef0f5;

    --background: #f4f5f8;
    --surface: #ffffff;

    --text: #202431;
    --muted: #707789;
    --border: #d9dde7;

    --special: #7b8ab0;

    --green: #1f7a4d;
    --green-light: #edf7f1;

    --warning: #8a661d;
    --warning-light: #fdf5e6;

    --error: #b6403b;
    --error-light: #fff2f1;

    --radius-large: 24px;
    --radius-medium: 14px;
    --radius-small: 10px;

    --shadow: 0 20px 60px rgba(40, 47, 68, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(circle at top left, #ffffff 0, transparent 35%),
        var(--background);

    color: var(--text);

    font-family: "Raleway", sans-serif;
    font-size: 15px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

.booking-app {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.booking-card {
    width: 100%;
    max-width: 760px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.booking-header {
    padding: 32px 36px 28px;

    background: var(--brand);

    color: white;
    text-align: center;
}

.eyebrow {
    margin-bottom: 8px;

    color: #c9cedc;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.booking-header h1 {
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 600;
    line-height: 1.15;
}

.intro {
    max-width: 540px;

    margin: 12px auto 0;

    color: #d5d9e4;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

.progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: 24px 32px 18px;

    background: #fafbfc;

    border-bottom: 1px solid var(--border);
}

.progress-step {
    min-width: 48px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 6px;

    color: #a0a6b4;
}

.progress-step span {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: white;

    font-size: 12px;
    font-weight: 600;
}

.progress-step small {
    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-step.active,
.progress-step.completed {
    color: var(--brand);
}

.progress-step.active span {
    background: var(--brand);
    border-color: var(--brand);

    color: white;
}

.progress-step.completed span {
    background: var(--brand-light);
    border-color: var(--brand);

    color: var(--brand);
}

.progress-line {
    width: 70px;
    height: 1px;

    margin-top: 15px;

    background: var(--border);
}

.progress-line.completed {
    background: var(--brand);
}

.booking-step {
    display: none;
}

.booking-step.active {
    display: block;

    animation: stepFade 0.25s ease;
}

@keyframes stepFade {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-panel {
    padding: 30px 36px 34px;
}

.step-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.step-label {
    margin-bottom: 5px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.step-heading h2,
.confirmation-content h2 {
    color: var(--brand);

    font-size: 28px;
    font-weight: 600;
}

.step-description {
    max-width: 270px;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;

    text-align: right;
}

.calendar {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: white;
}

.calendar-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;

    margin-bottom: 18px;
}

.calendar-header h3 {
    color: var(--brand);

    font-size: 20px;
    font-weight: 600;

    text-align: center;
}

.calendar-arrow {
    width: 36px;
    height: 36px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: white;
    color: var(--brand);

    cursor: pointer;

    font-size: 24px;
    line-height: 1;

    transition: 0.2s ease;
}

.calendar-arrow:hover:not(:disabled) {
    background: var(--brand-light);
    border-color: var(--brand);

    transform: translateY(-1px);
}

.calendar-arrow:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);

    gap: 7px;
}

.calendar-weekdays {
    margin-bottom: 7px;
}

.calendar-weekdays span {
    padding: 4px 0;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1.2;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    background: transparent;
    color: var(--text);

    cursor: pointer;

    font-size: 13px;
    font-weight: 500;

    transition: 0.18s ease;
}

.calendar-day.available {
    background: white;
    border-color: var(--border);
}

.calendar-day.available:hover {
    border-color: var(--brand);
    background: var(--brand-light);

    transform: translateY(-1px);
}

.calendar-day.special {
    border: 1px dashed var(--special);

    background: #f8f9fc;
    color: var(--brand);
}

.calendar-day.special:hover {
    background: var(--brand-light);

    transform: translateY(-1px);
}

.calendar-day.selected {
    background: var(--brand);
    border-color: var(--brand);

    color: white;
    font-weight: 700;
}

.calendar-day.disabled {
    color: #cbd0db;

    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;

    gap: 16px;

    margin-top: 14px;

    color: var(--muted);

    font-size: 11px;
}

.calendar-legend span {
    display: flex;
    align-items: center;

    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;

    display: inline-block;

    border-radius: 3px;
}

.legend-dot.standard {
    border: 1px solid var(--border);

    background: white;
}

.legend-dot.special {
    border: 1px dashed var(--special);

    background: #f8f9fc;
}

.selected-date-box,
.selected-time-box,
.booking-summary {
    margin-top: 18px;
    padding: 13px 16px;

    border-left: 3px solid var(--brand);
    border-radius: 8px;

    background: var(--brand-light);
    color: var(--muted);

    font-size: 13px;
}

.selected-date-box.has-selection,
.selected-time-box.has-selection {
    color: var(--brand);
    font-weight: 600;
}

.booking-summary {
    margin-top: 0;
    margin-bottom: 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.summary-label {
    display: block;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.booking-summary strong {
    color: var(--brand);

    font-size: 13px;
    text-align: right;
}

.details-summary > div {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.time-section {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: white;
}

.time-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}

.time-section-heading h3 {
    color: var(--brand);

    font-size: 15px;
    font-weight: 600;
}

.time-section-heading p {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}

.time-status {
    flex-shrink: 0;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 600;
}

.standard-status {
    background: var(--green-light);
    color: var(--green);
}

.pending-status {
    background: var(--warning-light);
    color: var(--warning);
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 9px;
}

.time-button {
    padding: 10px 8px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: white;
    color: var(--text);

    cursor: pointer;

    font-size: 13px;
    font-weight: 500;

    transition: 0.18s ease;
}

.time-button:hover:not(:disabled) {
    background: var(--brand-light);
    border-color: var(--brand);

    color: var(--brand);

    transform: translateY(-1px);
}

.time-button.selected {
    background: var(--brand);
    border-color: var(--brand);

    color: white;
    font-weight: 700;
}

.time-button:disabled {
    background: #f5f6f8;
    color: #b3b8c4;

    cursor: not-allowed;
    text-decoration: line-through;
}

.extra-time-section {
    margin-top: 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    overflow: hidden;
}

.extra-time-toggle {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 16px 18px;

    border: 0;

    background: #fafbfc;
    color: var(--brand);

    cursor: pointer;
    text-align: left;
}

.extra-time-toggle span:first-child {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.extra-time-toggle strong {
    font-size: 13px;
    font-weight: 600;
}

.extra-time-toggle small {
    color: var(--muted);

    font-size: 11px;
    font-weight: 400;
}

.toggle-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: white;

    font-size: 18px;

    transition: transform 0.2s ease;
}

.extra-time-toggle.open .toggle-icon {
    transform: rotate(45deg);
}

.extra-time-content {
    display: none;

    padding: 18px;

    border-top: 1px solid var(--border);

    background: white;
}

.extra-time-content.open {
    display: block;
}

.extra-heading {
    margin-bottom: 14px;
}

.selected-time-box {
    margin-top: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 16px;

    margin-bottom: 16px;
}

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

    gap: 7px;

    margin-bottom: 16px;
}

.field label {
    color: var(--brand);

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field label span {
    color: var(--error);
}

.field input,
.field textarea,
.field select {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fafbfc;
    color: var(--text);

    padding: 12px 13px;

    font-size: 14px;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.field textarea {
    min-height: 95px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;

    background: white;
    border-color: var(--brand);

    box-shadow: 0 0 0 3px rgba(54, 62, 83, 0.09);
}

.field input.invalid,
.field textarea.invalid {
    border-color: var(--error);
    background: var(--error-light);
}

.field-error {
    min-height: 14px;

    color: var(--error);

    font-size: 10px;
    line-height: 1.4;
}

.privacy-box {
    margin-top: 4px;
    padding: 14px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fafbfc;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;

    gap: 11px;

    cursor: pointer;
}

.checkbox-field input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.custom-checkbox {
    width: 18px;
    height: 18px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: white;
}

.checkbox-field input:checked + .custom-checkbox {
    background: var(--brand);
    border-color: var(--brand);
}

.checkbox-field input:checked + .custom-checkbox::after {
    content: "✓";

    color: white;

    font-size: 12px;
    font-weight: 700;
}

.checkbox-text {
    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}

.checkbox-text strong {
    color: var(--error);
}

.form-message {
    margin-bottom: 18px;
    padding: 12px 14px;

    border: 1px solid #efc5c2;
    border-radius: 9px;

    background: var(--error-light);
    color: var(--error);

    font-size: 12px;
}

.actions {
    margin-top: 22px;
}

.actions-end {
    display: flex;
    justify-content: flex-end;
}

.actions-between {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;
}

.primary-button,
.secondary-button {
    min-width: 160px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 13px 22px;

    border-radius: 10px;

    cursor: pointer;

    font-size: 14px;
    font-weight: 600;

    transition: 0.2s ease;
}

.primary-button {
    border: 0;

    background: var(--brand);
    color: white;
}

.primary-button:hover:not(:disabled) {
    background: var(--brand-dark);

    transform: translateY(-1px);

    box-shadow: 0 8px 20px rgba(37, 43, 59, 0.18);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.secondary-button {
    border: 1px solid var(--border);

    background: white;
    color: var(--brand);
}

.secondary-button:hover {
    border-color: var(--brand);
    background: var(--brand-light);

    transform: translateY(-1px);
}

.confirmation-content {
    max-width: 560px;

    margin: 0 auto;

    text-align: center;
}

.confirmation-icon {
    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: var(--green-light);
    color: var(--green);

    font-size: 28px;
    font-weight: 700;
}

.confirmation-icon.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.confirmation-text {
    max-width: 490px;

    margin: 12px auto 22px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.65;
}

.confirmation-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.confirmation-summary > div {
    padding: 14px 10px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fafbfc;
}

.confirmation-summary span {
    display: block;

    margin-bottom: 6px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 600;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.confirmation-summary strong {
    color: var(--brand);

    font-size: 12px;
}

.confirmation-note {
    margin-top: 18px;
    padding: 12px 14px;

    border-radius: 9px;

    background: var(--brand-light);
    color: var(--brand);

    font-size: 11px;
    line-height: 1.5;
}

.restart-button {
    margin-top: 22px;
}

@media (max-width: 640px) {
    .booking-app {
        align-items: flex-start;

        padding: 0;
    }

    .booking-card {
        min-height: 100vh;

        border: 0;
        border-radius: 0;
    }

    .booking-header {
        padding: 26px 22px 23px;
    }

    .progress {
        padding: 20px 16px 14px;
    }

    .progress-line {
        width: 30px;
    }

    .step-panel {
        padding: 24px 18px 28px;
    }

    .step-heading {
        display: block;
    }

    .step-description {
        max-width: none;

        margin-top: 7px;

        text-align: left;
    }

    .calendar {
        padding: 12px;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        aspect-ratio: 1;
    }

    .booking-summary {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

    .booking-summary strong {
        text-align: left;
    }

    .details-summary > div {
        width: 100%;
    }

    .time-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-section-heading {
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;

        gap: 0;

        margin-bottom: 0;
    }

    .actions-between {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .confirmation-summary {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   INFORMATIVA PRIVACY
========================================================= */

.checkbox-text a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.checkbox-text a:hover {
    color: var(--brand-dark);
}

.privacy-information {
    margin-top: 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #ffffff;

    overflow: hidden;
}

.privacy-information summary {
    padding: 13px 15px;

    color: var(--brand);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    background: #fafbfc;

    list-style-position: inside;
}

.privacy-information summary:hover {
    background: var(--brand-light);
}

.privacy-content {
    padding: 18px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 12px;
    line-height: 1.65;
}

.privacy-content h3 {
    margin-bottom: 14px;

    color: var(--brand);

    font-size: 15px;
    font-weight: 600;
}

.privacy-content h4 {
    margin-top: 17px;
    margin-bottom: 5px;

    color: var(--brand);

    font-size: 12px;
    font-weight: 600;
}

.privacy-content p {
    margin: 0;
}

.privacy-content a {
    color: var(--brand);

    font-weight: 600;

    text-decoration: underline;
    text-underline-offset: 2px;
}

.privacy-disclaimer {
    margin-top: 18px !important;

    padding-top: 14px;

    border-top: 1px solid var(--border);

    font-size: 10px;
}

/* =========================================================
   CARICAMENTO DISPONIBILITA
========================================================= */

.availability-loader {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: -12px 2px 12px;
    color: var(--muted);
    font-size: 11px;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.availability-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.availability-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: availabilitySpin 0.7s linear infinite;
}

@keyframes availabilitySpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .availability-loader {
        justify-content: flex-start;
        margin-top: -10px;
    }
}
