:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --secondary: #7C3AED;
    --primary-soft: rgba(37, 99, 235, 0.08);
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-soft: #E5E7EB;
    --border-soft-2: #F3F4F6;
    --card-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --card-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.14);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
}

/* ---------- hero / topo ---------- */

.hero-wrap {
    padding: 2.5rem 0 1rem;
}

.hero-card {
    border: none;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--card-shadow);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: "";
    position: absolute;
    left: -60px;
    bottom: -70px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero-card .card-body {
    position: relative;
    z-index: 1;
}

.hero-logo-wrap {
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 28px;
    padding: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.hero-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.hero-card h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.75rem;
}

.hero-card .hero-msg {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.02rem;
    margin-bottom: 0;
    max-width: 720px;
}

/* Tipografia da mensagem de boas-vindas do admin (HTML) dentro do hero: sem isto,
   <h2>/<h3> do conteúdo saem com o tamanho gigante padrão do browser e competem
   com o título principal. Aqui eles viram um intro caloroso e integrado. */
.hero-card .hero-msg h1,
.hero-card .hero-msg h2,
.hero-card .hero-msg h3,
.hero-card .hero-msg h4,
.hero-card .hero-msg h5 {
    color: #fff;
    line-height: 1.3;
    letter-spacing: -0.2px;
    margin: 0.4rem 0 0.15rem;
}
.hero-card .hero-msg h1,
.hero-card .hero-msg h2 { font-size: 1.28rem; font-weight: 700; }
.hero-card .hero-msg h3 { font-size: 1.06rem; font-weight: 600; }
.hero-card .hero-msg h4,
.hero-card .hero-msg h5 { font-size: 1rem; font-weight: 600; }
.hero-card .hero-msg p { margin: 0 0 0.4rem; }
.hero-card .hero-msg strong { font-weight: 800; }
.hero-card .hero-msg ul,
.hero-card .hero-msg ol { margin: 0 0 0.4rem; padding-left: 1.2rem; }
.hero-card .hero-msg a { color: #fff; text-decoration: underline; }
.hero-card .hero-msg > :first-child { margin-top: 0; }
.hero-card .hero-msg > :last-child { margin-bottom: 0; }

/* ---------- seção / cards ---------- */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
    width: 100%;
}

.section-title {
    color: var(--text-main);
    font-size: 1.75rem;
    font-weight: 800;
    margin: 1.5rem 0 0.25rem;
    letter-spacing: -0.4px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.concursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.concurso-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-soft);
}

.concurso-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}

/* A arte do banner é um CARTAZ, e cartaz de escola nasce quadrado — as artes
   em uso são todas 1:1 (1080x1080 e afins), formato de post de rede social.
   A moldura era 16:9 com `object-fit: cover`, o que recortava 43,75% da
   ALTURA: sumiam o nome do concurso no topo e o logo da escola no rodapé,
   justamente as duas coisas que o cartaz existe para dizer.

   Agora a moldura é 4:3 e a arte entra INTEIRA (`contain`). A proporção é um
   meio-termo deliberado: a arte quadrada ocupa 75% da largura (contra 56% em
   16:9, onde o texto do cartaz vira letra miúda) sem esticar o cartão tanto
   quanto uma moldura 1:1 esticaria. O que sobra nas laterais é preenchido
   pelo ::before abaixo, e não por barra chapada. */
.concurso-banner {
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* O preenchimento da sobra: a PRÓPRIA arte, ampliada e desfocada, cobrindo a
   moldura toda por baixo. É o que torna a moldura fixa indiferente ao formato
   que a escola subir — quadrada, deitada ou em pé, a arte aparece inteira e a
   sobra continua parecendo parte do cartaz.

   A URL chega por `--banner`, escrita no atributo style de cada cartão pelo
   template (concurso_inscricao.html e concurso_inscricao_interno.html), porque
   ela varia por concurso e CSS não tem como descobri-la sozinho. Sem a
   variável, `background-image` fica inválido e some sozinho: o cartão cai no
   gradiente, que é exatamente o desejado quando não há banner. */
.concurso-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--banner);
    background-size: cover;
    background-position: center;
    filter: blur(18px) saturate(1.2) brightness(0.8);
    /* O blur deixa a borda do elemento transparente; a ampliação empurra essa
       borda para fora da moldura, senão aparece uma moldura clara em volta. */
    transform: scale(1.15);
}

.concurso-banner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

.concurso-banner.no-image::after {
    content: "\f559";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: rgba(255, 255, 255, 0.85);
    font-size: 3rem;
    /* Acima do ::before: quando a imagem falha, o desfoque não renderiza nada
       (a URL é a mesma que falhou), mas o ícone não pode depender disso. */
    z-index: 2;
}

