/* ======================================================================
   CRIEATIVIDADE.ORG — ETAPA D
   BUSCA INSTITUCIONAL PÚBLICA · 2026-07-15

   Carregar depois de:
   - instituicoes_v2.css
   - instituicoes_master_unicorn.css
====================================================================== */

.inst-search-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 7% 4%, rgba(11, 141, 107, .055), transparent 30rem),
        radial-gradient(circle at 94% 12%, rgba(40, 89, 220, .055), transparent 34rem),
        #f7faf8;
}

.inst-search-main {
    min-height: calc(100vh - var(--crpub-header-h));
}

/* ----------------------------------------------------------------------
   HERO
---------------------------------------------------------------------- */

.inst-search-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(58px, 7vw, 94px) 0 clamp(42px, 5vw, 68px);
    background:
        radial-gradient(circle at 85% 10%, rgba(40, 89, 220, .13), transparent 29%),
        radial-gradient(circle at 10% 12%, rgba(11, 141, 107, .14), transparent 31%),
        linear-gradient(180deg, #f8fcfa 0%, #f7faf8 100%);
}

.inst-search-hero::after {
    content: "";
    position: absolute;
    right: -210px;
    bottom: -360px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 1px solid rgba(40, 89, 220, .08);
    box-shadow:
        0 0 0 74px rgba(40, 89, 220, .018),
        0 0 0 148px rgba(11, 141, 107, .014);
    pointer-events: none;
}

.inst-search-hero__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: clamp(38px, 6vw, 76px);
    align-items: end;
}

.inst-search-hero__copy {
    max-width: 860px;
}

.inst-search-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    color: #5a7069;
    font-size: 12.5px;
    font-weight: 820;
    text-decoration: none;
}

.inst-search-back:hover {
    color: var(--crpub-green);
}

.inst-search-hero h1 {
    max-width: 900px;
    margin: 18px 0 20px;
    font-size: clamp(42px, 5.2vw, 72px);
    line-height: 1.01;
    letter-spacing: -.058em;
    text-wrap: balance;
}

.inst-search-hero__copy > p {
    max-width: 800px;
    margin: 0;
    color: #596f68;
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.78;
}

.inst-search-mode {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding: 6px;
    border: 1px solid rgba(17, 58, 48, .10);
    border-radius: 17px;
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--crpub-shadow-xs);
}

.inst-search-mode a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    border-radius: 12px;
    color: #526861;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.inst-search-mode a:hover {
    color: var(--crpub-green-dark);
    background: rgba(226, 246, 238, .72);
}

.inst-search-mode a.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--crpub-green-2), var(--crpub-green-dark));
    box-shadow: 0 10px 24px rgba(8, 113, 87, .18);
}

.inst-search-principle {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 17px;
    padding: 25px;
    border: 1px solid rgba(8, 113, 87, .14);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 253, 251, .88));
    box-shadow: var(--crpub-shadow-md);
}

.inst-search-principle__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: var(--crpub-green-dark);
    background: linear-gradient(135deg, var(--crpub-green-soft), var(--crpub-blue-soft));
    font-size: 25px;
    font-weight: 900;
}

.inst-search-principle div {
    display: grid;
    gap: 7px;
}

.inst-search-principle small {
    color: var(--crpub-green);
    font-size: 9px;
    font-weight: 920;
    letter-spacing: .12em;
}

.inst-search-principle strong {
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.inst-search-principle p {
    margin: 0;
    color: var(--crpub-muted);
    font-size: 12.5px;
    line-height: 1.65;
}

/* ----------------------------------------------------------------------
   ÁREA DE BUSCA
---------------------------------------------------------------------- */

.inst-search-workspace {
    padding: 0 0 clamp(82px, 9vw, 120px);
}

.inst-search-alert {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 0;
    padding: 16px 18px;
    border-radius: 16px;
    font-size: 13px;
}

.inst-search-alert--error {
    color: #7b2f2f;
    border: 1px solid rgba(161, 63, 63, .20);
    background: #fff0f0;
}

.inst-search-panel {
    position: relative;
    z-index: 3;
    margin-top: -2px;
    padding: clamp(25px, 4vw, 40px);
    border: 1px solid rgba(17, 58, 48, .11);
    border-radius: 32px;
    background:
        radial-gradient(circle at 95% 0%, rgba(40, 89, 220, .07), transparent 25%),
        radial-gradient(circle at 5% 0%, rgba(11, 141, 107, .07), transparent 26%),
        rgba(255, 255, 255, .94);
    box-shadow: var(--crpub-shadow-lg);
}

.inst-search-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    margin-bottom: 28px;
}

