/* ==========================================================
   GERABOI ERP
   MÓDULO: CONTEXTO DE FAZENDA
   Arquivo: fazenda-contexto.css
   ========================================================== */

:root {
    --gb-farm-primary: #123f35;
    --gb-farm-primary-hover: #205c4c;
    --gb-farm-accent: #d35c23;

    --gb-farm-bg: #ffffff;
    --gb-farm-bg-soft: #f3f8f6;

    --gb-farm-border: #dce6e2;
    --gb-farm-border-strong: #cddbd5;

    --gb-farm-text: #223b34;
    --gb-farm-text-muted: #62716d;

    --gb-farm-radius: 12px;
    --gb-farm-radius-lg: 22px;

    --gb-farm-shadow: 0 14px 40px rgba(12, 45, 37, 0.09);
}

/* ==========================================================
   1. SELETOR DE FAZENDA NO CABEÇALHO
   ========================================================== */

.gb-farm-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;

    width: auto;
    max-width: min(270px, 35vw);
    min-height: 42px;

    padding: 0.45rem 0.75rem;

    background: var(--card-bg, var(--gb-farm-bg));
    border: 1px solid var(--border-color, var(--gb-farm-border));
    border-radius: var(--gb-farm-radius);

    color: var(--text-color, var(--gb-farm-text));
    text-decoration: none;

    transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease,
            background-color 0.2s ease;
}

.gb-farm-switcher:hover {
    color: var(--gb-farm-primary);
    background: var(--hover-bg, #f5faf7);
    border-color: #236a58;
}

.gb-farm-switcher:focus-visible {
    outline: 3px solid #236a58;
    outline-offset: 3px;
}

.gb-farm-switcher > svg:first-child {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: #236a58;
}

.gb-farm-switcher__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.gb-farm-switcher__caption {
    font-size: 0.65rem;
    letter-spacing: 0.025em;
    opacity: 0.7;
}

.gb-farm-switcher__name {
    display: block;
    overflow: hidden;

    font-size: 0.8rem;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.gb-farm-switcher__chevron {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    opacity: 0.65;
}

/* ==========================================================
   2. ÁREA PRINCIPAL DA SELEÇÃO
   ========================================================== */

.gb-farm-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;

    width: 100%;
    min-width: 0;

    padding: clamp(20px, 4vw, 54px) 16px 72px;

    box-sizing: border-box;
}

.gb-farm-page *,
.gb-farm-page *::before,
.gb-farm-page *::after {
    box-sizing: border-box;
}

/* ==========================================================
   3. CARD PRINCIPAL
   ========================================================== */

.gb-farm-card {
    width: 100%;
    max-width: 720px;
    min-width: 0;

    padding: clamp(22px, 3.5vw, 40px);

    background: var(--gb-farm-bg);
    border: 1px solid #e2eae7;
    border-radius: var(--gb-farm-radius-lg);

    box-shadow: var(--gb-farm-shadow);
    color: var(--gb-farm-text);
}

/* ==========================================================
   4. CABEÇALHO DO CARD
   ========================================================== */

.gb-farm-card__heading {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-bottom: 18px;
}

.gb-farm-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 52px;

    width: 52px;
    height: 52px;

    background: #e9f3ef;
    border-radius: 16px;

    color: var(--gb-farm-primary);
}

.gb-farm-card__icon svg {
    width: 26px;
    height: 26px;
}

.gb-farm-card__eyebrow {
    display: block;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;

    color: var(--gb-farm-accent);
}

.gb-farm-card h1 {
    margin: 4px 0 0;

    font-size: clamp(22px, 2.5vw, 29px);
    font-weight: 750;
    line-height: 1.25;

    color: #183b32;
}

/* ==========================================================
   5. TEXTO EXPLICATIVO
   ========================================================== */

.gb-farm-card__intro {
    margin: 0 0 22px;

    font-size: 15px;
    line-height: 1.65;

    color: var(--gb-farm-text-muted);
}

/* ==========================================================
   6. FAZENDA ATUAL
   ========================================================== */

.gb-farm-card__current {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 24px;
    padding: 13px 15px;

    background: var(--gb-farm-bg-soft);
    border: 1px solid #e0ece7;
    border-radius: var(--gb-farm-radius);

    color: #476258;
    font-size: 13px;
}

.gb-farm-card__current svg {
    flex: 0 0 18px;

    width: 18px;
    height: 18px;

    color: #236a58;
}

.gb-farm-card__current strong {
    color: var(--gb-farm-primary);
    font-weight: 700;
}

/* ==========================================================
   7. FORMULÁRIO
   ========================================================== */

.gb-farm-form {
    width: 100%;
    min-width: 0;
}

.gb-farm-form__field {
    width: 100%;
    min-width: 0;
}

.gb-farm-form__label {
    display: block;

    margin-bottom: 9px;

    color: #263d35;
    font-size: 14px;
    font-weight: 700;
}

