/* ======================================================================
   R2.1T.2A | Sete Formas de Participação
   Inteligência coletiva territorial sem reações genéricas
   ====================================================================== */

.tv2-participation {
    position: relative;
    margin-top: 22px;
    padding: clamp(24px, 4vw, 44px);
    overflow: hidden;
    border-radius: var(--tv2-radius-lg);
}

.tv2-participation::before {
    position: absolute;
    top: -260px;
    right: -180px;
    width: 560px;
    aspect-ratio: 1;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    background: conic-gradient(
        rgba(var(--tv2-violet-rgb), .17),
        rgba(var(--tv2-cyan-rgb), .12),
        rgba(var(--tv2-green-rgb), .12),
        rgba(var(--tv2-amber-rgb), .13),
        rgba(var(--tv2-violet-rgb), .17)
    );
    filter: blur(8px);
    mask-image: radial-gradient(circle, #000 0 45%, transparent 72%);
    animation: tv2-participation-orbit 34s linear infinite;
}

.tv2-participation__head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
}

.tv2-participation__head h2,
.tv2-participation-stream__head h3 {
    margin: 0;
    color: var(--tv2-ink);
    font-weight: 950;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.tv2-participation__head h2 {
    max-width: 900px;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
}

.tv2-participation__head p {
    max-width: 880px;
    margin: 15px 0 0;
    color: var(--tv2-text);
    line-height: 1.7;
}

.tv2-participation__score {
    position: relative;
    display: grid;
    place-items: center;
    width: 170px;
    aspect-ratio: 1;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    text-align: center;
    background:
        radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .98), transparent 34%),
        linear-gradient(145deg, rgba(var(--tv2-violet-rgb), .16), rgba(var(--tv2-cyan-rgb), .11));
    box-shadow: 0 24px 54px rgba(39, 52, 105, .15), 0 0 0 11px rgba(255, 255, 255, .18);
}

.tv2-participation__score::before {
    position: absolute;
    inset: -9px;
    border: 1px dashed rgba(var(--tv2-violet-rgb), .24);
    border-radius: inherit;
    content: "";
    animation: tv2-participation-orbit 24s linear infinite reverse;
}

.tv2-participation__score > .material-icons {
    color: var(--tv2-violet);
    font-size: 30px;
}

.tv2-participation__score strong {
    color: var(--tv2-ink);
    font-size: 2.3rem;
    font-weight: 950;
    line-height: .9;
}

.tv2-participation__score small {
    max-width: 112px;
    color: var(--tv2-muted);
    font-size: .68rem;
    line-height: 1.3;
}

.tv2-participation__score b {
    color: var(--tv2-ink);
}

.tv2-participation-types {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(145px, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.tv2-participation-type {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(96, 117, 171, .16);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .53));
    box-shadow: 0 16px 38px rgba(35, 49, 94, .08);
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
    animation: tv2-participation-card-in .5s both;
    animation-delay: calc(var(--tv2-participation-order) * 55ms);
}

.tv2-participation-type::before {
    position: absolute;
    inset: auto -35% -45% auto;
    width: 150px;
    aspect-ratio: 1;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    background: radial-gradient(circle, rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .17), transparent 67%);
}

.tv2-participation-type:hover,
.tv2-participation-type:focus-within {
    transform: translateY(-5px);
    border-color: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .34);
    box-shadow: 0 24px 52px rgba(35, 49, 94, .13);
}

.tv2-participation-type.is-active {
    border-color: rgba(var(--tv2-coral-rgb), .38);
    box-shadow: 0 22px 50px rgba(var(--tv2-coral-rgb), .15);
}

.tv2-participation-type__icon {
    display: grid;
    place-items: center;
    width: 48px;
    aspect-ratio: 1;
    border-radius: 16px;
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    background: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .1);
    box-shadow: 0 12px 25px rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .12);
}

.tv2-participation-type__icon .material-icons {
    font-size: 25px;
}

.tv2-participation-type__copy {
    flex: 1;
    margin-top: 17px;
}

.tv2-participation-type__copy strong {
    display: block;
    color: var(--tv2-ink);
    font-size: 1rem;
    font-weight: 950;
}

.tv2-participation-type__copy p {
    margin: 8px 0 0;
    color: var(--tv2-muted);
    font-size: .74rem;
    line-height: 1.48;
}

.tv2-participation-type__count {
    position: absolute;
    top: 17px;
    right: 17px;
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--tv2-ink);
    font-size: .72rem;
    font-weight: 950;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 8px 18px rgba(40, 54, 99, .08);
}

.tv2-participation-type__action {
    margin: 14px 0 0;
}

