.ttb-module-wrapper {
    color: #15304b;
    margin-block: 1.5rem;
}

.ttb-module-form {
    display: grid;
    gap: 1.15rem;
}

.ttb-module__block {
    min-width: 0;
}

.ttb-module__label {
    display: block;
    font-weight: 650;
    margin-bottom: .4rem;
}

.ttb-module__hint,
.ttb-module__description {
    color: #526579;
    margin-block: .35rem .65rem;
}

.ttb-module__block input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.ttb-module__block select,
.ttb-module__block textarea {
    box-sizing: border-box;
    border: 1px solid #c9d6e2;
    border-radius: .4rem;
    font: inherit;
    max-width: 100%;
    padding: .7rem .8rem;
    width: 100%;
}

.ttb-module__choices {
    display: grid;
    gap: .55rem;
}

.ttb-module__choice {
    align-items: flex-start;
    display: flex;
    gap: .55rem;
}

.ttb-module__error,
.ttb-module-alert {
    background: #fff0ef;
    border-radius: .35rem;
    color: #8d211b;
    margin: .45rem 0 0;
    padding: .65rem .8rem;
}

.ttb-module-alert.is-success {
    background: #e9f7ee;
    color: #14532d;
}

.ttb-module-form--submitted > :not(.ttb-module-alert) {
    display: none !important;
}

.ttb-module__pending {
    background: #fff7e6;
    border-left: 3px solid #e8a32b;
    padding: .6rem .8rem;
}

.ttb-module__content {
    line-height: 1.55;
}

.ttb-module__stepper {
    margin-bottom: .5rem;
}

.ttb-module__stepper p {
    font-weight: 650;
    margin: 0 0 .55rem;
}

.ttb-module__step-bars {
    display: grid;
    gap: .4rem;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
}

.ttb-module__step-bars span {
    background: #e5eaf0;
    border-radius: 999px;
    height: .4rem;
}

.ttb-module__step-bars span.is-active,
.ttb-module__step-bars span.is-completed {
    background: #2176ae;
}