.gb-farm-form__label span {
    color: var(--gb-farm-accent);
}

/* ==========================================================
   8. SELECT DE FAZENDA
   ========================================================== */

.gb-farm-form select.gb-farm-form__select {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 52px;

    padding: 12px 42px 12px 15px;

    background-color: #ffffff;

    border: 1px solid var(--gb-farm-border-strong);
    border-radius: var(--gb-farm-radius);

    color: var(--gb-farm-text);

    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;

    box-shadow: none;

    transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease;
}

.gb-farm-form select.gb-farm-form__select:hover {
    border-color: #8fb7a7;
}

.gb-farm-form select.gb-farm-form__select:focus {
    outline: none;

    border-color: #236a58;
    box-shadow: 0 0 0 3px rgba(35, 106, 88, 0.14);
}

.gb-farm-form select.gb-farm-form__select:disabled {
    background-color: #f2f5f3;
    color: #8b9691;
    cursor: not-allowed;
}

/* ==========================================================
   9. TEXTO DE AJUDA
   ========================================================== */

.gb-farm-form__hint {
    margin: 9px 0 24px;

    font-size: 12px;
    line-height: 1.5;

    color: #74827d;
}

/* ==========================================================
   10. AÇÕES DO FORMULÁRIO
   ========================================================== */

.gb-farm-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 12px;
}

.gb-farm-form__submit,
.gb-farm-form__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    min-height: 48px;
    padding: 11px 20px;

    border-radius: 11px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;

    text-align: center;
    text-decoration: none;

    transition:
            background-color 0.2s ease,
            border-color 0.2s ease,
            box-shadow 0.2s ease;
}

/* ==========================================================
   11. BOTÃO PRINCIPAL
   ========================================================== */

.gb-farm-form__submit {
    background: var(--gb-farm-primary);
    border: 1px solid var(--gb-farm-primary);

    color: #ffffff;
    cursor: pointer;
}

.gb-farm-form__submit:hover {
    background: var(--gb-farm-primary-hover);
    border-color: var(--gb-farm-primary-hover);

    color: #ffffff;
}

.gb-farm-form__submit:active {
    background: #0c3028;
}

.gb-farm-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================
   12. BOTÃO SECUNDÁRIO
   ========================================================== */

.gb-farm-form__secondary {
    background: #ffffff;
    border: 1px solid #b9c8c1;

    color: #39574c;
}

.gb-farm-form__secondary:hover {
    background: #f1f7f4;
    border-color: #8eaa9c;

    color: var(--gb-farm-primary);
}

.gb-farm-form__submit svg,
.gb-farm-form__secondary svg {
    flex: 0 0 18px;

    width: 18px;
    height: 18px;
}

.gb-farm-form__submit:focus-visible,
.gb-farm-form__secondary:focus-visible {
    outline: 3px solid #ef8a4a;
    outline-offset: 3px;
}

/* ==========================================================
   13. CONTROLES ADICIONAIS INDESEJADOS

   Oculta botões extras inseridos diretamente na área
   de seleção por scripts antigos.

   Não interfere no botão principal de envio.
   ========================================================== */

.gb-farm-form__field > button,
.gb-farm-form__field > input[type="button"],
.gb-farm-form__field > input[type="submit"],
.gb-farm-form > button:not(.gb-farm-form__submit),
.gb-farm-form > input[type="button"] {
    display: none !important;
}

/* ==========================================================
   14. RESPONSIVIDADE - TABLETS
   ========================================================== */

@media (max-width: 900px) {

    .gb-farm-switcher {
        justify-content: center;

        width: 42px;
        height: 42px;
        max-width: 46px;

        padding: 0;
    }

    .gb-farm-switcher__content,
    .gb-farm-switcher__chevron {
        display: none;
    }

}

/* ==========================================================
   15. RESPONSIVIDADE - CELULARES
   ========================================================== */

@media (max-width: 575px) {

    .gb-farm-page {
        padding: 20px 12px 44px;
    }

    .gb-farm-card {
        padding: 22px 18px;
        border-radius: 17px;
    }

    .gb-farm-card__heading {
        gap: 12px;
    }

    .gb-farm-card__icon {
        flex-basis: 44px;

        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .gb-farm-card__icon svg {
        width: 22px;
        height: 22px;
    }

    .gb-farm-card h1 {
        font-size: 22px;
    }

    .gb-farm-card__intro {
        font-size: 14px;
    }

    .gb-farm-card__current {
        align-items: flex-start;
    }

    .gb-farm-form__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gb-farm-form__submit,
    .gb-farm-form__secondary {
        width: 100%;
    }

}

/* ==========================================================
   16. ACESSIBILIDADE
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .gb-farm-switcher,
    .gb-farm-form__select,
    .gb-farm-form__submit,
    .gb-farm-form__secondary {
        transition: none;
    }

}