.tv2-participation-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 39px;
    padding: 9px 10px;
    border: 1px solid rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .18);
    border-radius: 13px;
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    font: inherit;
    font-size: .72rem;
    font-weight: 950;
    cursor: pointer;
    background: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .07);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.tv2-participation-action:hover,
.tv2-participation-action.is-active {
    transform: translateY(-2px);
    color: #fff;
    background: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    box-shadow: 0 12px 24px rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .2);
}

.tv2-participation-action .material-icons {
    font-size: 17px;
}

.tv2-participation-type__state {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-top: 14px;
    color: var(--tv2-coral);
    font-size: .7rem;
    font-weight: 900;
}

.tv2-participation-type__state .material-icons {
    font-size: 16px;
}

.tv2-participation-owner-note,
.tv2-participation-empty {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 19px 21px;
    border: 1px solid rgba(var(--tv2-violet-rgb), .18);
    border-radius: 20px;
    background: rgba(var(--tv2-violet-rgb), .06);
}

.tv2-participation-owner-note > .material-icons,
.tv2-participation-empty > .material-icons {
    color: var(--tv2-violet);
    font-size: 28px;
}

.tv2-participation-owner-note strong,
.tv2-participation-empty strong {
    color: var(--tv2-ink);
    font-weight: 950;
}

.tv2-participation-owner-note p,
.tv2-participation-empty p {
    margin: 5px 0 0;
    color: var(--tv2-text);
    font-size: .82rem;
    line-height: 1.55;
}

.tv2-participation-composer {
    position: relative;
    z-index: 2;
    margin-top: 22px;
    border: 1px solid rgba(var(--tv2-violet-rgb), .2);
    border-radius: 26px;
    background:
        radial-gradient(circle at 95% 0, rgba(var(--tv2-cyan-rgb), .09), transparent 32%),
        rgba(255, 255, 255, .58);
    box-shadow: 0 22px 55px rgba(33, 46, 91, .1);
}

.tv2-participation-composer[hidden] {
    display: none;
}

.tv2-participation-form {
    padding: clamp(20px, 3vw, 30px);
}

.tv2-participation-form__head,
.tv2-participation-form__identity,
.tv2-participation-form__footer,
.tv2-participation-visibility,
.tv2-participation-stream__head,
.tv2-participation-entry header {
    display: flex;
    align-items: center;
}

.tv2-participation-form__head,
.tv2-participation-form__footer,
.tv2-participation-stream__head {
    justify-content: space-between;
    gap: 20px;
}

.tv2-participation-form__identity {
    gap: 12px;
}

.tv2-participation-form__identity > .material-icons {
    display: grid;
    place-items: center;
    width: 46px;
    aspect-ratio: 1;
    border-radius: 15px;
    color: var(--tv2-violet);
    background: rgba(var(--tv2-violet-rgb), .1);
}

.tv2-participation-form__identity small,
.tv2-participation-form__identity strong {
    display: block;
}

.tv2-participation-form__identity small {
    color: var(--tv2-muted);
    font-size: .68rem;
    text-transform: uppercase;
}

.tv2-participation-form__identity strong {
    margin-top: 3px;
    color: var(--tv2-ink);
    font-weight: 950;
}

.tv2-participation-form__close {
    display: grid;
    place-items: center;
    width: 38px;
    aspect-ratio: 1;
    border: 0;
    border-radius: 12px;
    color: var(--tv2-muted);
    cursor: pointer;
    background: rgba(89, 105, 151, .08);
}

.tv2-participation-field {
    display: block;
    margin: 20px 0 0;
    color: var(--tv2-ink);
    font-size: .78rem;
    font-weight: 900;
}

.tv2-participation-field textarea,
.tv2-participation-field input,
.tv2-participation-field select,
.tv2-participation-visibility select {
    width: 100%;
    margin-top: 8px;
    border: 1px solid rgba(89, 108, 158, .2);
    border-radius: 16px;
    color: var(--tv2-text);
    font: inherit;
    background: rgba(255, 255, 255, .76);
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.tv2-participation-field textarea {
    min-height: 142px;
    padding: 15px 16px;
    resize: vertical;
    line-height: 1.55;
}

.tv2-participation-field input,
.tv2-participation-field select,
.tv2-participation-visibility select {
    min-height: 46px;
    padding: 10px 13px;
}

.tv2-participation-field textarea:focus,
.tv2-participation-field input:focus,
.tv2-participation-field select:focus,
.tv2-participation-visibility select:focus {
    border-color: rgba(var(--tv2-violet-rgb), .5);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 0 0 4px rgba(var(--tv2-violet-rgb), .09);
}

.tv2-participation-field > small {
    display: block;
    margin-top: 6px;
    color: var(--tv2-muted);
    font-size: .67rem;
    font-weight: 700;
    text-align: right;
}

.tv2-participation-conditional[hidden] {
    display: none;
}

.tv2-participation-form__footer {
    margin-top: 22px;
    padding-top: 19px;
    border-top: 1px solid rgba(91, 111, 162, .13);
}

.tv2-participation-visibility {
    gap: 10px;
    min-width: 280px;
}

.tv2-participation-visibility > .material-icons {
    color: var(--tv2-violet);
}

.tv2-participation-visibility > span {
    flex: 1;
}

.tv2-participation-visibility small {
    display: block;
    color: var(--tv2-muted);
    font-size: .66rem;
}

.tv2-participation-visibility select {
    min-height: 38px;
    margin-top: 3px;
    padding: 6px 10px;
    font-size: .74rem;
}

.tv2-participation-form__message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--tv2-danger, #b83d52);
    font-size: .76rem;
    font-weight: 850;
    background: rgba(200, 63, 86, .08);
}

