/*
 * CAMADA 7 — MÓDULOS · REPORTAR PROBLEMA / CONTATO
 *
 * Conteúdo permitido: o formulário do popup de contato
 * (templates/reportIssue.handlebars, js/page.reportIssue.js), a tela de
 * sucesso e o tamanho da própria janela (#popup-report-issue).
 *
 * A casca do popup está em component.modal.css; os campos herdam
 * component.forms.css e só ganham aqui o que é específico deste formulário.
 */


/* ==========================================================================
   1. JANELA E FORMULÁRIO
   ========================================================================== */

#popup-report-issue {
    width: min(92vw, 760px);
    height: min(90vh, 680px);
}

#formulario {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    padding: clamp(18px, 4vw, 32px);
    box-sizing: border-box;
    border: var(--border-none);
    border-radius: var(--radius-none);
    color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: var(--shadow-none);
}


/* ==========================================================================
   2. CAMPOS
   ========================================================================== */

.report-issue-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.report-issue-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#popup-report-issue .report-issue-field label {
    margin: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.report-issue-message {
    flex: 1;
    margin-top: 22px;
}

.area-message {
    width: 100%;
    max-width: 100%;
    min-height: 240px;
    box-sizing: border-box;
    resize: vertical;
}

/*
 * O Formcarry marca os campos recusados no envio. Sem !important a borda
 * padrão de component.forms.css venceria; com ele, a borda de foco (que tem
 * mais especificidade e também é !important) ainda vence, como deve.
 */
.formcarry-field-error {
    border-color: var(--color-danger) !important;
}


/* ==========================================================================
   3. BOTÃO DE ENVIO
   ========================================================================== */

.botao-enviar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    margin-top: 1.5rem;
    align-self: flex-end;
}


/* ==========================================================================
   4. TELA DE SUCESSO
   ========================================================================== */

#success-screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    padding: clamp(18px, 4vw, 32px);
    box-sizing: border-box;
    border: var(--border-none);
    border-radius: var(--radius-none);
    background: var(--color-white);
    box-shadow: var(--shadow-none);
}

#success-screen.is-visible {
    display: flex;
}

#success-screen h1 {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--color-primary);
}

.report-success-icon {
    margin-bottom: 16px;
    color: var(--color-success);
    font-size: clamp(48px, 8vw, 72px);
}

.success-screen-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}


/* ==========================================================================
   5. MOBILE
   ========================================================================== */

@media (max-width: 991px) {

    /* Tela cheia; a mesma regra da casca, repetida porque o id vence por especificidade. */
    #popup-report-issue {
        z-index: 2100;
        inset: 0;
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        margin: 0;
        border: var(--border-none);
        border-radius: var(--radius-none);
    }

    @supports (height: 100dvh) {
        #popup-report-issue {
            width: 100dvw;
            height: 100dvh;
        }
    }

    .report-issue-fields {
        grid-template-columns: 1fr;
    }

    .area-message {
        min-height: 140px;
    }

    .botao-enviar {
        width: 100%;
        margin-top: 1rem;
    }

    .success-screen-buttons {
        width: 100%;
        justify-content: center;
    }
}
