:root {
  --avanex-primary: #071441;
  --avanex-primary-dark: #030b25;
  --avanex-primary-light: #1a3275;
  --avanex-background: #f5f7fb;
  --avanex-surface: #ffffff;
  --avanex-text: #182133;
  --avanex-border: #d8deea;
  --avanex-success: #18794e;
  --avanex-danger: #b4232c;
  --ink: var(--avanex-text); --muted: #5c667a; --primary: var(--avanex-primary);
  --primary-dark: var(--avanex-primary-dark); --teal-soft: #eef1f8;
  --line: var(--avanex-border); --surface: var(--avanex-surface);
  --background: var(--avanex-background); --danger: var(--avanex-danger);
  --success: var(--avanex-success); --shadow: 0 12px 36px rgba(7, 20, 65, .08);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
a { color: var(--primary); }
.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: var(--avanex-primary); border-bottom: 1px solid var(--avanex-primary-light); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; width: 170px; height: 62px; overflow: hidden; text-decoration: none; }
.brand-logo { display: block; width: 170px; height: 170px; object-fit: contain; object-position: center; transform: translateY(-54px); }
.header-label { color: #e8ebf4; font-size: .88rem; }
main.container { min-height: calc(100vh - 150px); padding-block: 64px; }
.hero { text-align: center; max-width: 820px; margin: 0 auto 48px; }
.eyebrow { display: block; color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .14em; margin-bottom: 10px; }
h1, h2 { line-height: 1.18; margin-top: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -.035em; margin-bottom: 18px; }
h2 { font-size: 1.15rem; }
.lead { color: var(--muted); font-size: 1.18rem; max-width: 690px; margin: 0 auto 24px; }
.notice, .warning, .error-box, .success-box { border-radius: 9px; padding: 15px 18px; }
.notice { background: var(--teal-soft); color: #244c57; max-width: 680px; margin: auto; }
.warning { background: #fff7df; color: #654d0a; border: 1px solid #f0d883; }
.error-box { background: #fff0f1; color: var(--danger); border: 1px solid #edc9cc; }
.success-box { background: #eaf7ef; color: var(--success); border: 1px solid #b9dec7; margin-bottom: 20px; }
.actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; padding: 10px 22px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--primary); background: white; border-color: #abc1c7; }
.button.full { width: 100%; margin-top: 10px; }
.button.small { min-height: 38px; padding: 6px 15px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.card, .form-card, .public-result, .result-card, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card { padding: 28px; }
.card p { color: var(--muted); margin: 0; }
.step { color: var(--primary); font-size: .75rem; font-weight: 800; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 880px; margin: 0 auto; }
.action-card { display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.action-card h2 { font-size: 1.35rem; margin: 16px 0 8px; }
.action-card p { color: var(--muted); margin: 0 0 24px; flex: 1; }
.action-card .button { width: 100%; }
.card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--teal-soft); color: var(--primary); font-size: .76rem; font-weight: 850; }
.home-guidance { max-width: 880px; margin: 22px auto 0; display: grid; gap: 12px; }
.guidance-item, .emergency-warning { display: flex; gap: 7px; flex-direction: column; border-radius: 10px; padding: 17px 20px; }
.guidance-item { background: #eef1f8; border: 1px solid #d5dceb; }
.emergency-warning { background: #fff7e8; border: 1px solid #ead5a8; color: #654a13; }
.guidance-item span, .emergency-warning span { font-size: .9rem; }
.form-shell { max-width: 760px; margin: auto; }
.form-shell.narrow { max-width: 560px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: 2.2rem; margin-bottom: 10px; }
.page-heading p { color: var(--muted); margin: 0; }
.back { display: inline-block; margin-bottom: 26px; text-decoration: none; font-weight: 650; }
.form-card { padding: clamp(22px, 5vw, 38px); }
.form-card > * + * { margin-top: 22px; }
.field label, fieldset legend { display: block; font-weight: 700; margin-bottom: 7px; }
fieldset { border: 0; padding: 0; margin-inline: 0; }
input[type="text"], input[type="password"], input[type="date"], select, textarea { width: 100%; border: 1px solid #aebfc4; border-radius: 6px; background: #fff; color: var(--ink); padding: 11px 12px; font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(7, 86, 106, .16); border-color: var(--primary); }
.choice { display: inline-flex; align-items: center; gap: 7px; margin-right: 22px; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { margin-top: 5px; }
.hint { display: block; color: var(--muted); font-size: .82rem; margin-top: 5px; }
.validation { display: block; color: var(--danger); font-size: .86rem; margin-top: 5px; }
.validation:empty { display: none; }
.validation:not(:empty)::before { content: "Atenção: "; font-weight: 750; }
.processing-message { display: block; text-align: center; color: var(--muted); font-size: .88rem; margin-top: 10px !important; }
.processing-message[hidden] { display: none; }
.result-card { max-width: 690px; margin: auto; text-align: center; padding: clamp(28px, 6vw, 54px); }
.success-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 1.7rem; margin: 0 auto 20px; }
.result-card h1 { font-size: 2.2rem; }
.credentials { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin: 30px 0 18px; }
.credentials div { background: var(--teal-soft); padding: 18px; border-radius: 8px; }
.credentials span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.credentials strong { display: block; font-size: clamp(1.1rem, 4vw, 1.6rem); letter-spacing: .06em; margin-top: 4px; }
.public-result { padding: 28px; margin-top: 24px; }
.public-result h2 { margin: 15px 0 10px; }
.public-result .status { display: inline-block; color: var(--primary-dark); background: var(--teal-soft); border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 750; }
.public-result dl, .details { margin: 24px 0 0; }
.public-result dl div, .details div { padding: 12px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
dd { margin: 3px 0 0; }
.site-footer { border-top: 1px solid var(--line); background: white; color: var(--muted); }
.site-footer .container { min-height: 78px; display: flex; align-items: center; justify-content: space-between; font-size: .86rem; }
.admin-shell { max-width: 1080px; margin: auto; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-heading h1 { font-size: 2rem; margin: 0; }
.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: start; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: 13px 15px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f8fafb; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.history { margin-top: 20px; }
.history .table-wrap { box-shadow: none; }
.pre-wrap { white-space: pre-wrap; }
code { font-size: .9em; }
@media (max-width: 760px) {
  main.container { padding-block: 40px; }
  .grid.three, .admin-grid, .action-grid { grid-template-columns: 1fr; }
  .credentials { grid-template-columns: 1fr; }
  .header-label { display: none; }
  .brand { width: 146px; height: 56px; }
  .brand-logo { width: 146px; height: 146px; transform: translateY(-45px); }
  .site-footer .container { flex-direction: column; justify-content: center; gap: 3px; }
}
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body, .result-card { background: white; box-shadow: none; }
  main.container { padding: 0; }
}
