/* Estilos gerais - mobile first */  

/* Resets simples */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.5;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* HEADER – fundo preto, logos centralizadas */
.site-header {
    background-color: #000000;   /* preto */
    color: #ffffff;
    padding: 1.25rem 1rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logos {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 40px;
    width: auto;
    display: block;
}

.header-logo-setai {
    height: 32px;
}

.header-divider {
    width: 1px;
    height: 34px;
    background-color: rgba(255, 255, 255, 0.6);
}

.header-separator {
    border: none;
    border-top: 1px solid #222222;
    margin: 0;
}

/* Header no mobile */
@media (max-width: 767px) {
    .site-header {
        padding: 1rem 0.75rem;
    }

    .header-logos {
        gap: 12px;
    }

    .header-logo {
        height: 32px;
    }

    .header-logo-setai {
        height: 28px;
    }
}

/* INTRO – texto sobre as empresas */
.intro-empresas {
    max-width: 900px;              /* mais estreito, fica melhor em notebook */
    margin: 1.5rem auto 0.75rem;   /* centraliza horizontalmente */
    padding: 0 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    text-align: center;            /* centraliza o texto */
}

.intro-empresas p + p {
    margin-top: 0.5rem;
}

@media (max-width: 767px) {
    .intro-empresas {
        padding: 1rem 1rem 0;
        margin: 1rem auto 0.5rem;
        font-size: 0.85rem;
    }
}

/* Bloco de restrições (pílulas + texto) */
.restricoes {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
    text-align: left;
    background-color: transparent;
}

/* linha das pílulas */
.pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

/* pílulas individuais */
.pill {
    background-color: #f1f1f1;
    color: #555;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* texto abaixo das pílulas */
.restricoes-texto {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #666;
    max-width: 640px;
}

/* mobile: ajusta padding e centraliza melhor */
@media (max-width: 767px) {
    .restricoes {
        padding: 0 1rem 1rem;
        margin-bottom: 1.25rem;
    }

    .pills {
        justify-content: flex-start;
    }

    .pill {
        font-size: 0.78rem;
    }

    .restricoes-texto {
        max-width: 100%;
    }
}

/* Formulário */
/* Container principal que agrupa formulário e mapa */
.conteudo {
    background-color: #ffffff;
    margin: 1rem auto;
    max-width: 1200px;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Coluna do formulário */
.form-col {
    flex: 1 1 100%;
}

.form-col h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* Coluna do mapa */
.map-col {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
}

.map-titulo {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Campo que ocupa toda a largura (observações) */
.full-width {
    width: 100%;
}

fieldset {
    border: none;
    margin-bottom: 1rem;
}

legend {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.campo {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.campo label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.campo input,
.campo select,
.campo textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Alinha rádio e texto lado a lado */
.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0;
}

.radio-group input {
    margin-right: 0;
}

.ajuda {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.25rem;
}

.map-container {
    height: 250px;
    width: 100%;
    background-color: #eaeaea;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.map-placeholder {
    color: #999;
}

.botao-enviar {
    background-color: #166938;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* BLOCO: Documentos complementares (anexos) */
.campo-anexos {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    border-left: none;
}

/* Título e descrição */
.campo-anexos .anexos-titulo {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #333;
}

.campo-anexos .anexos-descricao {
    margin: 0 0 12px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #555;
}

/* Linha com botão + texto de formatos */
.campo-anexos .anexos-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Botão "Clique para adicionar arquivos" */
.botao-anexos {
    background-color: #B0A65F;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s ease, transform 0.05s ease;
}

.botao-anexos:hover {
    filter: brightness(0.95);
}

.botao-anexos:active {
    transform: scale(0.98);
}

/* Texto dos formatos aceitos */
.campo-anexos .anexos-formatos {
    font-size: 0.75rem;
    color: #777;
}

/* Esconde o input nativo */
.input-anexos-real {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Caixa da lista de arquivos */
.anexos-lista {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 0.8rem;
    max-height: 140px;
    overflow-y: auto;
}

/* Estado "nenhum arquivo" */
.anexos-vazio {
    color: #999;
}

/* Cada arquivo listado */
.anexos-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}

.anexos-item:last-child {
    border-bottom: none;
}

.anexos-item-nome {
    color: #333;
    word-break: break-all;
}

.anexos-item-tamanho {
    color: #777;
    white-space: nowrap;
    font-size: 0.75rem;
}

/* Responsivo: em telas muito estreitas, joga o texto de formatos pra baixo */
@media (max-width: 768px) {
    .campo-anexos .anexos-acoes {
        align-items: flex-start;
    }

    .campo-anexos .anexos-formatos {
        flex-basis: 100%;
    }
}

/* Rodapé */
.site-footer {
    background-color: #000000; /* preto */
    color: #ffffff;
    padding: 1rem;
    text-align: center;
}

/* container interno do rodapé */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* LOGOS NO RODAPÉ */
.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* tamanho das logos */
.footer-logo img {
    height: 32px;
    width: auto;
}

/* linha vertical entre SETAI (1ª imagem) e Nova Harmonia (2ª) */
.footer-logo img:first-child {
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px solid #ffffff;
}

.footer-text {
    font-size: 0.9rem;
}

/* Rodapé no mobile */
@media (max-width: 767px) {
    .site-footer {
        padding: 1.5rem 1rem;
    }

    .footer-content {
        gap: 0.85rem;
    }

    .footer-logo img {
        height: 28px; /* um pouco menor no mobile */
    }

    .footer-text {
        font-size: 0.8rem;
        text-align: center;
    }
}

/* Media query para telas maiores */
@media screen and (min-width: 768px) {
    .restricoes {
        text-align: left;
        padding: 2rem 2rem 1.25rem;
    }

    /* Ajustes de layout em telas maiores */
    .conteudo {
        margin: 2rem auto;
        padding: 2rem;
        max-width: 1200px;
        flex-direction: row;
        gap: 3rem;
    }

    /* Distribui campos em duas colunas dentro dos fieldsets */
    .form-col fieldset {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 2rem;
    }

    legend {
        grid-column: span 2;
    }

    .campo {
        flex-direction: column;
    }

    /* Aumenta a altura do mapa em telas maiores */
    .map-container {
        height: 400px;
    }

    .botao-enviar {
        align-self: flex-start;
    }

    .site-footer {
        padding: 2rem;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;   /* mesmo width da .conteudo */
        margin: 0 auto;
    }

    .footer-logo {
        flex: 1;
        justify-content: flex-start; /* alinha com o conteúdo da página */
    }

    .footer-text {
        flex: 1;
        text-align: right;
    }

    /* Bloco de anexos ocupa as duas colunas do fieldset */
    .campo-anexos {
        grid-column: span 2;
    }
}

/* Layout geral do formulário em duas colunas */
.form-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-col,
.map-col {
    width: 100%;
}

/* Desktop: duas colunas lado a lado */
@media screen and (min-width: 992px) {
    .form-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .form-col,
    .map-col {
        width: 50%;
    }
}

/* Bloco da calculadora de área */
.area-box {
    margin-top: 1.5rem;
    background-color: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    padding: 1.25rem 1.5rem;
}

.area-box-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.area-box-header p {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.75rem;
}

/* Linha com input + select */
.area-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.area-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

.area-unit {
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    background-color: #fff;
}

/* Tabela simples de unidades */
.area-unidades {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.area-unidade-item {
    font-size: 0.9rem;
}

.area-unidade-label {
    display: block;
    color: #777;
    margin-bottom: 0.25rem;
}

.area-unidade-valor {
    font-weight: 600;
}

/* Observações na coluna direita */
.observacoes-area {
    margin-top: 1.5rem;
}

/* Classe utilitária para esconder rótulos visuais, mas manter para acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Ações do mapa (abaixo do texto de ajuda) */
.map-actions {
    margin: 8px 0 16px;
    text-align: right; /* botão alinhado à direita */
}

/* Botão "Limpar desenho" */
.botao-limpar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    background-color: #B0A65F;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.botao-limpar:hover {
    background-color: #968b45;
    transform: translateY(-1px);
}

.botao-limpar:active {
    transform: translateY(0);
}

/* Estado de carregamento do botão "Enviar oferta" */
.botao-enviar.is-loading {
    position: relative;
    opacity: 0.9;
}

/* Spinner dentro do botão */
.botao-enviar.is-loading::after {
    content: "";
    position: absolute;
    right: 1rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #ffffff;
    animation: btn-spinner 0.6s linear infinite;
}

/* Animação do spinner */
@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}