.inst-search-panel__header > div {
    max-width: 760px;
}

.inst-search-panel__step {
    display: inline-flex;
    color: var(--crpub-green);
    font-size: 9.5px;
    font-weight: 930;
    letter-spacing: .13em;
}

.inst-search-panel__header h2,
.inst-search-results__header h2 {
    margin: 9px 0 8px;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.08;
    letter-spacing: -.042em;
}

.inst-search-panel__header p {
    margin: 0;
    color: var(--crpub-muted);
    font-size: 14px;
    line-height: 1.68;
}

.inst-search-context-pill {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 999px;
    color: var(--crpub-green-dark);
    background: var(--crpub-green-soft);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.inst-search-form {
    display: grid;
    gap: 22px;
}

.inst-search-form label {
    display: block;
    margin-bottom: 8px;
    color: #2d4a42;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .015em;
}

.inst-search-form__main small {
    display: block;
    margin-top: 8px;
    color: #7a8b85;
    font-size: 10.5px;
    line-height: 1.5;
}

.inst-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.inst-search-input-wrap > svg {
    position: absolute;
    left: 18px;
    width: 22px;
    height: 22px;
    color: #6f837c;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.inst-search-input-wrap input {
    width: 100%;
    min-height: 62px;
    padding: 0 54px 0 54px;
    border: 1px solid rgba(17, 58, 48, .14);
    border-radius: 18px;
    color: var(--crpub-ink);
    background: #fff;
    box-shadow: 0 8px 26px rgba(7, 43, 35, .045);
    font: inherit;
    font-size: 15px;
    font-weight: 730;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.inst-search-input-wrap input:focus {
    outline: none;
    border-color: rgba(40, 89, 220, .32);
    box-shadow: var(--crpub-focus), var(--crpub-shadow-xs);
}

.inst-search-input-wrap input::placeholder,
.inst-search-field input::placeholder {
    color: #98a6a1;
}

.inst-search-clear-input {
    position: absolute;
    right: 13px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 11px;
    color: #6c7d77;
    background: #f1f5f3;
    font-size: 20px;
    cursor: pointer;
}

.inst-search-form__filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.inst-search-field input,
.inst-search-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(17, 58, 48, .12);
    border-radius: 14px;
    color: #304c44;
    background: #fbfdfc;
    font: inherit;
    font-size: 12.5px;
    font-weight: 730;
}

.inst-search-field input:focus,
.inst-search-field select:focus {
    outline: none;
    border-color: rgba(40, 89, 220, .28);
    background: #fff;
    box-shadow: var(--crpub-focus);
}

.inst-search-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.inst-search-form__actions .inst-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inst-search-reset {
    color: #637770;
    font-size: 11.5px;
    font-weight: 820;
    text-decoration: none;
}

.inst-search-reset:hover {
    color: var(--crpub-green);
    text-decoration: underline;
}

.inst-search-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 22px;
    padding-top: 19px;
    border-top: 1px solid rgba(17, 58, 48, .08);
}

.inst-search-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #71837d;
    font-size: 10.5px;
    font-weight: 750;
}

.inst-search-trust-row b {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--crpub-green-dark);
    background: var(--crpub-green-soft);
    font-size: 9px;
}

/* ----------------------------------------------------------------------
   RESULTADOS
---------------------------------------------------------------------- */

.inst-search-results {
    margin-top: 32px;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid rgba(17, 58, 48, .10);
    border-radius: 30px;
    background: rgba(255, 255, 255, .88);
    box-shadow: var(--crpub-shadow-md);
}

.inst-search-results__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.inst-search-results__header h2 {
    margin-bottom: 0;
}

.inst-search-status {
    max-width: 430px;
    margin: 0;
    color: #687b74;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.55;
    text-align: right;
}

.inst-search-loading {
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--crpub-muted);
}

.inst-search-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crpub-green);
    animation: inst-search-pulse .9s ease-in-out infinite alternate;
}

.inst-search-loading span:nth-child(2) {
    animation-delay: .16s;
}

.inst-search-loading span:nth-child(3) {
    animation-delay: .32s;
}

.inst-search-loading strong {
    margin-left: 7px;
    font-size: 12px;
}

@keyframes inst-search-pulse {
    to {
        transform: translateY(-5px);
        opacity: .38;
    }
}