.concurso-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.concurso-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.concurso-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.concurso-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: var(--text-main);
}

.concurso-info-item i {
    color: var(--primary);
    width: 18px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 0.4rem;
    margin-bottom: 0.5rem;
}

.status-aberto {
    background: var(--success-soft);
    color: #047857;
}

.status-fechado {
    background: var(--danger-soft);
    color: #B91C1C;
}

.status-resultado {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.concurso-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
}

.btn-custom {
    flex: 1;
    min-width: 80px;
    padding: 0.6rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-inscrever {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-inscrever:hover:not(:disabled):not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    color: white;
}

.btn-inscrever:disabled,
.btn-inscrever.disabled {
    background: #D1D5DB;
    color: #6B7280;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-info {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-info:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.no-concursos {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-soft);
    color: var(--text-muted);
}

.no-concursos i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    display: block;
}

.no-concursos h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* ---------- modais ---------- */

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.16);
    overflow: hidden;
    background: #fff;
}

.modal-header {
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid var(--border-soft);
    padding: 1.25rem 1.5rem;
    align-items: flex-start;
    color: var(--text-main);
}

.modal-header .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.modal-header .btn-close {
    filter: none;
    opacity: 0.6;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-main);
}

.modal-body .form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
}

.modal-body .form-label .required-mark,
.modal-body .form-label[for]::after {
    color: var(--danger);
}

.modal-body .form-control,
.modal-body .form-select {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fff;
    color: var(--text-main);
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-body h6 {
    color: var(--primary);
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--primary-soft);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.modal-body h6:first-child {
    margin-top: 0;
}

.modal-footer {
    background: #FAFBFD;
    border-top: 1px solid var(--border-soft);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

.modal-footer .btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all 0.22s ease;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.modal-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.modal-footer .btn-secondary {
    background: var(--border-soft);
    border: none;
    color: var(--text-main);
}

.modal-footer .btn-secondary:hover {
    background: #D1D5DB;
}

.modal .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    color: #fff;
}

.modal .btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border: none;
    color: #fff;
}

.modal .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    color: #fff;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.g-recaptcha {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--border-soft-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.recaptcha-feedback {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ---------- form submit dentro do modal de inscrição ---------- */

#inscricaoForm button[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
    color: #fff !important;
    padding: 0.85rem !important;
    font-size: 0.98rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 1rem !important;
    transition: all 0.22s ease !important;
}

#inscricaoForm button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3) !important;
}

/* ---------- footer (mesmo do base.html) ---------- */

.footer {
    background-color: transparent;
    color: #000000;
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-soft);
    box-shadow: none;
    /* Era `width: 100vw; margin-left: calc(-50vw + 50%)` — o truque de full
       bleed, para um elemento escapar de um container estreito. O pai daqui é
       o BODY, que já tem a largura inteira: o truque nunca foi necessário e
       cobrava rolagem lateral em toda a página. `100vw` INCLUI a barra de
       rolagem (medido: 2000 num viewport de 1992), e a margem negativa jogava
       o rodapé 4px para fora de cada lado.

       O base.css consertou isso em 4f3f899 e limpou todas as telas de dentro.
       Estas páginas de inscrição são STANDALONE — não herdam o base.css, e por
       isso repetiam a regra antiga sob o comentário "mesmo do base.html". São
       justamente as que as famílias abrem. */
    width: 100%;
    box-sizing: border-box;
    font-size: 0.875rem;
    font-weight: 600;
    position: relative;
    z-index: 998;
    margin-top: auto;
}

.footer p {
    margin: 0;
    font-weight: 500;
    opacity: 0.95;
}

.footer a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

.footer a:hover {
    color: var(--primary);
}

.footer .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.footer-link:hover i {
    transform: scale(1.2);
}

/* ---------- responsivo ---------- */

@media (max-width: 992px) {
    .hero-logo-wrap {
        width: 180px;
        height: 180px;
        margin-top: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-wrap {
        padding: 1.5rem 0 0.5rem;
    }
    .hero-card .card-body {
        padding: 1.75rem !important;
    }
    .hero-card h1 {
        font-size: 1.6rem;
    }
    .section-title {
        font-size: 1.4rem;
    }
    .concursos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .concurso-banner {
        aspect-ratio: 4 / 3;
    }
    .btn-custom {
        font-size: 0.8rem;
        padding: 0.55rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .hero-card h1 {
        font-size: 1.4rem;
    }
    .concurso-title {
        font-size: 1rem;
    }
    .btn-custom {
        font-size: 0.78rem;
        padding: 0.5rem;
        min-width: 60px;
        gap: 0.25rem;
    }
}
