/* ==========================================================================
   site.css — o que só existe no site próprio, por cima do template.css:
   a armadilha de robô, o campo de foto de verdade (input file), o erro de
   envio e o "Responder de novo" da confirmação. Mesmos tokens e grid de 8.
   ========================================================================== */

/* Fora da tela, mas no formulário: robô preenche, gente não vê. */
.fmt-armadilha {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* O título do bloco 04 carrega o selo "opcional", como o rótulo do recado
   carregava no Moodle. */
.fmt-bloco__titulo .fmt-opcional {
    font-size: 12px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   A FOTO
   O <input type="file"> fica na página, focável e na ordem do teclado, mas
   invisível; quem desenha é o <label> logo depois, uma área inteira que
   responde ao toque e aceita a foto arrastada. 1 + 15 + 64 + 15 + 1 = 96.
   -------------------------------------------------------------------------- */
.fmt-sub--foto[hidden] {
    display: none !important;
}

.fmt-arquivo {
    position: relative;
}

.fmt-arquivo input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.fmt-arquivo__alvo {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    padding: 15px;
    border: 1px dashed var(--fmt-borda-campo);
    border-radius: 12px;
    background: var(--fmt-superficie);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s var(--fmt-ease), background-color .15s var(--fmt-ease);
}

.fmt-arquivo__previa {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230050A8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5A2.5 2.5 0 0 1 6.5 6h1.6l1.2-1.8h5.4L15.9 6h1.6A2.5 2.5 0 0 1 20 8.5v8A2.5 2.5 0 0 1 17.5 19h-11A2.5 2.5 0 0 1 4 16.5z'/%3E%3Ccircle cx='12' cy='12.5' r='3.25'/%3E%3C/svg%3E") center / 28px 28px no-repeat,
        #fff;
    background-size: 28px 28px, cover;
    box-shadow: inset 0 0 0 1px var(--fmt-linha);
    overflow: hidden;
}

.fmt-arquivo.tem-arquivo .fmt-arquivo__previa {
    background: var(--previa) center top / cover no-repeat, #fff;
    box-shadow: none;
}

.fmt-arquivo__textos {
    display: grid;
    min-width: 0;
}

.fmt-arquivo__acao {
    color: var(--fmt-azul);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
}

.fmt-arquivo__nome {
    overflow: hidden;
    color: var(--fmt-suave);
    font-size: 14px;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmt-arquivo.tem-arquivo .fmt-arquivo__alvo {
    border-style: solid;
    border-color: var(--fmt-azul);
    background: var(--fmt-gelo);
}

.fmt-arquivo.is-arrastando .fmt-arquivo__alvo {
    border-color: var(--fmt-azul);
    background: var(--fmt-gelo);
}

.fmt-arquivo input:focus-visible + .fmt-arquivo__alvo {
    outline: 2px solid var(--fmt-azul);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .fmt-arquivo__alvo:hover {
        border-color: var(--fmt-azul);
        background: var(--fmt-gelo);
    }
}

.fmt-sub.tem-erro .fmt-arquivo__alvo {
    border-color: var(--fmt-erro);
    background: var(--fmt-erro-fundo);
}

/* O erro de envio (rede, servidor): no pé do formulário, antes da barra. */
.fmt-erro--envio {
    margin: 0 !important;
}

/* --------------------------------------------------------------------------
   DEPOIS DE ENVIAR
   O resumo usa o desenho da confirmação do template.css. O que muda: não há
   ##edit## do Moodle; quem quer mudar responde de novo.
   -------------------------------------------------------------------------- */
.fmt-pronto__refazer {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 11px 23px;
    border: 1px solid var(--fmt-azul);
    border-radius: 999px;
    background: #fff;
    color: var(--fmt-azul);
    font-weight: 700;
    line-height: 24px;
    text-decoration: none;
}

.fmt-pronto__refazer:focus-visible {
    outline: 2px solid var(--fmt-azul);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .fmt-pronto__refazer:hover {
        background: var(--fmt-gelo);
        color: var(--fmt-azul-forte);
    }
}

.fmt-pronto__titulo:focus {
    outline: 0;
}

/* --------------------------------------------------------------------------
   Conferência de e-mail e WhatsApp: o erro diz o que está errado e, quando
   dá para adivinhar o certo, traz o botão do conserto. O aviso (azul) não
   bloqueia: domínio parecido com um conhecido, número fixo.
   -------------------------------------------------------------------------- */
.fmt-erro.tem-conserto,
.fmt-dica {
    flex-wrap: wrap;
}

.fmt-msg__texto {
    flex: 1 1 200px;
}

.fmt-dica {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--fmt-gelo);
    color: var(--fmt-tinta);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
}

.fmt-dica[hidden] {
    display: none;
}

.fmt-dica::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%230050A8'/%3E%3Cpath d='M8 7.25v4' stroke='%23fff' stroke-width='1.75' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.75' r='1' fill='%23fff'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.fmt-conserto {
    min-height: 32px;
    padding: 3px 15px;
    border: 1px solid var(--fmt-azul);
    border-radius: 999px;
    background: #fff;
    color: var(--fmt-azul);
    font: inherit;
    font-weight: 700;
    line-height: 24px;
    cursor: pointer;
    overflow-wrap: anywhere;
    text-align: left;
    transition: background-color .16s var(--fmt-ease), transform .16s var(--fmt-ease);
}

.fmt-conserto:active {
    transform: scale(.97);
}

.fmt-conserto:focus-visible {
    outline: 2px solid var(--fmt-azul);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .fmt-conserto:hover {
        background: var(--fmt-gelo);
        color: var(--fmt-azul-forte);
    }
}

@media (max-width: 575.98px) {
    .fmt-conserto {
        min-height: 40px;
        padding: 7px 15px;
    }
}

/* Quando é a cerimônia: o capelo, mesmo traço dos ícones de prazo e tempo
   do template.css (que fica intocado). */
.fmt-fato--cerimonia::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230050A8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 6 8 3l6.5 3L8 9z'/%3E%3Cpath d='M4.25 7.75v3c0 1 1.7 2 3.75 2s3.75-1 3.75-2v-3M14.5 6v3.5'/%3E%3C/svg%3E");
}

/* O nome da turma de formandos: segunda linha do título, um degrau abaixo.
   O título inteiro em 32px passava de três linhas. */
.fmt-nome-turma {
    margin: 8px 0 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
}

@media (max-width: 767.98px) {
    .fmt-nome-turma {
        font-size: 18px;
        line-height: 24px;
    }
}

/* A homenageada da turma ao lado do título, em 1:1. No celular ela sobe
   para cima do título: ao lado, o título de 24px ia para quatro linhas. */
/* Pé da foto na mesma linha do pé do nome da turma (pedido do Marcelo). */
.fmt-heroi {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.fmt-heroi__foto {
    flex: none;
    width: 144px;
    height: 144px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .24), 0 8px 24px rgba(4, 20, 48, .32);
}

@media (max-width: 767.98px) {
    /* Ordem no celular: #FORMATURAFAT, foto, título. A hashtag é o ::before
       do .page-context-header (template.css); com display: contents ela
       vira irmã da foto e entra na fila por order. */
    .fmt-heroi {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        margin-top: 16px;
    }

    body:is(#page-mod-data-edit, #page-mod-data-view) #page-header .fmt-heroi .page-context-header {
        display: contents;
    }

    body:is(#page-mod-data-edit, #page-mod-data-view) #page-header .fmt-heroi .page-context-header::before {
        order: -1;
    }

    .fmt-heroi__foto {
        width: 96px;
        height: 96px;
        margin: 8px 0 16px;
        border-radius: 12px;
    }
}

/* Segunda linha do cartão "Sim" da outorga, no padrão das outras duas
   (template.css, linhas 683–684). */
.fmt-simnao[data-fmt-campo="outorga"] input[value="Sim"] + label::after { content: "Quero receber o capelo"; }