.inst-search-initial,
.inst-search-empty {
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 34px;
    border: 1px dashed rgba(17, 58, 48, .17);
    border-radius: 23px;
    background:
        radial-gradient(circle at 50% 15%, rgba(11, 141, 107, .08), transparent 33%),
        #fbfdfc;
}

.inst-search-initial__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.inst-search-initial__visual span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(17, 58, 48, .09);
    background: #fff;
    box-shadow: var(--crpub-shadow-xs);
    font-size: 22px;
}

.inst-search-initial__visual i {
    width: 24px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(11,141,107,.28), rgba(40,89,220,.28));
}

.inst-search-initial h3,
.inst-search-empty h3 {
    margin: 0 0 9px;
    font-size: 22px;
    letter-spacing: -.03em;
}

.inst-search-initial p,
.inst-search-empty p {
    max-width: 580px;
    margin: 0;
    color: var(--crpub-muted);
    font-size: 13px;
    line-height: 1.68;
}

.inst-search-empty__icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 20px;
    color: var(--crpub-green-dark);
    background: var(--crpub-green-soft);
    font-size: 31px;
}

.inst-search-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.inst-search-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 390px;
    padding: 23px;
    border: 1px solid rgba(17, 58, 48, .11);
    border-radius: 23px;
    background:
        radial-gradient(circle at 96% 0%, rgba(40, 89, 220, .045), transparent 26%),
        #fff;
    box-shadow: var(--crpub-shadow-xs);
    transition: transform .18s var(--crpub-ease), border-color .18s ease, box-shadow .18s ease;
}

.inst-search-card:hover {
    transform: translateY(-3px);
    border-color: rgba(8, 113, 87, .22);
    box-shadow: var(--crpub-shadow-md);
}

.inst-search-card[data-match-level="exact"] {
    border-color: rgba(8, 113, 87, .30);
    box-shadow: 0 18px 48px rgba(8, 113, 87, .10);
}

.inst-search-card__top {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.inst-search-card__avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--crpub-green-2), var(--crpub-blue));
    box-shadow: 0 12px 28px rgba(40, 89, 220, .16);
    font-size: 20px;
    font-weight: 920;
}

.inst-search-card__identity {
    min-width: 0;
}

.inst-search-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.inst-search-card__badges > span {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    color: #647771;
    background: #f2f6f4;
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.inst-search-card__badges .inst-search-match--exact {
    color: var(--crpub-green-dark);
    background: var(--crpub-green-soft);
}

.inst-search-card__badges .inst-search-match--probable {
    color: #224da9;
    background: var(--crpub-blue-soft);
}

.inst-search-card__badges .inst-search-match--related {
    color: #765619;
    background: #fff4d9;
}

.inst-search-card h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.22;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}

.inst-search-card__identity > p {
    margin: 6px 0 0;
    color: #72847e;
    font-size: 11px;
    font-weight: 730;
}

.inst-search-card__description {
    flex: 1;
    margin: 22px 0;
    color: #5d706a;
    font-size: 13px;
    line-height: 1.72;
}

.inst-search-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.inst-search-card__metrics span {
    min-height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 9px;
    border-radius: 13px;
    color: #72837d;
    background: #f6f9f8;
    font-size: 8.5px;
    font-weight: 770;
    line-height: 1.35;
    text-align: center;
}

.inst-search-card__metrics strong {
    display: block;
    margin-bottom: 2px;
    color: var(--crpub-ink);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.inst-search-card__metrics em {
    font-style: normal;
}

.inst-search-card__action {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 15px;
    border: 1px solid rgba(8, 113, 87, .14);
    border-radius: 14px;
    color: var(--crpub-green-dark);
    background: var(--crpub-green-soft);
    font-size: 11.5px;
    font-weight: 900;
    text-decoration: none;
}

.inst-search-card__action:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--crpub-green-2), var(--crpub-green-dark));
}

.inst-search-card__action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .16s ease;
}

.inst-search-card__action:hover svg {
    transform: translateX(3px);
}

/* ----------------------------------------------------------------------
   DECISÕES APÓS A BUSCA
---------------------------------------------------------------------- */

.inst-search-decision {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-top: 22px;
    padding: 22px;
    border-radius: 21px;
}

.inst-search-decision--create {
    border: 1px solid rgba(8, 113, 87, .18);
    background:
        radial-gradient(circle at 94% 0%, rgba(40, 89, 220, .07), transparent 28%),
        linear-gradient(135deg, #eaf8f2, #f7fbf9);
}

.inst-search-decision--join {
    border: 1px solid rgba(40, 89, 220, .16);
    background: linear-gradient(135deg, #edf2ff, #f8faff);
}

.inst-search-decision__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--crpub-green), var(--crpub-blue));
    font-size: 20px;
    font-weight: 920;
}

