/* =========================================================
   SIMULADOR DE CONSÓRCIO
   Estilos específicos da ferramenta
   ========================================================= */


/* =========================================================
   ORIENTAÇÃO
   ========================================================= */

.consortium-orientation {
    padding-top: 0;
}

.consortium-orientation .section-card {
    padding: 32px;
}

.orientation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 28px;
}

.orientation-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.orientation-number {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.orientation-item h3 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 17px;
}

.orientation-item p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.orientation-tip {
    margin-top: 28px;
    padding: 16px 18px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #334155;
    line-height: 1.6;
    font-size: 14px;
}


/* =========================================================
   ÁREA PRINCIPAL
   ========================================================= */

.consortium-tool {
    width: 100%;
}

.consortium-card {
    padding: 32px;
}

.consortium-description {
    margin: 8px 0 30px;
    color: #64748b;
    line-height: 1.65;
}


/* =========================================================
   SEÇÕES DO FORMULÁRIO
   ========================================================= */

.form-section {
    padding: 26px 0;
    border-top: 1px solid #e2e8f0;
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-section-title {
    margin: 0 0 20px;
    color: #0f172a;
    font-size: 19px;
}

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

.form-group.full {
    grid-column: 1 / -1;
}

.field-help {
    margin-top: 7px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   RADIO
   ========================================================= */

.radio-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.radio-option {
    position: relative;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-align: center;
    transition:
        border-color .2s ease,
        background .2s ease,
        color .2s ease;
}

.radio-option label:hover {
    border-color: #93c5fd;
}

.radio-option input:checked + label {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}


/* =========================================================
   INPUT COM SUFIXO
   ========================================================= */

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-suffix input {
    width: 100%;
    padding-right: 52px;
}

.input-suffix {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
}


/* =========================================================
   CHECKBOX
   ========================================================= */

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f8fafc;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #2563eb;
}

.checkbox-field label {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}


/* =========================================================
   LANCE
   ========================================================= */

.lance-fields {
    margin-top: 16px;
}

.lance-fields.hidden {
    display: none;
}

.status-message {
    min-height: 20px;
    margin-top: 12px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   BOTÕES
   ========================================================= */

.consortium-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
}

.consortium-button {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition:
        background .2s ease,
        transform .2s ease;
}

.consortium-button:hover {
    background: #1d4ed8;
}

.consortium-button:active {
    transform: translateY(1px);
}

.consortium-button.secondary {
    background: #e2e8f0;
    color: #334155;
}

.consortium-button.secondary:hover {
    background: #cbd5e1;
}

#copyStatus {
    min-height: 22px;
}


/* =========================================================
   RESULTADO
   ========================================================= */

.result-area {
    display: none;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e2e8f0;
}

.result-area.visible {
    display: block;
}

.main-result {
    padding: 30px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    text-align: center;
}

.result-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.result-value {
    margin-top: 8px;
    color: #1d4ed8;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.1;
}

.result-subtitle {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   RESUMO
   ========================================================= */

.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.summary-box {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.summary-label {
    color: #64748b;
    font-size: 13px;
}

.summary-value {
    margin-top: 7px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}


/* =========================================================
   SEÇÕES DO RESULTADO
   ========================================================= */

.result-section {
    margin-top: 30px;
}

.result-section-title {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 19px;
}

.result-section-description {
    margin: -4px 0 18px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   TABELA DE CUSTOS
   ========================================================= */

.cost-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
}

.cost-table th,
.cost-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.cost-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.cost-table td {
    color: #334155;
    font-size: 14px;
}

.cost-table th:last-child,
.cost-table td:last-child {
    text-align: right;
}

.cost-table .total-row td {
    color: #0f172a;
    font-weight: 700;
    border-bottom: 0;
}


/* =========================================================
   INDICADORES
   ========================================================= */

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

.indicator {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.indicator-title {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.indicator-value {
    margin-top: 8px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   RESULTADO DO LANCE
   ========================================================= */

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

.lance-box {
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.lance-label {
    color: #64748b;
    font-size: 13px;
}

.lance-value {
    margin-top: 8px;
    color: #0f172a;
    font-size: 19px;
    font-weight: 700;
}


/* =========================================================
   DISTRIBUIÇÃO
   ========================================================= */

.distribution {
    margin-top: 22px;
}

.distribution-bar {
    display: flex;
    width: 100%;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.distribution-credit {
    width: 0;
    background: #2563eb;
    transition: width .4s ease;
}

.distribution-cost {
    width: 0;
    background: #94a3b8;
    transition: width .4s ease;
}

.distribution-legend {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 9px;
    color: #64748b;
    font-size: 12px;
}


/* =========================================================
   CENÁRIOS
   ========================================================= */

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

.scenario-card {
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.scenario-card h4 {
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 17px;
}

.scenario-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 13px;
}

.scenario-line:last-child {
    border-bottom: 0;
}

.scenario-line strong {
    color: #334155;
    text-align: right;
}


/* =========================================================
   AVISO
   ========================================================= */

.warning-box {
    margin-top: 30px;
    padding: 18px 20px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
    line-height: 1.65;
}


/* =========================================================
   INFORMAÇÕES
   ========================================================= */

.consortium-info {
    padding: 32px;
}

.consortium-info h2 {
    margin-top: 0;
}

.consortium-info h3 {
    margin: 28px 0 8px;
    color: #0f172a;
    font-size: 18px;
}

.consortium-info p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.information-tip {
    margin-top: 28px;
    padding: 17px 19px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #7f1d1d;
    line-height: 1.6;
    font-size: 14px;
}


/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 1050px) {

    .orientation-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 760px) {

    .consortium-card,
    .consortium-info,
    .consortium-orientation .section-card {
        padding: 24px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .form-group.full {
        grid-column: auto;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

    .result-summary-grid,
    .indicator-grid,
    .lance-result,
    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .consortium-actions {
        flex-direction: column;
    }

    .consortium-button {
        width: 100%;
    }

    .main-result {
        padding: 24px 18px;
    }

    .result-value {
        font-size: 34px;
    }

    .distribution-legend {
        flex-direction: column;
        gap: 5px;
    }

}


@media (max-width: 480px) {

    .consortium-card,
    .consortium-info,
    .consortium-orientation .section-card {
        padding: 20px 16px;
    }

    .orientation-item {
        gap: 12px;
    }

    .orientation-number {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .cost-table th,
    .cost-table td {
        padding: 11px 10px;
        font-size: 12px;
    }

}