:root{
  --portal-blue:#1a4889;
  --portal-blue-dark:#113560;
  --portal-blue-soft:#eaf2fb;
  --bg:#f6f8fb;
  --card:#fff;
  --text:#111827;
  --muted:#64748b;
  --brand:var(--portal-blue);
  --line:#e5e7eb;
  --soft:#f8fafc;
  --ok:#15803d;
  --ok-bg:#ecfdf5;
  --warn:#b45309;
  --warn-bg:#fffbeb;
  --danger:#be123c;
  --danger-bg:#fff1f2;
  --shadow:0 10px 28px rgba(15,23,42,.08);
}

html[data-portal-theme="light"],
html[data-portal-theme="light"] body{
  color-scheme: light;
}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
.topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:10px;min-height:64px;padding:10px 18px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 4px 18px rgba(15,23,42,.05)}
.topbar h1{margin:0;font-size:18px}
.spacer{flex:1}
.page{max-width:var(--portal-content-max,1320px);margin:0 auto;padding:0 24px 42px}
.hero,.card{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}
.hero{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:18px;margin-bottom:14px}
.hero h2{margin:0;font-size:28px;line-height:1.15}
.hero p,.muted{color:var(--muted)}
.page-controls{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 14px;padding:14px 18px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}
.page-controls .message{margin:0;min-height:0}
.page-controls .toolbar{margin-left:auto}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);font-weight:750;cursor:pointer}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.ghost{background:var(--soft)}
.talent-public-page{
  font-family:Montserrat,Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
}
.talent-public-page .topbar{
  min-height:64px;
  padding:12px 20px;
  gap:16px;
  border-bottom:1px solid var(--line);
  box-shadow:none;
  overflow:visible;
}
.talent-public-page .topbar::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:3px;
  background:var(--brand);
  border-bottom-left-radius:2px;
  border-bottom-right-radius:2px;
}
.talent-public-page[data-brand="mix"] .topbar::after{
  background:linear-gradient(90deg,#f4b541,var(--brand));
}
.talent-public-page .btn-back{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:#111827;
  font-weight:700;
  line-height:1;
  box-shadow:0 2px 0 rgba(0,0,0,.04);
  transition:transform .12s ease,box-shadow .12s ease;
}
.talent-public-page .btn-back:hover,
.talent-public-page .btn-back:focus{
  transform:translateY(-1px);
  box-shadow:0 6px 12px rgba(17,24,39,.08);
}
.talent-public-page .brand{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.talent-public-page .brand-img{
  display:block;
  height:34px;
  width:auto;
}
.talent-choice-page{max-width:1040px;margin:28px auto;padding:0 20px 48px}
.talent-choice-hero{align-items:center;background:#fff;border:1px solid #dbe3ef;border-left:5px solid var(--brand);border-radius:12px;box-shadow:var(--shadow);padding:22px}
.talent-choice-hero h2{margin:8px 0 8px;font-size:28px}
.talent-choice-hero p{max-width:720px}
.talent-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}
.talent-choice-card{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);cursor:pointer;outline:0;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.talent-choice-card:hover,.talent-choice-card:focus{transform:translateY(-2px);border-color:#cbd5e1;box-shadow:0 16px 36px rgba(15,23,42,.12)}
.talent-choice-top{display:flex;align-items:center;gap:10px;padding:16px 18px 0}
.choice-accent{width:64px;height:6px;border-radius:999px}.choice-accent-upload{background:#f4b541}.choice-accent-form{background:var(--brand)}
.choice-line{flex:1;height:6px;border-radius:999px;background:linear-gradient(90deg,var(--brand) 0%,var(--brand) 62%,transparent 62%)}
.talent-choice-body{padding:18px}
.talent-choice-icon{width:46px;height:46px;display:grid;place-items:center;margin-bottom:10px;border-radius:12px;background:var(--portal-blue-soft);color:var(--brand)}
.talent-choice-body h3{margin:0 0 6px;font-size:20px}
.talent-choice-body p{min-height:46px;margin:0 0 16px;color:var(--muted);line-height:1.35}
.talent-choice-body .btn{width:100%;min-height:44px}
.talent-choice-note{margin:16px 4px 0;color:var(--muted)}
html[data-portal-theme="dark"] body.talent-public-page{background:#111418;color:#f2f4f7}
html[data-portal-theme="dark"] .talent-public-page .topbar,
html[data-portal-theme="dark"] .talent-choice-card,
html[data-portal-theme="dark"] .talent-choice-hero{background:#1a1c21;border-color:#343842;box-shadow:0 10px 28px rgba(0,0,0,.28)}
html[data-portal-theme="dark"] .talent-choice-hero{background:linear-gradient(135deg,rgba(37,99,235,.16),rgba(244,181,65,.12)) padding-box,linear-gradient(135deg,#f4b541,#2563eb) border-box;border-color:transparent}
html[data-portal-theme="dark"] .talent-choice-body h3,
html[data-portal-theme="dark"] .talent-choice-hero h2,
html[data-portal-theme="dark"] .talent-public-page .topbar h1{color:#f2f4f7}
html[data-portal-theme="dark"] .talent-choice-body p,
html[data-portal-theme="dark"] .talent-choice-hero p,
html[data-portal-theme="dark"] .talent-choice-note,
html[data-portal-theme="dark"] .talent-public-page .muted{color:#b8bec8}
html[data-portal-theme="dark"] .talent-choice-icon{background:#202738;color:#93c5fd}
html[data-portal-theme="dark"] .btn{background:#252832;border-color:#3b414f;color:#f2f4f7}
html[data-portal-theme="dark"] .btn.ghost{background:#1d2028}
html[data-portal-theme="dark"] .btn.primary{background:#2563eb;border-color:#3b82f6;color:#fff}
@media (max-width:760px){.talent-choice-grid{grid-template-columns:1fr}.talent-choice-hero h2{font-size:25px}.talent-choice-body p{min-height:0}}
.btn.danger{background:var(--danger-bg);border-color:#fecdd3;color:#9f1239}
.btn.ok{background:var(--ok-bg);border-color:#bbf7d0;color:#166534}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.toolbar input,.toolbar select{min-height:38px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:#fff}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}
.card{padding:14px}
.col-12{grid-column:span 12}.col-8{grid-column:span 8}.col-6{grid-column:span 6}.col-4{grid-column:span 4}
.list{display:grid;gap:10px}
.candidate-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:start;padding:14px;border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:8px;background:#fff}
.candidate-row h3{margin:0 0 6px;font-size:17px}
.meta{display:flex;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:13px}
.pill{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border-radius:999px;background:var(--soft);font-size:12px;font-weight:750}
.pill.ok{background:var(--ok-bg);color:#166534}.pill.warn{background:var(--warn-bg);color:#92400e}.pill.danger{background:var(--danger-bg);color:#9f1239}
.talent-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 12px}
.talent-metric{display:flex;align-items:center;gap:8px;min-height:58px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:var(--shadow);cursor:pointer;text-align:left}
.talent-metric strong{font-size:24px;line-height:1}
.status-dot{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:999px;background:#fff;font-weight:900}
.talent-board{display:grid;grid-template-columns:repeat(3,minmax(260px,1fr));gap:12px;align-items:start}
.talent-column{min-height:360px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.talent-column-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
.talent-column-head h2{display:flex;align-items:center;gap:8px;margin:0;font-size:15px}
.talent-column-body{display:grid;gap:10px;padding:12px}
.talent-novo{background:var(--portal-blue-soft);border-color:#bfdbfe}.metric-novo{border-left:4px solid var(--portal-blue)}
.talent-pre_aprovado{background:var(--portal-blue-soft);border-color:#c7d2fe}.metric-pre_aprovado{border-left:4px solid var(--portal-blue)}
.talent-reprovado{background:#fff1f2;border-color:#fecdd3}.metric-reprovado{border-left:4px solid #be123c}
.talent-card{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:8px;background:#fff;box-shadow:0 6px 18px rgba(15,23,42,.06)}
.talent-card h3{margin:0 0 6px;font-size:16px}
.talent-card-main{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.talent-card-pre_aprovado{border-left-color:var(--portal-blue)}
.talent-card-reprovado{border-left-color:#be123c}
.talent-actions,.talent-link-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.talent-link-row select{min-width:220px;flex:1}
.actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.field-actions{display:flex;align-items:end;justify-content:flex-start}
label{display:grid;gap:6px;font-size:13px;font-weight:750;color:#334155}
input,select,textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 10px;background:#fff;color:var(--text)}
textarea{resize:vertical}
.full{grid-column:1/-1}
.message{min-height:24px;margin:10px 0 0;color:var(--muted);font-weight:700}
.message.ok{color:#166534}.message.err{color:#9f1239}
.review-box{white-space:pre-wrap;background:#0f172a;color:#e2e8f0;border-radius:8px;padding:12px;overflow:auto;max-height:360px}
.template-card{display:grid;gap:8px;border:1px solid var(--line);border-radius:8px;padding:12px}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 12px}
.section-head h3{margin:0;font-size:18px}
.section-head p{margin:4px 0 0}
.filters{display:grid;grid-template-columns:minmax(0,1fr) 170px;gap:8px;margin:0 0 12px}
.template-workspace{display:grid;grid-template-columns:320px minmax(0,1fr) 300px;gap:14px;align-items:start}
.template-sidebar,.template-editor,.template-preview{min-width:0}
.template-list{display:grid;gap:8px;max-height:660px;overflow:auto;padding-right:4px}
.template-list-item{display:grid;gap:5px;width:100%;padding:12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);text-align:left;cursor:pointer}
.template-list-item:hover,.template-list-item.active{border-color:#c7d2fe;background:var(--portal-blue-soft)}
.template-list-item strong{font-size:14px}
.template-list-item span{color:var(--muted);font-size:12px;font-weight:750}
.template-list-item small{color:#475569;line-height:1.35}
.template-preview{position:sticky;top:84px;border:1px solid var(--line);border-radius:8px;background:#f8fafc;padding:14px}
.template-preview h3{margin:0 0 10px}
.message-preview{min-height:220px;white-space:pre-wrap;line-height:1.45;border:1px solid var(--line);border-radius:8px;background:#fff;padding:12px;color:#1f2937}
.variable-bar{display:flex;flex-wrap:wrap;gap:6px;padding:10px;border:1px dashed #cbd5e1;border-radius:8px;background:#f8fafc}
.variable-bar button{width:auto;border:1px solid #c7d2fe;border-radius:999px;background:var(--portal-blue-soft);color:#3730a3;padding:5px 9px;font-size:12px;font-weight:800;cursor:pointer}
.variable-bar button:hover{background:var(--portal-blue-soft)}
.hide{display:none!important}
@media (max-width:760px){
  .topbar{align-items:flex-start;flex-wrap:wrap}
  .hero{display:grid}
  .hero h2{font-size:23px}
  .page-controls{display:grid;padding:14px}
  .page-controls .toolbar{margin-left:0}
  .grid,.form-grid{grid-template-columns:1fr}
  .col-12,.col-8,.col-6,.col-4{grid-column:1}
  .candidate-row{grid-template-columns:1fr}
  .actions{justify-content:stretch}
  .actions .btn,.toolbar .btn{flex:1}
  .toolbar input,.toolbar select{width:100%}
  .talent-metrics,.talent-board{grid-template-columns:1fr}
  .talent-column{min-height:0}
  .talent-card-main{display:grid}
  .talent-actions .btn,.talent-link-row .btn{flex:1}
  .talent-link-row select{min-width:100%}
  .section-head{display:grid}
  .filters{grid-template-columns:1fr}
  .template-workspace{grid-template-columns:1fr}
  .template-list{max-height:none}
  .template-preview{position:static}
}

html[data-portal-theme="dark"],
html[data-portal-theme="dark"] body {
  background: #121316 !important;
  color: #f2f4f7 !important;
  color-scheme: dark;
}

html[data-portal-theme="dark"] .topbar,
html[data-portal-theme="dark"] .card,
html[data-portal-theme="dark"] .hero,
html[data-portal-theme="dark"] .page-controls,
html[data-portal-theme="dark"] .toolbar,
html[data-portal-theme="dark"] .talent-bank-cta,
html[data-portal-theme="dark"] .search,
html[data-portal-theme="dark"] .talent-card,
html[data-portal-theme="dark"] .talent-column,
html[data-portal-theme="dark"] .template-preview,
html[data-portal-theme="dark"] .template-list {
  background: #1a1c21 !important;
  color: #f2f4f7 !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28) !important;
}

html[data-portal-theme="dark"] input,
html[data-portal-theme="dark"] select,
html[data-portal-theme="dark"] textarea {
  background: #15171b !important;
  color: #f2f4f7 !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
}

html[data-portal-theme="dark"] h1,
html[data-portal-theme="dark"] h2,
html[data-portal-theme="dark"] h3,
html[data-portal-theme="dark"] strong,
html[data-portal-theme="dark"] .title {
  color: #f2f4f7 !important;
}

html[data-portal-theme="dark"] p,
html[data-portal-theme="dark"] span,
html[data-portal-theme="dark"] small,
html[data-portal-theme="dark"] label,
html[data-portal-theme="dark"] .muted {
  color: #b8bec8 !important;
}

html[data-portal-theme="dark"] .btn,
html[data-portal-theme="dark"] button {
  background: #272b33 !important;
  color: #f2f4f7 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

html[data-portal-theme="dark"] .btn.primary,
html[data-portal-theme="dark"] .btn-primary,
html[data-portal-theme="dark"] .primary {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: rgba(147, 197, 253, 0.42) !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-portal-theme="light"]),
  html:not([data-portal-theme="light"]) body {
    background: #121316 !important;
    color: #f2f4f7 !important;
    color-scheme: dark;
  }

  html:not([data-portal-theme="light"]) .topbar,
  html:not([data-portal-theme="light"]) .card,
  html:not([data-portal-theme="light"]) .hero,
  html:not([data-portal-theme="light"]) .page-controls,
  html:not([data-portal-theme="light"]) .toolbar,
  html:not([data-portal-theme="light"]) .talent-bank-cta,
  html:not([data-portal-theme="light"]) .search,
  html:not([data-portal-theme="light"]) .talent-card {
    background: #1a1c21 !important;
    color: #f2f4f7 !important;
    border-color: rgba(255, 255, 255, 0.11) !important;
  }
}

html[data-portal-theme="light"] body.talent-public-page {
  background: var(--bg) !important;
  color: var(--text) !important;
  color-scheme: light;
}

html[data-portal-theme="light"] .talent-choice-card,
html[data-portal-theme="light"] .talent-choice-hero {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

html[data-portal-theme="light"] .talent-public-page .topbar {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

html[data-portal-theme="light"] .talent-choice-hero {
  background: #fff !important;
  border-color: #dbe3ef !important;
  border-left-color: var(--brand) !important;
}

html[data-portal-theme="light"] .talent-choice-body h3,
html[data-portal-theme="light"] .talent-choice-hero h2,
html[data-portal-theme="light"] .talent-public-page .topbar h1 {
  color: var(--text) !important;
}

html[data-portal-theme="light"] .talent-choice-body p,
html[data-portal-theme="light"] .talent-choice-hero p,
html[data-portal-theme="light"] .talent-choice-note,
html[data-portal-theme="light"] .talent-public-page .muted {
  color: var(--muted) !important;
}

html[data-portal-theme="light"] .talent-choice-icon {
  background: var(--portal-blue-soft) !important;
  color: var(--brand) !important;
}

html[data-portal-theme="light"] .talent-public-page .btn {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-portal-theme="light"] .talent-public-page .btn.primary {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand) !important;
}

html[data-portal-theme="dark"] .talent-public-page .btn-back,
html[data-theme="dark"] .talent-public-page .btn-back,
body[data-theme="dark"] .talent-public-page .btn-back {
  background: #1f242e !important;
  border-color: #333b4a !important;
  color: #f4f7fb !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .22) !important;
}

html[data-portal-theme="dark"] .talent-public-page .btn-back:hover,
html[data-portal-theme="dark"] .talent-public-page .btn-back:focus,
html[data-theme="dark"] .talent-public-page .btn-back:hover,
html[data-theme="dark"] .talent-public-page .btn-back:focus,
body[data-theme="dark"] .talent-public-page .btn-back:hover,
body[data-theme="dark"] .talent-public-page .btn-back:focus {
  background: #2a3140 !important;
  border-color: #445066 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28) !important;
}