.inst-search-decision__copy {
    min-width: 0;
}

.inst-search-decision__copy small {
    color: var(--crpub-green);
    font-size: 8.5px;
    font-weight: 930;
    letter-spacing: .12em;
}

.inst-search-decision__copy h3 {
    margin: 6px 0 6px;
    font-size: 18px;
    letter-spacing: -.025em;
}

.inst-search-decision__copy p {
    margin: 0;
    color: #62766f;
    font-size: 11.5px;
    line-height: 1.58;
}

.inst-search-decision__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.inst-search-text-link {
    color: #556b64;
    font-size: 10.5px;
    font-weight: 820;
    text-decoration: none;
}

.inst-search-text-link:hover {
    color: var(--crpub-green);
    text-decoration: underline;
}

/* ----------------------------------------------------------------------
   POR QUE BUSCAR
---------------------------------------------------------------------- */

.inst-search-why {
    padding: clamp(76px, 8vw, 112px) 0;
    border-top: 1px solid rgba(17, 58, 48, .07);
    background: #fff;
}

.inst-search-why__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.inst-search-why__grid article {
    min-height: 240px;
    padding: 27px;
    border: 1px solid rgba(17, 58, 48, .10);
    border-radius: 23px;
    background: #fbfdfc;
    box-shadow: var(--crpub-shadow-xs);
}

.inst-search-why__grid article > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--crpub-green), var(--crpub-blue));
    font-size: 10px;
    font-weight: 920;
}

.inst-search-why__grid h3 {
    margin: 24px 0 10px;
    font-size: 20px;
    letter-spacing: -.025em;
}

.inst-search-why__grid p {
    margin: 0;
    color: var(--crpub-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* ----------------------------------------------------------------------
   ESTADOS E RESPONSIVIDADE
---------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.inst-search-results[aria-busy="true"] .inst-search-form {
    pointer-events: none;
}

@media (max-width: 1000px) {
    .inst-search-hero__grid {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .inst-search-principle {
        max-width: 680px;
    }

    .inst-search-grid {
        grid-template-columns: 1fr;
    }

    .inst-search-card {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .inst-search-hero {
        padding-top: 46px;
    }

    .inst-search-hero h1 {
        font-size: clamp(38px, 12.5vw, 58px);
    }

    .inst-search-mode {
        display: grid;
        width: 100%;
    }

    .inst-search-mode a {
        justify-content: center;
    }

    .inst-search-principle {
        grid-template-columns: 1fr;
    }

    .inst-search-panel,
    .inst-search-results {
        border-radius: 24px;
    }

    .inst-search-panel__header,
    .inst-search-results__header {
        display: grid;
        gap: 14px;
    }

    .inst-search-context-pill {
        width: fit-content;
    }

    .inst-search-status {
        max-width: none;
        text-align: left;
    }

    .inst-search-form__filters {
        grid-template-columns: 1fr;
    }

    .inst-search-form__actions {
        display: grid;
    }

    .inst-search-form__actions .inst-btn {
        width: 100%;
    }

    .inst-search-reset {
        text-align: center;
    }

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

    .inst-search-decision {
        grid-template-columns: auto 1fr;
    }

    .inst-search-decision > .inst-btn,
    .inst-search-decision__actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .inst-search-decision > .inst-btn,
    .inst-search-decision__actions .inst-btn {
        width: 100%;
    }

    .inst-search-why__grid {
        grid-template-columns: 1fr;
    }

    .inst-search-why__grid article {
        min-height: 0;
    }
}

@media (max-width: 470px) {
    .inst-search-input-wrap input {
        min-height: 58px;
        padding-left: 48px;
        font-size: 13px;
    }

    .inst-search-card {
        padding: 19px;
        border-radius: 19px;
    }

    .inst-search-card__top {
        gap: 12px;
    }

    .inst-search-card__avatar {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .inst-search-card h3 {
        font-size: 18px;
    }

    .inst-search-card__metrics {
        grid-template-columns: 1fr;
    }

    .inst-search-card__metrics span {
        min-height: 48px;
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }

    .inst-search-card__metrics strong {
        margin-bottom: 0;
    }

    .inst-search-decision {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .inst-search-decision__icon {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inst-search-loading span {
        animation: none !important;
    }
}
