:root {
    --navy: #2856a1;
    --navy-dark: #183d79;
    --blue: #2856a1;
    --blue-soft: #eef7fd;
    --yellow: #dfaa27;
    --yellow-hover: #c8951b;
    --text: #25384d;
    --muted: #66788a;
    --line: #d9e4ed;
    --white: #fff;
    --danger: #a62f3c;
    --success: #18734a;
    --shadow: 0 16px 38px rgba(18, 58, 120, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: #fff; font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.admin-container { width: min(1440px, calc(100% - 40px)); margin-inline: auto; }
.public-header, .admin-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner, .admin-header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand img { display: block; }
.brand-logo { width: 190px; max-height: 62px; object-fit: contain; object-position: left center; }
.admin-header .brand-logo { width: 165px; max-height: 54px; }
.brand span { display: grid; }
.brand strong { font-size: 1rem; }
.brand small { color: var(--muted); }
.header-contact, .primary-button, .secondary-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.15rem; border: 1px solid var(--yellow); border-radius: 6px; background: var(--yellow); color: var(--navy-dark); font-weight: 700; text-decoration: none; transition: .2s ease; }
.header-contact:hover, .primary-button:hover { border-color: var(--yellow-hover); background: var(--yellow-hover); }
.primary-button:disabled { cursor: wait; opacity: .68; }
.secondary-button { border-color: var(--navy); background: var(--navy); color: #fff; }
.secondary-button:hover { background: var(--navy-dark); }
.hero-band { padding: 72px 0 92px; background: var(--navy); color: #fff; }
.hero-content { max-width: 760px; margin-inline: auto; text-align: center; }
.eyebrow { margin: 0 0 .6rem; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-band .eyebrow { color: #a9d8f5; }
.hero-band h1 { margin: 0 0 1rem; color: #fff; font-size: clamp(2.25rem, 5vw, 4.2rem); line-height: 1.05; }
.hero-band p:last-child { max-width: 650px; margin: 0 auto; color: #e6eff8; font-size: 1.08rem; }
.form-section { padding: 0 0 80px; background: linear-gradient(#f2f8fc 0 220px, #fff 220px); }
.form-layout { display: grid; grid-template-columns: minmax(240px, .62fr) minmax(0, 1.38fr); gap: 44px; align-items: start; }
.form-aside { position: sticky; top: 28px; padding-top: 48px; }
.form-aside h2 { margin: 0 0 1rem; color: var(--navy); font-size: 1.6rem; }
.form-aside ol { margin: 0; padding-left: 1.35rem; }
.form-aside li { padding: .35rem 0; }
.support-box { display: grid; gap: .35rem; margin-top: 2rem; padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.support-box strong { color: var(--navy); }
.form-card { margin-top: -36px; padding: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
fieldset { margin: 0; padding: 0 0 34px; border: 0; }
fieldset + fieldset { padding-top: 32px; border-top: 1px solid var(--line); }
legend { width: 100%; margin-bottom: 22px; color: var(--navy); font-size: 1.3rem; font-weight: 800; }
legend span { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; margin-right: .55rem; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: .9rem; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: .45rem; color: var(--navy-dark); font-size: .9rem; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; }
.field-full { grid-column: 1 / -1; }
.field-wide { grid-column: span 1; }
.field input, .field select, .field textarea, .filter-bar input, .filter-bar select { width: 100%; min-height: 46px; padding: .72rem .82rem; border: 1px solid #bccddc; border-radius: 5px; background: #fff; color: var(--text); outline: none; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 121, 189, .14); }
.was-validated :invalid { border-color: var(--danger); }
.consent-field { display: grid; grid-template-columns: 22px 1fr; gap: .75rem; align-items: start; margin: 0 0 22px; font-size: .9rem; }
.consent-field input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); }
.submit-button { width: 100%; }
.privacy-note { margin: .75rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { margin-bottom: 24px; padding: 14px 16px; border: 1px solid; border-radius: 6px; }
.alert ul { margin: .45rem 0 0; padding-left: 1.2rem; }
.alert-error { border-color: #efbac0; background: #fff2f3; color: #7d2630; }
.alert-warning { border-color: #ead694; background: #fff9e8; color: #675116; }
.alert-success { border-color: #a9ddc6; background: #eefaf5; color: #125d3c; }
.public-footer { padding: 28px 0; background: var(--navy-dark); color: #dfeafa; font-size: .88rem; text-align: center; }

.confirmation-page, .auth-page { min-height: 100vh; background: var(--blue-soft); }
.confirmation-shell, .auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.confirmation-card, .auth-card { width: min(620px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.confirmation-card h1, .auth-card h1 { margin: 0 0 .8rem; color: var(--navy); font-size: 2rem; }
.confirmation-card > p:not(.eyebrow), .auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-logo, .confirmation-logo { display: block; width: min(250px, 72%); height: auto; margin: 0 auto 24px; }
.auth-intro { max-width: 470px; margin: 0 auto; }
.auth-note { margin: 22px 0 0; padding: 14px 16px; border-radius: 6px; background: var(--blue-soft); color: var(--muted); font-size: .86rem; text-align: left; }
.auth-note strong { color: var(--navy); }
.success-mark { width: 46px; height: 46px; display: grid; place-items: center; margin: 20px auto; border-radius: 50%; background: #e8f7f0; color: var(--success); font-size: 1.5rem; font-weight: 800; }
.protocol-box { display: grid; gap: .25rem; margin: 26px 0; padding: 18px; border: 1px dashed var(--blue); border-radius: 6px; background: var(--blue-soft); }
.protocol-box span { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.protocol-box strong { color: var(--navy); font-size: 1.3rem; letter-spacing: .04em; }
.stack-form { display: grid; gap: 16px; margin-top: 24px; text-align: left; }
.auth-card .primary-button { width: 100%; }
.muted-link { display: inline-block; margin-top: 24px; color: var(--muted); font-size: .9rem; }
.password-field { position: relative; }
.password-field input { padding-right: 82px; }
.password-toggle { position: absolute; top: 31px; right: 8px; min-height: 32px; padding: 0 .65rem; border: 0; border-radius: 4px; background: var(--blue-soft); color: var(--navy); font-size: .78rem; font-weight: 700; }

.admin-page { min-height: 100vh; background: #f5f8fb; }
.admin-header { position: sticky; top: 0; z-index: 10; }
.admin-user { display: flex; align-items: center; gap: 8px; }
.admin-user span { color: var(--muted); font-size: .9rem; }
.admin-user a { padding: .5rem .65rem; border-radius: 5px; color: var(--navy); font-size: .86rem; font-weight: 700; text-decoration: none; }
.admin-user a:hover { background: var(--blue-soft); }
.admin-user .logout-link { color: #8a2d38; }
.back-link, .text-button { color: var(--navy); font-weight: 700; }
.admin-main { padding-block: 38px 70px; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-title-row h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-title-row p:last-child { margin: .35rem 0 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stat span { display: block; color: var(--muted); font-size: .82rem; }
.stat strong { display: block; margin-top: .25rem; color: var(--navy); font-size: 1.8rem; }
.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(150px, .35fr) minmax(220px, .6fr) auto auto; gap: 12px; align-items: end; margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filter-bar label { display: grid; gap: .35rem; color: var(--navy-dark); font-size: .78rem; font-weight: 700; }
.text-button { min-height: 46px; display: inline-flex; align-items: center; padding: 0 .5rem; }
.table-shell { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.leads-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.leads-table th { padding: 13px 16px; background: #edf3f8; color: var(--navy); text-align: left; white-space: nowrap; }
.leads-table td { padding: 15px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.leads-table td small { display: block; margin-top: .25rem; color: var(--muted); }
.row-action { font-weight: 700; white-space: nowrap; }
.empty-state { padding: 50px !important; color: var(--muted); text-align: center; }
.status { display: inline-flex; padding: .3rem .55rem; border-radius: 999px; background: #e9eef3; color: #445668; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.status-novo { background: #eaf4fb; color: #1d6497; }
.status-contato { background: #fff4ce; color: #715400; }
.status-confirmado, .status-matriculado { background: #e5f5ed; color: #176341; }
.status-ausente, .status-descartado { background: #f7e8ea; color: #8a2d38; }
.back-link { display: inline-block; margin-bottom: 22px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 24px; align-items: start; }
.details-stack { display: grid; gap: 18px; }
.detail-section, .management-panel { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.detail-section h2, .management-panel h2 { margin: 0 0 18px; color: var(--navy); font-size: 1.15rem; }
.detail-section p { margin: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; margin: 0; }
.detail-grid div { min-width: 0; }
.detail-grid dt { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.detail-grid dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.management-panel { position: sticky; top: 102px; }
.admin-users-layout { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
.admin-list { display: grid; }
.admin-list-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.admin-list-item:first-child { padding-top: 0; }
.admin-list-item:last-child { padding-bottom: 0; border-bottom: 0; }
.admin-list-item div { display: grid; }
.admin-list-item span, .admin-list-item small { color: var(--muted); }
.confirmation-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.confirmation-actions .primary-button, .confirmation-actions .secondary-button { min-width: 190px; }
.next-steps { margin: 26px 0 0; padding: 20px; border-radius: 8px; background: var(--blue-soft); text-align: left; }
.next-steps h2 { margin: 0 0 10px; color: var(--navy); font-size: 1rem; }
.next-steps ol { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; }
.next-steps li + li { margin-top: .4rem; }

@media (max-width: 980px) {
    .form-layout, .lead-layout, .admin-users-layout { grid-template-columns: 1fr; }
    .form-aside, .management-panel { position: static; }
    .form-aside { padding-top: 40px; }
    .form-card { margin-top: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .container, .admin-container { width: min(100% - 28px, 1160px); }
    .header-inner { min-height: 70px; }
    .header-contact { display: none; }
    .hero-band { padding: 54px 0 72px; }
    .form-section { background: linear-gradient(#f2f8fc 0 100px, #fff 100px); }
    .form-card, .confirmation-card, .auth-card { padding: 24px 18px; }
    .fields-grid, .detail-grid, .stats-grid, .filter-bar { grid-template-columns: 1fr; }
    .field-full, .filter-bar label:first-child { grid-column: auto; }
    .admin-user span { display: none; }
    .admin-header .brand-logo { width: 130px; }
    .admin-user a { padding: .45rem; font-size: .78rem; }
    .page-title-row { align-items: flex-start; flex-direction: column; }
    .secondary-button { width: 100%; }
    .table-shell { border: 0; background: transparent; overflow: visible; }
    .leads-table, .leads-table tbody, .leads-table tr, .leads-table td { display: block; width: 100%; }
    .leads-table thead { display: none; }
    .leads-table tr { margin-bottom: 14px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .leads-table td { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
    .leads-table td:first-child { border-top: 0; }
    .leads-table td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
    .leads-table td:last-child { display: block; }
    .row-action { display: block; padding: .65rem; border-radius: 5px; background: var(--blue-soft); text-align: center; }
    .confirmation-actions { flex-direction: column; }
    .confirmation-actions .primary-button, .confirmation-actions .secondary-button { width: 100%; }
}

/* Experiência revisada: autenticação, links e botões */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(223, 170, 39, .45);
    outline-offset: 2px;
}

.primary-button,
.secondary-button,
.text-button,
.row-action {
    border-radius: 10px;
    font-weight: 800;
}

.primary-button,
.secondary-button {
    gap: .45rem;
    box-shadow: 0 8px 18px rgba(24, 61, 121, .08);
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.row-action:hover {
    transform: translateY(-1px);
}

.auth-shell {
    padding: 44px 20px;
}

.auth-card-compact {
    width: min(560px, 100%);
}

.auth-card,
.confirmation-card {
    border-radius: 18px;
}

.auth-card h1 {
    margin-bottom: .55rem;
    line-height: 1.15;
}

.auth-copy,
.auth-intro {
    max-width: 440px;
    margin: 0 auto;
    color: var(--muted);
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.auth-actions .primary-button,
.auth-actions .secondary-button,
.auth-card .secondary-button {
    width: 100%;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.auth-links a,
.muted-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin: 0;
    padding: .35rem .65rem;
    border-radius: 999px;
    color: var(--navy);
    background: var(--blue-soft);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-links a:hover,
.muted-link:hover {
    background: #dfeef8;
}

.password-toggle {
    border-radius: 8px;
}

.alert {
    text-align: left;
}

.auth-card .alert {
    margin-top: 22px;
}

.admin-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-nav a.is-active {
    background: var(--blue-soft);
    color: var(--navy-dark);
}

.admin-nav .logout-link {
    background: #fff3f4;
}

.filter-bar .primary-button,
.filter-bar .text-button {
    min-height: 48px;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .45rem .75rem;
    background: var(--blue-soft);
    text-decoration: none;
}

@media (max-width: 680px) {
    .auth-links {
        display: grid;
        grid-template-columns: 1fr;
    }
    .auth-links a,
    .muted-link {
        width: 100%;
    }
    .admin-nav {
        justify-content: flex-start;
    }
    .admin-header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }
}


/* Recursos do painel de candidatos */
.stats-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filter-bar-extended { grid-template-columns: minmax(230px, 1fr) minmax(145px, .35fr) minmax(220px, .55fr) minmax(170px, .38fr) auto auto; }
.bulk-form { display: grid; gap: 14px; }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bulk-toolbar strong { display: block; color: var(--navy); }
.bulk-toolbar small { display: block; margin-top: 2px; color: var(--muted); }
.bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.danger-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.15rem; border: 1px solid #b13a47; border-radius: 10px; background: #b13a47; color: #fff; font-weight: 800; text-decoration: none; transition: .2s ease; }
.danger-button:hover { background: #8f2f3a; transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { cursor: not-allowed; opacity: .52; transform: none; box-shadow: none; }
.check-column { width: 54px; text-align: center; }
.check-column input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--navy); }
.check-label { display: inline-flex; align-items: center; gap: 8px; }
.check-label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sort-link { display: inline-flex; align-items: center; gap: 4px; color: var(--navy); text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.exam-status { display: inline-flex; padding: .3rem .55rem; border-radius: 999px; background: #e9eef3; color: #445668; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.exam-sim { background: #e5f5ed; color: #176341; }
.exam-nao { background: #f7e8ea; color: #8a2d38; }
.exam-pendente { background: #edf3f8; color: #445668; }
.title-badges { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.alert-error { border-color: #f1c4ca; background: #fff2f4; color: #842a35; }
.alert-success { border-color: #bfe6d1; background: #effaf4; color: #176341; }

@media (max-width: 1180px) {
    .stats-grid-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-bar-extended { grid-template-columns: 1fr 1fr; }
    .filter-bar-extended label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .stats-grid-five, .filter-bar-extended { grid-template-columns: 1fr; }
    .filter-bar-extended label:first-child { grid-column: auto; }
    .bulk-toolbar { align-items: stretch; flex-direction: column; }
    .bulk-actions { display: grid; grid-template-columns: 1fr; }
    .bulk-actions .secondary-button, .bulk-actions .danger-button { width: 100%; }
    .check-column { width: auto; text-align: left; }
    .leads-table td.check-column { display: flex; align-items: center; justify-content: flex-start; }
    .leads-table td.check-column::before { content: attr(data-label); width: 110px; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
    .title-badges { justify-content: flex-start; }
}