.tv2-participation-stream {
    position: relative;
    z-index: 1;
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid rgba(91, 111, 162, .14);
}

.tv2-participation-stream__head {
    align-items: flex-end;
}

.tv2-participation-stream__head h3 {
    font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.tv2-participation-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.tv2-participation-filters button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(92, 111, 161, .15);
    border-radius: 999px;
    color: var(--tv2-muted);
    font: inherit;
    font-size: .67rem;
    font-weight: 900;
    cursor: pointer;
    background: rgba(255, 255, 255, .56);
}

.tv2-participation-filters button:hover,
.tv2-participation-filters button.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--tv2-violet), var(--tv2-blue));
}

.tv2-participation-list {
    display: grid;
    gap: 11px;
    margin-top: 20px;
}

.tv2-participation-entry {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 15px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(90, 110, 161, .15);
    border-radius: 20px;
    background: rgba(255, 255, 255, .58);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tv2-participation-entry:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .3);
    box-shadow: 0 16px 34px rgba(35, 49, 94, .08);
}

.tv2-participation-entry[hidden] {
    display: none;
}

.tv2-participation-entry__icon {
    display: grid;
    place-items: center;
    width: 44px;
    aspect-ratio: 1;
    border-radius: 14px;
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    background: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .1);
}

.tv2-participation-entry header {
    justify-content: space-between;
    gap: 14px;
}

.tv2-participation-entry header span,
.tv2-participation-entry header strong,
.tv2-participation-entry header small {
    display: inline;
}

.tv2-participation-entry header span {
    margin-right: 7px;
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    font-size: .67rem;
    font-weight: 950;
    text-transform: uppercase;
}

.tv2-participation-entry header strong {
    color: var(--tv2-ink);
    font-size: .8rem;
    font-weight: 950;
}

.tv2-participation-entry header small,
.tv2-participation-entry time {
    color: var(--tv2-muted);
    font-size: .67rem;
}

.tv2-participation-entry__body > p {
    margin: 10px 0 0;
    color: var(--tv2-text);
    font-size: .84rem;
    line-height: 1.65;
}

.tv2-participation-source,
.tv2-participation-availability {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 12px 10px 0 0;
    padding: 6px 9px;
    border-radius: 10px;
    color: var(--tv2-violet);
    font-size: .68rem;
    font-weight: 900;
    text-decoration: none;
    background: rgba(var(--tv2-violet-rgb), .07);
}

.tv2-participation-source .material-icons,
.tv2-participation-availability .material-icons {
    font-size: 15px;
}

.tv2-participation-entry__archive {
    margin: 0;
}

.tv2-participation-entry__archive button {
    display: grid;
    place-items: center;
    width: 32px;
    aspect-ratio: 1;
    border: 0;
    border-radius: 10px;
    color: var(--tv2-muted);
    cursor: pointer;
    background: rgba(92, 108, 151, .07);
}

.tv2-participation-entry__archive button:hover {
    color: #fff;
    background: #c8445d;
}

.tv2-public-participation {
    margin-top: 18px;
    padding: clamp(22px, 3vw, 32px);
    border-radius: 26px;
}

.tv2-public-participation__head {
    display: flex;
    gap: 22px;
    align-items: center;
    justify-content: space-between;
}

.tv2-public-participation__head h2 {
    margin: 0;
    color: var(--tv2-ink);
    font-size: clamp(1.45rem, 2.4vw, 2.2rem);
    font-weight: 950;
    letter-spacing: -.035em;
}

.tv2-public-participation__head p {
    max-width: 700px;
    margin: 9px 0 0;
    color: var(--tv2-text);
    line-height: 1.6;
}

.tv2-public-participation__total {
    min-width: 110px;
    text-align: center;
}

