/* ==========================================================================
   CME-PMRR — Inscricao Online
   Identidade visual compartilhada com o Portal do Aluno (portal5-9).
   ========================================================================== */
:root {
    --navy: #0a1b3d;
    --navy-2: #10285a;
    --gold: #d8a72a;
    --gold-soft: #e6bd4f;
    --gold-deep: #b8860b;
    --garnet: #8c2333;
    --garnet-deep: #6d1423;
    --garnet-light: #cf7683;
    --ink: #1f2a44;
    --muted: #6b7280;
    --line: #e6e8ee;
    --bg: #eef1f6;
    --card: #ffffff;
    --danger: #d33a3a;
    --danger-soft: #fdecec;
    --ok: #1f8a52;
    --radius: 14px;
    --shadow: 0 12px 30px rgba(15, 25, 55, 0.08);
    --shadow-sm: 0 8px 22px rgba(15, 25, 55, 0.06);
}

* { box-sizing: border-box; }

/* A coluna flex + o "margin-top: auto" do rodape mantem o footer colado na base da janela
   nas telas curtas (logins, avisos), sem descolar do conteudo nas telas longas. */
body {
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    font-size: 16.5px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; }

/* ===== Topbar ===== */
.topbar {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
}
.topbar .wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 88px;
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.brand img { height: 54px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.brand .brand-txt strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: .5px; line-height: 1; }
.brand .brand-txt span { display: block; font-size: 10.5px; letter-spacing: 1.6px; color: #c7d0e4; margin-top: 5px; text-transform: uppercase; }

.topnav { display: flex; align-items: center; gap: 28px; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; color: #d7deee; font-weight: 600; padding: 6px 2px; position: relative; transition: color .2s; }
.topnav a:hover { color: #fff; }
.topnav a.active { color: #fff; }
.topnav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 3px; border-radius: 3px; background: var(--garnet-light); }

.btn-candidato {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--garnet-light); color: var(--garnet-light);
    background: transparent; font-weight: 700; font-size: 15px;
    padding: 9px 16px; border-radius: 10px; transition: all .2s;
}
.btn-candidato:hover { background: var(--garnet); color: #fff; border-color: var(--garnet); }

.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }

/* ===== Shell ===== */
.shell { max-width: 1600px; margin: 0 auto; padding: 0 28px; }

/* ===== Hero ===== */
.ins-hero {
    background: linear-gradient(115deg, var(--navy) 0%, var(--navy-2) 60%, #16386f 100%);
    position: relative;
    overflow: hidden;
    color: #fff;
}
.ins-hero::before {
    content: "";
    position: absolute;
    top: 0; left: calc(50% - 560px); bottom: 0;
    width: 46px;
    background: var(--garnet-deep);
    transform: skewX(-18deg);
    opacity: .95;
}
.ins-hero .wrap {
    /* O padding esquerdo maior afasta o texto da faixa grena, que fica alinhada ao inicio do container. */
    max-width: 1160px; margin: 0 auto; padding: 14px 20px 16px 110px;
    display: flex; align-items: center; gap: 28px; position: relative; z-index: 1;
}
.ins-emblem {
    flex: 0 0 132px; width: 132px; height: 132px; border-radius: 50%;
    display: grid; place-items: center;
    background: radial-gradient(circle at 50% 40%, #16386f, var(--navy));
    border: 3px solid var(--garnet);
    box-shadow: 0 0 0 6px rgba(140,35,51,.25), inset 0 0 30px rgba(0,0,0,.4);
}
.ins-emblem i { font-size: 54px; color: var(--garnet-light); }
.ins-hero-text { min-width: 0; }
.ins-hero-text h1 { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; }
.ins-hero-sub { color: var(--garnet-light); font-weight: 700; font-size: 16px; margin-top: 5px; }
.ins-hero-desc { color: #c3cbdd; font-size: 14.5px; margin-top: 5px; line-height: 1.5; max-width: 640px; }

/* ===== Stepper ===== */
.ins-stepper-wrap {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 26px;
    margin: -26px auto 24px;
    position: relative; z-index: 2;
}
.ins-stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.ins-step { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
.ins-step-btn {
    display: flex; align-items: center; gap: 12px;
    background: none; border: 0; cursor: pointer; padding: 0; text-align: left; min-width: 0;
}
.ins-step-num {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px;
    background: #eef1f6; color: var(--muted);
    border: 2px solid var(--line);
    transition: all .25s;
}
.ins-step-info { min-width: 0; }
.ins-step-info strong { display: block; font-size: 15.5px; font-weight: 700; color: var(--muted); line-height: 1.15; white-space: nowrap; }
.ins-step-info span { display: block; font-size: 13px; color: #9aa2b4; font-weight: 600; margin-top: 2px; }
.ins-step-line { flex: 1 1 auto; height: 2px; margin: 0 10px; border-top: 2px dashed var(--line); min-width: 12px; }
.ins-step:last-child { flex: 0 0 auto; }
.ins-step:last-child .ins-step-line { display: none; }

.ins-step.is-active .ins-step-num { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 16px rgba(10,27,61,.35); }
.ins-step.is-active .ins-step-info strong { color: var(--navy); }
.ins-step.is-active .ins-step-info span { color: var(--gold-deep); }
.ins-step.is-done .ins-step-num { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.ins-step.is-done .ins-step-info strong { color: var(--ink); }
.ins-step.is-done .ins-step-info span { color: var(--ok); }
.ins-step.has-error .ins-step-num { background: var(--danger); color: #fff; border-color: var(--danger); }
.ins-step.has-error .ins-step-info strong { color: var(--danger); }
.ins-step.has-error .ins-step-info span { color: var(--danger); }

/* ===== Layout grid ===== */
.ins-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 30px; align-items: start; padding-bottom: 40px; }

/* ===== Main form card ===== */
.ins-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 38px 44px; }
.ins-card .row.g-3 { --bs-gutter-x: 1.6rem; --bs-gutter-y: 1.35rem; }

.form-step { display: none; }
.form-step.is-active { display: block; animation: fadeUp .28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 21px; font-weight: 800; color: var(--navy);
    margin: 0 0 10px;
}
.section-title i { color: var(--gold-deep); font-size: 20px; }
/* O .row do Bootstrap tem margem negativa no topo que "cola" os campos no titulo; anula-se aqui. */
.section-title + .row, .section-hint + .row { margin-top: 0; }
/* Separacao padrao entre secoes, igual em todos os formularios (inscricao, isencao e edicao). */
.form-step .section-title:not(:first-child),
.ins-card > .section-title:not(:first-child) { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-hint { margin: -4px 0 14px; color: var(--muted); font-size: 14.5px; }

/* ===== Fields ===== */
form.ins-card .row.g-3 > [class*="col-"] { display: flex; flex-direction: column; }
.ins-card .form-label {
    min-height: 42px; display: flex; align-items: flex-end;
    font-weight: 700; font-size: 16px; line-height: 1.25; color: var(--ink); margin-bottom: 8px;
}
.ins-card .form-control,
.ins-card .form-select {
    border: 1px solid #d3d9e4; border-radius: 11px; min-height: 54px;
    padding: 14px 16px; font-size: 17px; color: var(--ink); background-color: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.ins-card .form-control::placeholder { color: #aab2c2; }
.ins-card .form-control:focus,
.ins-card .form-select:focus {
    border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(16,40,90,.14); outline: 0;
}
.ins-card textarea.form-control { min-height: 110px; resize: vertical; }
/* Upload: o botao nativo e largo demais e empurra o "Nenhum arquivo escolhido" para fora
   do campo. Botao compacto + texto menor mantem os dois legiveis na largura da coluna. */
.ins-card input[type="file"].form-control {
    padding: 10px 14px; line-height: 30px; font-size: 14px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ins-card input[type="file"].form-control::file-selector-button {
    height: 32px; margin: 0 12px 0 0; padding: 0 14px;
    border: 1px solid #d3d9e4; border-radius: 8px;
    background: #eef1f6; color: var(--navy);
    font-size: 13.5px; font-weight: 700; line-height: 30px; cursor: pointer;
    transition: background .18s, border-color .18s;
}
.ins-card input[type="file"].form-control::file-selector-button:hover {
    background: #e3e8f1; border-color: var(--navy-2);
}

.text-danger.small { margin-top: 5px; font-size: 13.5px; font-weight: 600; color: var(--danger) !important; }

.form-check { padding-left: 2rem; }
.ins-card .form-check-input { width: 1.15em; height: 1.15em; border-color: #c2cad8; margin-top: .15em; }
.ins-card .form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.ins-card .form-check-input:focus { box-shadow: 0 0 0 3px rgba(16,40,90,.14); }
.ins-card .form-check-label { font-size: 14.5px; color: var(--ink); }
.terms-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: #f7f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.link-edital { display: inline-flex; align-items: center; gap: 6px; color: var(--navy-2); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.link-edital:hover { color: var(--gold-deep); }

/* ===== Sidebar ===== */
.ins-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 18px; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; }
.side-card h3 { font-size: 17.5px; font-weight: 800; color: var(--navy); margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.side-card h3 i { color: var(--gold-deep); }

.resumo-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.resumo-row:last-child { border-bottom: 0; }
.resumo-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #e8edf7; color: var(--navy); font-size: 15px; }
.resumo-lbl { flex: 1; font-size: 14px; color: var(--muted); font-weight: 600; }
.resumo-val { font-size: 14.5px; font-weight: 700; color: var(--ink); text-align: right; }
.pill { font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.pill.gold { background: #fbf1d8; color: var(--gold-deep); }

.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li { position: relative; padding: 8px 0 8px 22px; font-size: 14.5px; color: var(--ink); }
.docs-list li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.doc-note { display: flex; gap: 10px; margin-top: 14px; background: #eef3fb; border: 1px solid #d8e2f2; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; color: #3a4a66; line-height: 1.5; }
.doc-note i { color: var(--navy-2); font-size: 16px; margin-top: 1px; }
.doc-note b { color: var(--navy); }

/* ===== Action bar ===== */
.ins-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
}
.ins-actions .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-status { font-size: 14px; font-weight: 700; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 11px; font-weight: 700; font-size: 16px; padding: 14px 26px; cursor: pointer; transition: filter .15s, transform .12s, background .2s, color .2s; }
.btn:active { transform: translateY(1px); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { filter: brightness(1.04); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid #d3d9e4; }
.btn-ghost:hover { background: #f4f6fa; }

/* ===== Footer ===== */
.ins-footer { background: var(--card); border-top: 3px solid var(--gold); margin-top: auto; }
.ins-footer .wrap { max-width: 1160px; margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { height: 42px; }
.foot-brand strong { display: block; font-size: 17px; font-weight: 800; color: var(--navy); line-height: 1; }
.foot-brand span { display: block; font-size: 9.5px; letter-spacing: 1.4px; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.foot-motto { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 13.5px; }
.foot-motto i { color: var(--navy-2); font-size: 11px; }
.foot-info { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ===== Alerts (mensagens) ===== */
.alert-danger { background: var(--danger-soft); border: 1px solid #f3c6c6; color: #a12727; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.alert-danger ul { margin: 0; padding-left: 18px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Responsive ===== */

/* Desktop menor: fluidiza a largura */
@media (max-width: 1660px) {
    .shell { max-width: 100%; }
}

/* Empilha a sidebar abaixo do formulario */
@media (max-width: 1120px) {
    .ins-grid { grid-template-columns: 1fr; }
    .ins-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .ins-side .side-card { flex: 1 1 320px; }
}

/* Tablet: esconde a navegacao do topo (marca + botao permanecem) */
@media (max-width: 992px) {
    .topnav { display: none; }
    .ins-stepper { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
    .ins-stepper::-webkit-scrollbar { display: none; }
    .ins-step { flex: 0 0 auto; }
    .ins-step-line { min-width: 26px; }
    .ins-step-info span { display: none; }

    .ins-card .row.g-3 > [class*="col-md-"] {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }
    .ins-card .row.g-3 > .col-md-6,
    .ins-card .row.g-3 > .col-md-8,
    .ins-card .row.g-3 > .col-md-12 {
        flex-basis: 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* Tablet retrato e abaixo */
@media (max-width: 860px) {
    .ins-card { padding: 30px 26px; }
    .ins-card .row.g-3 { --bs-gutter-x: 1.25rem; }
    .ins-step-info strong { font-size: 14px; }
}

/* Mobile */
@media (max-width: 768px) {
    .topbar .wrap { min-height: 66px; gap: 12px; }
    .brand img { height: 44px; }
    .brand .brand-txt strong { font-size: 20px; }
    .brand .brand-txt span { display: none; }
    .btn-candidato { padding: 9px 12px; }
    .btn-candidato span { display: none; }

    .ins-hero .wrap { flex-direction: column; text-align: center; gap: 18px; padding: 24px 16px 28px; }
    .ins-hero::before, .ins-hero::after { display: none; }
    .ins-emblem { flex-basis: 92px; width: 92px; height: 92px; }
    .ins-emblem i { font-size: 38px; }
    .ins-hero-text h1 { font-size: 25px; }
    .ins-hero-sub { font-size: 15px; }
    .ins-hero-desc { font-size: 13.5px; }

    .shell { padding: 0 14px; }
    .ins-stepper-wrap { padding: 16px 12px; margin-top: -20px; }
    .ins-step-info span { display: none; }
    .ins-step-info strong { display: block; font-size: 12.5px; white-space: nowrap; }

    .ins-card { padding: 22px 16px; }
    .section-title { font-size: 18px; }
    .section-title i { font-size: 17px; }
    /* 16px no input evita o zoom automatico do iOS */
    .ins-card .form-control, .ins-card .form-select { font-size: 16px; min-height: 52px; }
    .ins-card .form-label { min-height: 0; display: block; }
    .ins-card .row.g-3 > [class*="col-md-"] {
        flex-basis: 100%;
        max-width: 100%;
        width: 100%;
    }

    .ins-side { flex-direction: column; }
    .ins-side .side-card { flex: 1 1 auto; }

    .ins-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-top: 22px; }
    .ins-actions .right { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
    .ins-actions .btn { width: 100%; justify-content: center; padding: 15px; }
    .step-status { text-align: center; }

    .terms-box { flex-direction: column; align-items: flex-start; }
    .ins-footer .wrap { flex-direction: column; text-align: center; gap: 14px; }
    .foot-brand { flex-direction: column; text-align: center; gap: 8px; }
    .foot-info { text-align: center; }
}

/* Celulares pequenos */
@media (max-width: 420px) {
    .brand .brand-txt strong { font-size: 18px; }
    .ins-hero-text h1 { font-size: 22px; }
    .section-title { font-size: 17px; }
    .ins-step-num { flex-basis: 34px; width: 34px; height: 34px; font-size: 13px; }
    .ins-step-info strong { font-size: 12px; }
    .ins-card { padding: 20px 13px; }
    /* Sem quebra tambem no celular: encolhe a fonte em vez de partir a frase. */
    .auth-sub.auth-sub-inline { font-size: 12px; }
}

/* ==========================================================================
   Pagamento / Comprovante / Admin
   ========================================================================== */
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding: 24px 0 40px; }
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pay-valor { text-align: right; }
.pay-valor span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.pay-valor strong { font-size: 26px; color: var(--navy); font-weight: 800; }
.pay-subtitle { font-weight: 800; color: var(--navy); font-size: 17.5px; margin: 8px 0 14px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-method { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .18s, transform .12s, box-shadow .18s; }
.pay-method:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow); }
.pay-method i { font-size: 36px; color: var(--navy); }
.pay-method strong { font-size: 17px; color: var(--ink); }
.pay-method span { font-size: 13.5px; color: var(--muted); }

.pay-status.pay-ok { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #e7f6ee; border: 1px solid #b6e2c8; border-radius: 12px; padding: 18px 20px; }
.pay-ok > i { font-size: 34px; color: var(--ok); }
.pay-ok strong { color: var(--navy); font-size: 16px; }
.pay-ok p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.pay-ok .btn { margin-left: auto; }

.pay-waiting { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--gold-deep); background: #fbf1d8; border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; }
.spinner { width: 16px; height: 16px; border: 3px solid rgba(0,0,0,.15); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.pix-qr { text-align: center; margin: 8px 0; }
.pix-qr img { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.pay-hint { color: var(--muted); font-size: 14.5px; margin: 10px 0; }
.copy-row { display: flex; gap: 10px; margin: 10px 0; }
.copy-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; background: #f7f8fb; font-family: ui-monospace, "Courier New", monospace; color: var(--ink); }
.pay-venc { color: var(--muted); font-size: 14px; margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.pay-switch { margin-top: 18px; }
.pay-actions { margin: 12px 0; }

/* Comprovante */
.comprovante { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 34px 40px; max-width: 840px; margin: 26px auto 0; }
.cmp-top { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--navy); padding-bottom: 16px; }
.cmp-top img { height: 58px; }
.cmp-title strong { display: block; color: var(--navy); font-weight: 800; font-size: 18px; }
.cmp-title span { font-size: 13.5px; color: var(--muted); }
.cmp-selo { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; background: #e7f6ee; color: var(--ok); font-weight: 800; padding: 8px 16px; border-radius: 999px; }
.cmp-h1 { font-size: 25px; color: var(--navy); margin-top: 22px; font-weight: 800; }
.cmp-sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; margin: 24px 0; }
.cmp-grid div { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cmp-grid span { display: block; font-size: 13px; color: var(--muted); }
.cmp-grid strong { font-size: 16px; color: var(--ink); }
.cmp-auth { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #f7f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.cmp-auth span { display: block; font-size: 13px; color: var(--muted); }
.cmp-auth strong { font-family: ui-monospace, "Courier New", monospace; color: var(--navy); font-size: 16px; }
.cmp-doc { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.cmp-doc.ok { color: var(--ok); }
.cmp-doc.pend { color: var(--gold-deep); }
.cmp-emissao { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.cmp-actions { display: flex; justify-content: center; gap: 12px; margin: 22px 0 40px; }

/* Admin */
.admin-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-bar a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--navy); background: #fff; border: 1px solid var(--line); transition: all .18s; }
.admin-bar a:hover { border-color: var(--navy); }
.admin-bar a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.table-scroll { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.adm-table thead th { background: #f7f8fb; text-align: left; text-transform: uppercase; font-size: 12.5px; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 12px; border-bottom: 1px solid var(--line); }
.adm-table tbody td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink); }
.adm-table tbody tr:hover { background: #f9fafc; }
.adm-table .empty { text-align: center; color: var(--muted); padding: 22px; }
.adm-actions { display: flex; gap: 8px; white-space: nowrap; }

.btn-sm { padding: 8px 14px; font-size: 14px; }
.pill.ok { background: #e7f6ee; color: var(--ok); }
.pill.wait { background: #fbf1d8; color: var(--gold-deep); }
.pill.pend { background: #eef1f6; color: var(--muted); }
.pill.err { background: #fdeaea; color: #a33a3a; }
.alert-ok { background: #e7f6ee; border: 1px solid #b6e2c8; color: #1f6b45; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.doc-status { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 12px 14px; border-radius: 10px; margin: 8px 0; }
.doc-status.ok { background: #e7f6ee; color: var(--ok); }
.doc-status.pend { background: #fbf1d8; color: var(--gold-deep); }
.checklist-form .form-label { font-size: 14px; }
.anexos { list-style: none; margin: 0; padding: 0; }
.anexos li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.anexos li:last-child { border-bottom: 0; }

@media (max-width: 1120px) {
    .pay-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .pay-methods { grid-template-columns: 1fr; }
    .cmp-grid { grid-template-columns: 1fr; }
    .comprovante { padding: 22px 18px; }
    .pay-ok .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* Impressao do comprovante */
@media print {
    .topbar, .ins-footer, .admin-bar, .cmp-actions, .pay-switch { display: none !important; }
    body { background: #fff; }
    .comprovante { box-shadow: none; border: none; margin: 0; max-width: 100%; }
}

/* ==========================================================================
   Login / Areas
   ========================================================================== */
.auth-wrap { display: flex; justify-content: center; padding: 48px 0; }
.auth-card { max-width: 420px; width: 100%; text-align: center; }
/* Cartao mais largo para o subtitulo do admin caber em uma linha so. */
.auth-card.auth-card-wide { max-width: 520px; }
.auth-sub.auth-sub-inline { white-space: nowrap; }
.auth-emblem { width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--gold); overflow: hidden; }
.auth-emblem img { height: 60px; }
.auth-title { font-size: 22px; font-weight: 800; color: var(--navy); }
.auth-sub { color: var(--muted); font-size: 14.5px; margin: 6px 0 18px; line-height: 1.5; }
.auth-form { text-align: left; }
.auth-alt { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-alt a { color: var(--navy-2); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.auth-alt a:hover { color: var(--gold-deep); }
.admin-bar .spacer { flex: 1 1 auto; }
.admin-bar form { margin: 0; }
.adm-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-search .form-control { min-height: 44px; width: 280px; max-width: 100%; border: 1px solid #d3d9e4; border-radius: 10px; padding: 8px 12px; font-size: 15px; }

/* Paginacao das listas administrativas */
.adm-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.adm-pager:empty { display: none; }
.adm-pager .adm-pager-info { color: var(--muted); font-size: 14px; }
.adm-pager .adm-pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* .pg: paginas navegaveis sao <a> (funcionam sem JS); a atual e as setas inativas sao <span>. */
.adm-pager .pg { min-width: 40px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d3d9e4; border-radius: 9px; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.adm-pager a.pg:hover { background: #f4f6fa; }
.adm-pager .pg.active { background: var(--navy); color: #fff; border-color: var(--navy); cursor: default; }
.adm-pager .pg.disabled { opacity: .45; cursor: default; }
.adm-pager .adm-pager-ellipsis { color: var(--muted); padding: 0 2px; }
/* Enquanto o fragmento da lista e recarregado (busca/troca de pagina). */
.adm-resultado.carregando { opacity: .55; pointer-events: none; transition: opacity .1s linear; }

/* Modo de edicao dos candidatos (configuracao) */
.edit-modo { display: flex; flex-direction: column; gap: 10px; }
.edit-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; margin: 0; }
.edit-opt:hover { border-color: #c7cede; background: #fafbfd; }
.edit-opt input[type="radio"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--navy); flex: 0 0 auto; cursor: pointer; }
.edit-opt-body { display: flex; flex-direction: column; gap: 3px; }
.edit-opt-title { font-weight: 800; font-size: 15.5px; color: var(--navy); display: inline-flex; align-items: center; gap: 8px; }
.edit-opt-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.edit-opt:has(input:checked) { border-color: var(--navy); background: #f2f5fb; box-shadow: 0 0 0 2px rgba(10,27,61,.10); }

/* Alerta de edicao pendente de revisao (candidato editou apos a analise) */
.edit-detalhes { position: relative; overflow: visible; }
.edit-detalhes.has-alert { border-color: #ff8c1a; }
.edit-alert-dot {
    position: absolute; top: -5px; right: -5px; width: 12px; height: 12px;
    border-radius: 50%; background: #ff8c1a; border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(255,140,26,.6); animation: edit-alert-pulse 1.6s ease-in-out infinite;
}
@keyframes edit-alert-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,140,26,.6); }
    50% { box-shadow: 0 0 0 5px rgba(255,140,26,0); }
}
.alert-edicao {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
    padding: 12px 16px; border-radius: 10px; font-size: 14.5px; line-height: 1.5;
    background: #fff3e6; border: 1px solid #ffcf99; color: #9a4a00;
}
.alert-edicao i { color: #ff8c1a; font-size: 17px; margin-top: 1px; }
.alert-edicao strong { color: #7a3a00; }

/* Toggle "Somente editados" nas listas administrativas */
.filtro-editados { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; font-size: 14px; color: var(--navy); cursor: pointer; user-select: none; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.filtro-editados:hover { border-color: #ff8c1a; }
.filtro-editados input { position: absolute; opacity: 0; width: 0; height: 0; }
.filtro-editados-dot { width: 11px; height: 11px; border-radius: 50%; background: #ff8c1a; box-shadow: 0 0 0 1px rgba(255,140,26,.5); }
.filtro-editados:has(input:checked) { background: #fff3e6; border-color: #ff8c1a; color: #9a4a00; }
.filtro-editados:has(input:disabled) { opacity: .5; cursor: default; }
.filtro-editados:has(input:disabled):hover { border-color: var(--line); }
.filtro-editados-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ff8c1a; color: #fff; font-size: 12px; font-weight: 800; }
.filtro-editados-count:empty { display: none; }

/* Variante "Cancelados": mesma pastilha em vermelho, para nao se confundir com o filtro laranja
   de editados - sao coisas diferentes e costumam aparecer lado a lado. */
.filtro-editados.is-cancelados:hover { border-color: #c0392b; }
.filtro-editados.is-cancelados .filtro-editados-dot { background: #c0392b; box-shadow: 0 0 0 1px rgba(192,57,43,.5); }
.filtro-editados.is-cancelados:has(input:checked) { background: #fdeaea; border-color: #c0392b; color: #a12727; }
.filtro-editados.is-cancelados .filtro-editados-count { background: #c0392b; }

/* ===== Barra de filtros da listagem administrativa =====
   Grade fluida: em telas largas os filtros ficam lado a lado; apertando, quebram sozinhos
   sem estourar a largura do card. */
.adm-filtros {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px;
    align-items: end; padding: 14px 16px; margin-bottom: 16px;
    background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px;
}
.adm-filtro { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-filtro .form-label { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.adm-filtro .form-select,
.adm-filtro .form-control {
    width: 100%; min-height: 40px; border: 1px solid #d3d9e4; border-radius: 10px;
    padding: 8px 10px; font-size: 15px; background: #fff;
}
/* O botao de limpar acompanha a altura dos campos, alinhado pela base da grade. */
.adm-filtro-acao { justify-content: flex-end; }
.adm-filtro-acao .btn { justify-content: center; min-height: 40px; }

/* ===== Cancelamento de inscricao / pedido de isencao ===== */
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.doc-status.err { background: #fdeaea; color: #a12727; }
/* Linha da lista quando o registro esta cancelado: recuada, sem competir com os validos. */
.adm-table tr.linha-cancelada td { opacity: .62; }
.adm-table tr.linha-cancelada td:nth-child(2) { text-decoration: line-through; }

/* ===== Dashboard administrativo =====
   Os efeitos (profundidade, brilho, movimento) ficam no "cromo" - cards, hover, entrada.
   As fatias do grafico continuam chapadas: gradiente ou sombra sobre a marca de dado
   distorce a leitura do tamanho real. Tudo respeita prefers-reduced-motion no fim do bloco. */

/* Entrada escalonada: os blocos sobem suavemente ao abrir a tela. */
@keyframes dash-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dash-anim { opacity: 0; animation: dash-in .5s cubic-bezier(.22,.68,.36,1) forwards; }
.dash-anim:nth-child(2) { animation-delay: .07s; }
.dash-d1 { animation-delay: .10s; }
.dash-d2 { animation-delay: .18s; }

.dash-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.dash-hero-card {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; gap: 6px; padding: 24px 28px;
    border-radius: var(--radius); border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(135deg, #0f2550 0%, var(--navy) 55%, #08152f 100%);
    box-shadow: 0 18px 40px rgba(10, 27, 61, .28);
    transition: transform .35s cubic-bezier(.22,.68,.36,1), box-shadow .35s;
}
/* Halo dourado difuso no canto - dá profundidade sem competir com o numero. */
.dash-hero-card::before {
    content: ""; position: absolute; z-index: -1; top: -60%; right: -25%; width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(216,167,42,.30) 0%, rgba(216,167,42,0) 68%);
    transition: transform .5s ease, opacity .5s ease;
}
/* Brilho que atravessa o card no hover (sheen). */
.dash-hero-card::after {
    content: ""; position: absolute; z-index: -1; inset: 0; transform: translateX(-120%) skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
    transition: transform .8s cubic-bezier(.22,.68,.36,1);
}
.dash-hero-card:hover { transform: translateY(-4px); box-shadow: 0 26px 54px rgba(10, 27, 61, .36); }
.dash-hero-card:hover::before { transform: scale(1.15); opacity: .85; }
.dash-hero-card:hover::after { transform: translateX(120%) skewX(-18deg); }
.dash-hero-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gold-soft); }
.dash-hero-value { font-size: 46px; font-weight: 800; line-height: 1.1; color: #fff; letter-spacing: -.5px; }
.dash-hero-hint { font-size: 13px; color: rgba(255,255,255,.62); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
    border: 1px solid var(--line); border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
    transition: transform .28s cubic-bezier(.22,.68,.36,1), box-shadow .28s, border-color .28s;
}
/* A faixa colorida da esquerda cresce no hover, em vez de piscar. */
.kpi-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--muted); transform: scaleY(.35); transform-origin: center;
    transition: transform .32s cubic-bezier(.22,.68,.36,1);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: #d7dde8; }
.kpi-card:hover::before { transform: scaleY(1); }
.kpi-value { font-size: 30px; font-weight: 800; line-height: 1.15; color: var(--ink); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.kpi-ok::before { background: var(--ok); }
.kpi-ok .kpi-label i { color: var(--ok); }
.kpi-pend::before { background: var(--gold-deep); }
.kpi-pend .kpi-label i { color: var(--gold-deep); }
.kpi-neg::before { background: var(--danger); }
.kpi-neg .kpi-label i { color: var(--danger); }

/* Barra empilhada (parte-do-todo). O gap de 2px separa as fatias sem depender so da cor. */
.viz-bar { display: flex; gap: 2px; height: 48px; border-radius: 10px; background: #f2f4f8; }
.viz-bar:hover .viz-seg { opacity: .38; }          /* foco: destaca a fatia sob o cursor */
.viz-bar:hover .viz-seg:hover { opacity: 1; }
.viz-seg {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: var(--w); min-width: 4px; background: var(--c);
    animation: viz-grow .85s cubic-bezier(.22,.68,.36,1) both;
    transition: opacity .22s ease, filter .22s ease;
    cursor: default;
}
/* Cresce da esquerda para a direita ao carregar - a largura final vem do proprio dado. */
@keyframes viz-grow { from { width: 0; } to { width: var(--w); } }
.viz-seg:first-child { border-radius: 10px 0 0 10px; }
.viz-seg:last-child { border-radius: 0 10px 10px 0; }
.viz-seg:hover, .viz-seg:focus-visible { filter: brightness(1.08); outline: none; }
.viz-seg:focus-visible { box-shadow: 0 0 0 3px rgba(10,27,61,.35); }
.viz-seg-label { font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.30); white-space: nowrap; }

/* Tooltip: enriquece, nunca e a unica via - os mesmos valores estao na tabela abaixo. */
.viz-seg::after {
    content: attr(data-rotulo) " · " attr(data-qtd) " inscritos · " attr(data-pct);
    position: absolute; bottom: calc(100% + 10px); left: 50%; z-index: 5;
    transform: translate(-50%, 6px); opacity: 0; pointer-events: none;
    padding: 8px 12px; border-radius: 9px; white-space: nowrap;
    background: rgba(15, 25, 55, .95); color: #fff; font-size: 12.5px; font-weight: 700;
    box-shadow: 0 10px 26px rgba(15,25,55,.30);
    transition: opacity .18s ease, transform .18s ease;
}
.viz-seg:hover::after, .viz-seg:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

.viz-table { width: 100%; margin-top: 18px; border-collapse: collapse; }
.viz-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--ink); }
.viz-table tr { transition: background .18s ease; }
.viz-table tr:hover { background: #f7f9fc; }
.viz-table tr:last-child td { border-bottom: 0; }
.viz-table .viz-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.viz-table .viz-unit { font-weight: 600; font-size: 12.5px; }
.viz-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* Quem pediu menos movimento recebe a tela pronta, sem animacao nenhuma. */
@media (prefers-reduced-motion: reduce) {
    .dash-anim { opacity: 1; animation: none; }
    .viz-seg { animation: none; }
    .dash-hero-card, .kpi-card, .viz-seg, .viz-table tr { transition: none; }
    .dash-hero-card:hover, .kpi-card:hover { transform: none; }
    .dash-hero-card::after { display: none; }
}