.ttb-module__navigation {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.ttb-module__navigation [hidden] {
    display: none !important;
}

.ttb-module__action-row {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.ttb-module__action-row > .ttb-block-input {
    flex: 1 1 16rem;
}

.ttb-module__api-message {
    color: #14532d;
    font-weight: 600;
    margin: .45rem 0 0;
}

.ttb-module__api-message.is-error {
    color: #8d211b;
}

.ttb-file-upload__note {
    font-size: .9rem;
    margin: .4rem 0 0;
}

.ttb-file-upload__list {
    display: grid;
    gap: .45rem;
    list-style: none;
    margin: .55rem 0 0;
    padding: 0;
}

.ttb-file-upload__item {
    align-items: center;
    background: #f3f7fa;
    border-radius: .35rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    justify-content: space-between;
    padding: .55rem .7rem;
}

.ttb-file-upload__remove {
    background: transparent;
    border: 0;
    color: #155e87;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    text-decoration: underline;
}

.ttb-file-upload__message {
    color: #8d211b;
    font-size: .9rem;
}

.ttb-button--secondary {
    background: #eef3f8;
    color: #15304b;
}

.ttb-calendar {
    display: grid;
    gap: .75rem;
    min-width: 0;
}

.ttb-calendar__toolbar {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.ttb-calendar__toolbar .ttb-button {
    flex: 0 0 auto;
}

.ttb-calendar__week {
    color: #526579;
    font-size: .9rem;
    font-weight: 650;
    margin: 0;
    text-align: center;
}

.ttb-calendar__load {
    justify-self: start;
}

.ttb-calendar__status {
    align-items: baseline;
    background: #f3f7fa;
    border-radius: .35rem;
    color: #526579;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .65rem;
    margin: 0;
    padding: .6rem .75rem;
}

.ttb-calendar__status.is-error {
    background: #fff0ef;
    color: #8d211b;
}

.ttb-calendar__status.is-success {
    background: #e9f7ee;
    color: #14532d;
}

.ttb-calendar__grid-wrap {
    min-width: 0;
    overflow-x: auto;
}

.ttb-calendar__grid {
    display: grid;
    gap: 4px;
    min-width: 34rem;
    margin: .5rem 0;
}

.ttb-calendar__heading,
.ttb-calendar__time {
    align-items: center;
    color: #526579;
    display: flex;
    font-size: .78rem;
    font-weight: 650;
    justify-content: center;
    min-height: 2rem;
    padding: .2rem;
    text-align: center;
}

.ttb-calendar__heading {
    border-bottom: 2px solid #dee2e6;
    color: #15304b;
}

.ttb-calendar__slot {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font: inherit;
    font-size: 90%;
    min-height: 1.9rem;
    padding: 4px 3px;
    text-align: center;
    transition: background-color .15s, border-color .15s, color .15s;
}

.ttb-calendar__grid .ttb-calendar__slot.is-available {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    cursor: pointer;
}

.ttb-calendar__grid .ttb-calendar__slot.is-available:hover,
.ttb-calendar__grid .ttb-calendar__slot.is-available:focus-visible {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.ttb-calendar__grid .ttb-calendar__slot.is-available.is-selected {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
    font-weight: 700;
}

.ttb-calendar__grid .ttb-calendar__slot:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.ttb-calendar__grid .ttb-calendar__slot.is-unavailable {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.ttb-calendar__grid .ttb-calendar__slot.is-past {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #adb5bd;
    text-decoration: line-through;
}

@media (max-width: 480px) {
    .ttb-calendar__toolbar {
        gap: .35rem;
    }

    .ttb-calendar__toolbar .ttb-button {
        padding-inline: .55rem;
    }
}

.ricorsi-ttb-form:empty::before {
    content: attr(data-ttb-form);
    display: block;
    min-height: 1rem;
}

/* Ricorsi design system, scoped to the TTB module markup. */
.ttb-module-wrapper {
    --dcs-c-ink: #16293f;
    --dcs-c-ink-dk: #1d3654;
    --dcs-c-accent: #c0563a;
    --dcs-c-accent-dk: #a94731;
    --dcs-c-surface: #fff;
    --dcs-c-line: rgba(22, 41, 63, .1);
    --dcs-font-sans: var(--e-global-typography-text-font-family, system-ui), sans-serif;
    --dcs-font-serif: var(--e-global-typography-primary-font-family, Georgia), serif;
    --dcs-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    --dcs-radius: 16px;
    --dcs-radius-sm: 10px;

    background: var(--dcs-c-surface);
    border: 1px solid var(--dcs-c-line);
    border-radius: var(--dcs-radius);
    box-shadow: 0 24px 60px -48px rgba(22, 41, 63, .52);
    box-sizing: border-box;
    color: var(--dcs-c-ink);
    font-family: var(--dcs-font-sans);
    margin: 1.5rem auto;
    max-width: 640px;
    overflow: hidden;
    padding: clamp(1rem, 4vw, 1.5rem);
}

.ttb-module-wrapper,
.ttb-module-wrapper * {
    box-sizing: border-box;
}

.ttb-module-wrapper .ttb-module__description {
    color: var(--dcs-c-ink);
    font-family: var(--dcs-font-sans);
    line-height: 1.5;
    margin: 0 0 1rem;
}

.ttb-module-wrapper .ttb-module__description > :first-child {
    margin-top: 0;
}

.ttb-module-wrapper .ttb-module__description > :last-child {
    margin-bottom: 0;
}

.ttb-module-wrapper .ttb-module-form {
    display: grid;
    gap: .75rem;
}

.ttb-module-wrapper .ttb-module__block:has(.ttb-module__choice) {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.ttb-module-wrapper .ttb-module__block:has(.ttb-module__choice) > .ttb-module__label,
.ttb-module-wrapper .ttb-module__block:has(.ttb-module__choice) > .ttb-module__hint,
.ttb-module-wrapper .ttb-module__block:has(.ttb-module__choice) > .ttb-module__error {
    grid-column: 1 / -1;
}

.ttb-module-wrapper .ttb-module__block {
    margin: 0;
    min-width: 0;
    padding: 0;
}

.ttb-module-wrapper .ttb-module__label {
    color: var(--dcs-c-ink);
    display: block;
    font-family: var(--dcs-font-mono);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    margin: 0 0 .35rem;
    text-transform: uppercase;
}

.ttb-module-wrapper .ttb-module__label span[aria-hidden="true"] {
    color: var(--dcs-c-accent);
}

.ttb-module-wrapper .ttb-module__hint {
    color: #8f98a5;
    font-family: var(--dcs-font-sans);
    font-size: .78rem;
    line-height: 1.4;
    margin: 0 0 .5rem;
}

.ttb-module-wrapper .ttb-module__block input.ttb-block-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.ttb-module-wrapper .ttb-module__block select,
.ttb-module-wrapper .ttb-module__block textarea {
    background: #fff;
    border: 1.5px solid #e0e4e9;
    border-radius: 9px;
    box-shadow: none;
    color: var(--dcs-c-ink);
    font-family: var(--dcs-font-serif);
    font-size: .95rem;
    line-height: 1.4;
    max-width: 100%;
    outline: none;
    padding: .65rem .75rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
}

.ttb-module-wrapper .ttb-module__block textarea {
    min-height: 4.75rem;
    resize: vertical;
}

.ttb-module-wrapper .ttb-module__block input::placeholder,
.ttb-module-wrapper .ttb-module__block textarea::placeholder {
    color: #9aa6b4;
}

.ttb-module-wrapper .ttb-module__block input:focus,
.ttb-module-wrapper .ttb-module__block select:focus,
.ttb-module-wrapper .ttb-module__block textarea:focus {
    border-color: var(--dcs-c-accent);
    box-shadow: 0 0 0 3px rgba(192, 86, 58, .13);
}

.ttb-module-wrapper .ttb-module__choices {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.ttb-module-wrapper .ttb-module__choice {
    align-items: center;
    background: #fff;
    border: 1.5px solid #e4e7ec;
    border-radius: var(--dcs-radius-sm);
    color: var(--dcs-c-ink);
    cursor: pointer;
    display: flex;
    font-family: var(--dcs-font-serif);
    font-size: .9rem;
    font-weight: 600;
    gap: .65rem;
    line-height: 1.25;
    margin: 0;
    min-height: 2.8rem;
    padding: .6rem .7rem;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ttb-module-wrapper .ttb-module__choice:hover {
    background: #fffaf6;
    border-color: #d8c3b6;
}

.ttb-module-wrapper .ttb-module__choice:has(input:checked) {
    background: #fbece4;
    border-color: #e0a98f;
}

.ttb-module-wrapper .ttb-module__choice:focus-within {
    box-shadow: 0 0 0 3px rgba(192, 86, 58, .13);
}

.ttb-module-wrapper .ttb-module__choice input[type="radio"],
.ttb-module-wrapper .ttb-module__choice input[type="checkbox"] {
    appearance: none;
    background: #fff;
    border: 1.5px solid #cdd2d9;
    cursor: pointer;
    flex: 0 0 1.05rem;
    height: 1.05rem;
    margin: 0;
    position: relative;
    width: 1.05rem;
}

.ttb-module-wrapper .ttb-module__choice input[type="radio"] {
    border-radius: 50%;
}

.ttb-module-wrapper .ttb-module__choice input[type="checkbox"] {
    border-radius: 4px;
}

.ttb-module-wrapper .ttb-module__choice input:checked {
    background: var(--dcs-c-accent);
    border-color: var(--dcs-c-accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.ttb-module-wrapper .ttb-module__choice input:focus-visible {
    outline: 2px solid var(--dcs-c-accent);
    outline-offset: 3px;
}

.ttb-module-wrapper .ttb-module__error,
.ttb-module-wrapper .ttb-module-alert {
    background: #fff0ed;
    border: 1px solid rgba(192, 86, 58, .2);
    border-radius: var(--dcs-radius-sm);
    color: var(--dcs-c-accent-dk);
    font-family: var(--dcs-font-sans);
    font-size: .85rem;
    line-height: 1.45;
    margin: .45rem 0 0;
    padding: .65rem .75rem;
}

.ttb-module-wrapper .ttb-module-alert {
    margin: 0;
}

.ttb-module-wrapper .ttb-module-alert.is-success {
    background: #edf7f0;
    border-color: #cce6d3;
    color: #245c35;
}

.ttb-module-wrapper .ttb-module__pending {
    background: #f5f8fb;
    border-left: 3px solid var(--dcs-c-ink);
    color: var(--dcs-c-ink);
    margin: 0;
    padding: .65rem .75rem;
}

.ttb-module-wrapper .ttb-module__stepper {
    margin: 0 0 .25rem;
}

.ttb-module-wrapper .ttb-module__stepper p {
    color: var(--dcs-c-ink);
    font-family: var(--dcs-font-mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    margin: 0 0 .55rem;
    text-transform: uppercase;
}

.ttb-module-wrapper .ttb-module__step-bars {
    display: grid;
    gap: .35rem;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
}

.ttb-module-wrapper .ttb-module__step-bars span {
    background: #edeef1;
    border-radius: 999px;
    height: .32rem;
}

.ttb-module-wrapper .ttb-module__step-bars span.is-active {
    background: linear-gradient(90deg, var(--dcs-c-accent), #e6a05f);
}

.ttb-module-wrapper .ttb-module__step-bars span.is-completed {
    background: var(--dcs-c-ink);
}

.ttb-module-wrapper .ttb-module__navigation {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .25rem;
}

.ttb-module-wrapper .ttb-module__navigation [hidden] {
    display: none !important;
}

.ttb-module-wrapper .ttb-button {
    appearance: none;
    background: var(--dcs-c-ink);
    border: 1px solid var(--dcs-c-ink);
    border-radius: 10px;
    box-shadow: 0 14px 24px -15px rgba(22, 41, 63, .7);
    color: #fff;
    cursor: pointer;
    font-family: var(--dcs-font-sans);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.3;
    min-height: 3rem;
    padding: .75rem 1rem;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.ttb-module-wrapper .ttb-module__navigation [data-step-submit] {
    flex: 1 1 100%;
}

.ttb-module-wrapper .ttb-button:hover {
    background: var(--dcs-c-ink-dk);
    border-color: var(--dcs-c-ink-dk);
}

.ttb-module-wrapper .ttb-button:focus-visible {
    outline: 3px solid rgba(192, 86, 58, .35);
    outline-offset: 2px;
}

.ttb-module-wrapper .ttb-button:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.ttb-module-wrapper .ttb-button--secondary {
    background: #fff;
    border-color: #e4e7ec;
    box-shadow: none;
    color: var(--dcs-c-ink);
}

.ttb-module-wrapper .ttb-button--secondary:hover {
    background: #f8fafc;
    border-color: #cbd4df;
    color: var(--dcs-c-ink);
}

.ttb-module-wrapper .ttb-module__action-row {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.ttb-module-wrapper .ttb-module__action-row > .ttb-block-input {
    flex: 1 1 14rem;
    min-width: 0;
}

.ttb-module-wrapper .ttb-module__action-button {
    background: var(--dcs-c-accent);
    border-color: var(--dcs-c-accent);
    box-shadow: 0 14px 24px -16px rgba(192, 86, 58, .75);
}

.ttb-module-wrapper .ttb-module__action-button:hover {
    background: var(--dcs-c-accent-dk);
    border-color: var(--dcs-c-accent-dk);
}

.ttb-module-wrapper .ttb-module__block[data-block-type="email"] {
    background: #fff8f5;
    border: 1.5px solid rgba(192, 86, 58, .24);
    border-radius: 12px;
    padding: .75rem;
}

.ttb-module-wrapper .ttb-module__block[data-block-type="otp"] {
    background: #f5f8fb;
    border: 1.5px solid rgba(22, 41, 63, .16);
    border-radius: 12px;
    padding: .75rem;
}

.ttb-module-wrapper .ttb-module__content {
    color: var(--dcs-c-ink);
    font-family: var(--dcs-font-sans);
    line-height: 1.5;
}

.ttb-module-wrapper .ttb-module__block-badge {
    align-items: center;
    background: var(--dcs-c-accent);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-family: var(--dcs-font-mono);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
    margin: 0 0 .65rem;
    padding: .45rem .7rem;
    text-transform: uppercase;
}

.ttb-module-wrapper .ttb-recaptcha-note {
    color: #738295;
    font-family: var(--dcs-font-sans);
    font-size: .8rem;
    line-height: 1.55;
    margin: .25rem 0 .75rem;
}

.ttb-module-wrapper .ttb-recaptcha-note a {
    color: var(--dcs-c-ink);
    text-decoration: underline;
}

.ttb-module-wrapper .ttb-file-upload__item {
    background: #fbfcfe;
    border: 1px solid #e1e6ec;
    border-radius: 8px;
}

.ttb-module-wrapper .ttb-file-upload__remove {
    color: var(--dcs-c-accent);
}

.dcs-form .ttb-module-wrapper {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    max-width: none;
    overflow: visible;
    padding: 0;
}

.dcs-form .ttb-module-form {
    gap: 0;
}

/* Elementor può impostare il colore testo globale su bianco: nei moduli su card
   bianche il colore deve restare leggibile, anche con la skin DCS personalizzata. */
.dcs-form .ttb-module-wrapper.ttb-module-wrapper {
    --form-ink: #16293f;
    color: #16293f;
}

.dcs-form .ttb-module-wrapper .ttb-module__choice,
.dcs-form .ttb-module-wrapper .ttb-module__choice .form-check-label {
    color: #16293f;
}

.dcs-form .ttb-module-wrapper .ttb-module__choice input[type="radio"] {
    appearance: none !important;
    background: #fff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 50% !important;
}

@media (max-width: 480px) {
    .ttb-module-wrapper {
        border-radius: 12px;
        padding: 1rem;
    }

    .ttb-module-wrapper .ttb-module__navigation {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .ttb-module-wrapper .ttb-module__navigation .ttb-button {
        width: 100%;
    }

    .ttb-module-wrapper .ttb-module__action-row {
        flex-direction: column;
    }
}
