/* Base UI per Client (sarà “colorata” via palette CSS iniettata dal server) */

.tq-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px;
}

.tq-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 14px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.tq-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Logo standard: 52x52 */
.tq-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0,0,0,.04);
    flex: 0 0 auto;
}

/* Logo grande: solo per header pagine selezionate */
.tq-logo-large {
    width: 104px;
    height: 104px;
}

.tq-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary, #1f4e79);
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tq-sub {
    font-size: 14px;
    opacity: .85;
}

.tq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    background: var(--button-background, var(--primary, #1f4e79));
    color: var(--button-text, #fff);
    font-weight: 700;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 48px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

    .tq-btn.secondary {
        background: rgba(0,0,0,.06);
        color: var(--text-color, #111);
    }

    .tq-btn:active {
        transform: translateY(1px);
    }

.tq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    max-width: 760px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .tq-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 700px;
    }
}

.tq-lang {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

    .tq-lang button {
        min-width: 84px;
        flex: 1 1 84px;
    }

.tq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tq-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tq-thumb {
    width: 110px;
    height: 110px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    background: rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.12);
    flex: 0 0 auto;
    display: block;
}

.tq-item h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary, #1f4e79);
}

.tq-item p {
    margin: 6px 0 0 0;
}

.tq-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tq-error {
    display: none;
    background: #fff1f1;
    border: 1px solid #ffb3b3;
    color: #8a0000;
    padding: 12px;
    border-radius: 12px;
    margin: 12px 0;
    font-weight: 700;
}

.tq-footer {
    margin-top: 22px;
    font-size: 12px;
    opacity: .75;
    text-align: center;
}

.tq-top-centered-mobile {
    justify-content: center;
}

.tq-btn-continue {
    width: 100%;
    min-height: 100px;
    font-size: 20px;
    border-radius: 16px;
}

.tq-hero {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 12px;
}

.tq-card-index {
    text-align: center;
}

.tq-lang-flag {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}

/* BANDIERE */
.tq-flag-it {
    background-image: url('https://flagcdn.com/w80/it.png');
}

.tq-flag-en {
    background-image: url('https://flagcdn.com/w80/gb.png');
}

.tq-flag-fr {
    background-image: url('https://flagcdn.com/w80/fr.png');
}

.tq-flag-es {
    background-image: url('https://flagcdn.com/w80/es.png');
}

.tq-flag-de {
    background-image: url('https://flagcdn.com/w80/de.png');
}

.tq-lang-text {
    font-weight: 700;
}

/* HEADER VERTICALE STANDARD */
.tq-header-vertical {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    text-align: center;
    width: 100%;
}

    .tq-header-vertical .tq-logo {
        margin-bottom: 10px;
    }

    .tq-header-vertical .tq-title {
        margin-bottom: 4px;
        text-align: center;
    }

.tq-page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary, #1f4e79);
    line-height: 1.3;
    text-align: center;
    margin-bottom: 6px;
    opacity: .9;
}

.tq-back {
    text-align: center;
    margin-top: 6px;
}

@media (max-width: 640px) {
    .tq-wrap {
        padding: 10px;
    }

    .tq-card {
        padding: 12px;
        border-radius: 12px;
        margin: 10px 0;
    }

    .tq-top {
        gap: 10px;
        align-items: flex-start;
    }

    .tq-top-centered-mobile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

        .tq-top-centered-mobile > div {
            width: 100%;
        }

        .tq-top-centered-mobile .tq-title,
        .tq-top-centered-mobile .tq-sub {
            text-align: center;
        }

    /* Il logo standard resta 52x52 anche su mobile */
    .tq-logo {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    /* Solo il logo grande aumenta su mobile */
    .tq-logo-large {
        width: 120px;
        height: 120px;
        border-radius: 14px;
    }

    .tq-title {
        font-size: 22px;
    }

    .tq-sub {
        font-size: 13px;
        line-height: 1.35;
    }

    .tq-btn {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        padding: 12px;
        font-size: 15px;
    }

    .tq-lang button {
        min-width: 0;
        min-height: 110px;
        width: 100%;
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        border-radius: 14px;
    }

    .tq-btn-continue {
        min-height: 96px;
        font-size: 20px;
    }

    .tq-item {
        flex-direction: column;
        gap: 10px;
    }

    .tq-thumb {
        width: 140px;
        height: 140px;
        max-width: none;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center;
        margin: 0 auto;
    }
    .tq-actions {
        flex-direction: column;
    }

        .tq-actions .tq-btn {
            width: 100%;
        }

    .tq-item > div:last-child {
        width: 100%;
    }
}

.tq-radio-group label span {
    font-weight: 700;
    font-size: 15px;
}

.tq-btn-clicked {
    transform: scale(0.96);
    filter: brightness(1.2);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08) inset;
    transition: all 0.1s ease;
}