.tv2-public-participation__total strong,
.tv2-public-participation__total small {
    display: block;
}

.tv2-public-participation__total strong {
    color: var(--tv2-violet);
    font-size: 2.2rem;
    font-weight: 950;
}

.tv2-public-participation__total small {
    color: var(--tv2-muted);
    font-size: .68rem;
}

.tv2-public-participation__types {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 9px;
    margin-top: 20px;
}

.tv2-public-participation__type {
    display: grid;
    gap: 7px;
    place-items: center;
    min-height: 100px;
    padding: 12px;
    border: 1px solid rgba(90, 110, 161, .14);
    border-radius: 17px;
    text-align: center;
    background: rgba(255, 255, 255, .55);
}

.tv2-public-participation__type .material-icons {
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
}

.tv2-public-participation__type strong {
    color: var(--tv2-ink);
    font-size: 1.15rem;
    font-weight: 950;
}

.tv2-public-participation__type small {
    color: var(--tv2-muted);
    font-size: .64rem;
}

@media (max-width: 1280px) {
    .tv2-participation-types {
        grid-template-columns: repeat(4, minmax(165px, 1fr));
    }

    .tv2-public-participation__types {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }
}

@media (max-width: 820px) {
    .tv2-participation__head {
        grid-template-columns: 1fr;
    }

    .tv2-participation__score {
        width: 140px;
    }

    .tv2-participation-types {
        grid-template-columns: repeat(2, minmax(145px, 1fr));
    }

    .tv2-participation-form__footer,
    .tv2-participation-stream__head,
    .tv2-public-participation__head {
        align-items: stretch;
        flex-direction: column;
    }

    .tv2-participation-visibility {
        min-width: 0;
    }

    .tv2-participation-form__footer .tv2-button {
        width: 100%;
    }

    .tv2-participation-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .tv2-participation {
        padding: 20px 15px;
    }

    .tv2-participation-types,
    .tv2-public-participation__types {
        grid-template-columns: 1fr;
    }

    .tv2-participation-type {
        min-height: 0;
    }

    .tv2-participation-entry {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .tv2-participation-entry__archive {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .tv2-participation-entry header {
        align-items: flex-start;
        flex-direction: column;
        padding-right: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tv2-participation::before,
    .tv2-participation__score::before,
    .tv2-participation-type {
        animation: none;
    }
}

@keyframes tv2-participation-orbit {
    to { transform: rotate(360deg); }
}

@keyframes tv2-participation-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.tv2-participation-type.is-selected {
    transform: translateY(-5px);
    border-color: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .46);
    box-shadow: 0 25px 58px rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .16);
}

.tv2-participation-form__message.is-success {
    color: var(--tv2-green);
    background: rgba(var(--tv2-green-rgb), .09);
}

.tv2-participation-action.is-loading,
.tv2-participation-form .tv2-button.is-loading,
.tv2-participation-entry__archive button.is-loading {
    opacity: .62;
    cursor: progress;
}

/* Moderação integrada das formas de participação */
.tv2-moderation-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 26px;
    padding: 22px 26px;
    border-radius: 24px;
}

.tv2-moderation-section-head h2 {
    margin: 0;
    color: var(--tv2-ink);
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 950;
    letter-spacing: -.035em;
}

.tv2-moderation-section-head > strong {
    display: grid;
    place-items: center;
    min-width: 54px;
    min-height: 54px;
    border-radius: 18px;
    color: var(--tv2-violet);
    font-size: 1.2rem;
    font-weight: 950;
    background: rgba(var(--tv2-violet-rgb), .1);
    box-shadow: inset 0 0 0 1px rgba(var(--tv2-violet-rgb), .12);
}

.tv2-moderation-card--participation {
    border-color: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .22);
}

.tv2-moderation-card--participation .tv2-participation-entry__type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    color: rgb(var(--tone-rgb, var(--tv2-violet-rgb)));
    font-size: .72rem;
    font-weight: 950;
    background: rgba(var(--tone-rgb, var(--tv2-violet-rgb)), .1);
}

.tv2-moderation-card--participation .tv2-participation-entry__type .material-icons {
    font-size: 17px;
}

.tv2-moderation-card--participation .tv2-moderation-card__content > p {
    white-space: normal;
}

.tv2-moderation-context {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-top: 12px;
    padding: 8px 11px;
    border-radius: 12px;
    color: var(--tv2-text);
    font-size: .75rem;
    font-weight: 800;
    background: rgba(var(--tv2-green-rgb), .09);
}

.tv2-moderation-context .material-icons {
    color: var(--tv2-green);
    font-size: 18px;
}

.tv2-moderation-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.tv2-moderation-card__links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 680px) {
    .tv2-moderation-section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
