/* ============================================================
   DOCTOR Prime / Núcleo Aliança — Design System (painel + público)
   Espelha SISTEMA_DE_DESIGN.md (Reestruturação Comercial/Paginas_DOCTOR_Prime)
   ============================================================ */

:root {
  /* Navy */
  --navy:       #193b73;
  --navy-deep:  #0c2e66;
  --navy-dark:  #061a3e;
  --navy-soft:  #2a5092;
  --navy-mist:  #e8eef5;
  --navy-faint: #f4f7fb;

  /* Verde */
  --green:      #00d084;
  --green-deep: #00a068;
  --green-mint: #7bdcb5;
  --green-ghost:#d7f5e9;

  /* Amarelo / Vermelho */
  --yellow:      #fcb900;
  --yellow-soft: #fff4d4;
  --red:         #ed0d0d;
  --red-soft:    #fcdada;

  /* Neutros */
  --white:      #ffffff;
  --off-white:  #fafbfc;
  --ink:        #0b1220;
  --text:       #1f2937;
  --text-soft:  #55627a;
  --text-muted: #8b94a8;

  --line:      rgba(25, 59, 115, 0.14);
  --line-soft: rgba(25, 59, 115, 0.06);

  --font-display: 'Instrument Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow:    0 4px 16px rgba(11, 18, 32, 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--green-deep); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; color: var(--navy); }
em { font-style: italic; color: var(--green-deep); font-weight: 500; }
strong { color: var(--navy); font-weight: 600; }
small { color: var(--text-muted); font-size: 12px; }

.label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--navy);
}
.mono { font-family: var(--font-mono); font-size: 0.88em; }

/* ============================================================
   Layout do painel admin (sidebar + content)
   ============================================================ */

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.85);
  padding: 28px 18px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 800px) {
  .sidebar { position: static; height: auto; padding: 16px; }
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { height: 28px; filter: brightness(0) invert(1); }
.sidebar-brand .name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; color: white;
}
.sidebar-brand .sub {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.sidebar-section {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: rgba(255,255,255,0.45);
  margin: 22px 0 8px 12px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active {
  background: var(--green-deep);
  color: var(--white);
}
.sidebar-link.disabled { color: rgba(255,255,255,0.3); pointer-events: none; }
.sidebar-link .badge {
  margin-left: auto;
  font-size: 10px; padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  text-transform: uppercase; letter-spacing: 0.6px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.sidebar-footer .who { color: white; font-weight: 500; }
.sidebar-footer .role {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(0, 208, 132, 0.18);
  color: var(--green-mint);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-footer form { margin-top: 12px; }
.sidebar-footer button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
}
.sidebar-footer button:hover { background: rgba(255,255,255,0.06); color: white; }

.content {
  padding: 36px clamp(20px, 5vw, 56px);
  max-width: 1280px;
  width: 100%;
}

.page-head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: end; gap: 16px;
  justify-content: space-between;
}
.page-head h1 {
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.1;
}
.page-head .breadcrumb {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--green-deep);
  margin-bottom: 6px;
  display: inline-flex; align-items: center; gap: 10px;
}
.page-head .breadcrumb::before {
  content: ''; width: 24px; height: 2px; background: var(--green);
}
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Componentes — botões, cards, callouts, pills, tabelas, forms
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--green); color: var(--navy-deep); }
.btn-primary:hover { background: var(--green-deep); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-deep); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--navy-mist); color: var(--navy); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card.tight { padding: 18px; }
.card-h {
  display: flex; justify-content: space-between; align-items: start; gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-h h2, .card-h h3 { font-size: 18px; line-height: 1.2; }

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 0 28px;
}
@media (min-width: 640px) { .stats.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .stats.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .stats.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card.filled {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.stat-card .n {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.05;
  color: var(--navy);
  margin-bottom: 6px;
}
.stat-card.filled .n { color: var(--white); }
.stat-card .n em { color: var(--green-deep); }
.stat-card.filled .n em { color: var(--green-mint); }
.stat-card .l { font-size: 13px; color: var(--text-soft); line-height: 1.4; }
.stat-card.filled .l { color: rgba(255, 255, 255, 0.75); }
.stat-card .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-card.filled .hint { color: rgba(255, 255, 255, 0.6); }

.callout {
  background: var(--navy-mist);
  border-left: 4px solid var(--green);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 18px 0;
}
.callout.warn   { background: var(--yellow-soft); border-left-color: var(--yellow); }
.callout.danger { background: var(--red-soft);    border-left-color: var(--red); }
.callout-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--green-deep);
  margin-bottom: 6px;
}
.callout.warn   .callout-label { color: #b27a00; }
.callout.danger .callout-label { color: var(--red); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--navy-mist);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.pill.green  { background: var(--green-ghost); color: var(--green-deep); }
.pill.red    { background: var(--red-soft);    color: var(--red); }
.pill.yellow { background: var(--yellow-soft); color: #8f6700; }
.pill.navy   { background: var(--navy); color: var(--white); }

.bars { display: grid; gap: 8px; margin: 14px 0 22px; }
.bar-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 14px;
}
.bar-row .lbl { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.bar-row .trk { height: 8px; background: var(--navy-mist); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--navy); border-radius: 4px; }
.bar-row .fill.green  { background: var(--green-deep); }
.bar-row .fill.yellow { background: var(--yellow); }
.bar-row .fill.red    { background: var(--red); }
.bar-row .val {
  font-family: var(--font-display);
  font-weight: 600; color: var(--navy); font-size: 14px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
}

.tbl-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--navy);
  background: var(--navy-faint);
  border-bottom-color: var(--navy);
  border-bottom-width: 2px;
}
td { color: var(--text); vertical-align: top; }
td.num { font-family: var(--font-display); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--navy-faint); }

/* ============================================================
   Forms
   ============================================================ */

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.18);
}
textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: auto; }

/* ============================================================
   Auth — login, MFA, set-password
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 20% 100%, rgba(0, 208, 132, 0.08), transparent 60%),
    var(--off-white);
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-card .brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.auth-card .brand img { height: 44px; }
.auth-card h1 {
  font-size: 24px; line-height: 1.2; text-align: center; margin-bottom: 6px;
}
.auth-card .subtitle {
  font-size: 13px; color: var(--text-soft);
  text-align: center; margin-bottom: 28px;
}
.auth-card .alert {
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 3px solid var(--red);
}
.auth-card .alert.success {
  background: var(--green-ghost);
  color: var(--green-deep);
  border-left-color: var(--green-deep);
}
.auth-card .auth-meta {
  margin-top: 20px;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}
.auth-card form > .btn { width: 100%; justify-content: center; }

/* MFA: input com 6 dígitos centralizado */
.mfa-input {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  padding: 16px;
}

/* ============================================================
   Submódulos — cards do dashboard de marketing
   ============================================================ */

.modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 8px;
}
@media (min-width: 720px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .modules { grid-template-columns: repeat(3, 1fr); } }
.module-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: border-color .15s, transform .15s;
  position: relative;
}
.module-card:hover { border-color: var(--green-deep); transform: translateY(-2px); }
.module-card.disabled { opacity: 0.7; pointer-events: none; }
.module-card .kicker {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--green-deep);
  margin-bottom: 12px;
}
.module-card.disabled .kicker { color: var(--text-muted); }
.module-card h3 {
  font-size: 22px; line-height: 1.2; margin-bottom: 8px;
}
.module-card p {
  font-size: 14px; color: var(--text-soft); line-height: 1.5; flex: 1;
  margin-bottom: 16px;
}
.module-card .footer { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   Survey editor — questions list + forms
   ============================================================ */

.q-list { display: grid; gap: 12px; margin: 16px 0; }
.q-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
}
.q-item .q-num {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  color: var(--green-deep);
  font-style: italic;
  min-width: 28px; text-align: center;
  margin-top: -2px;
}
.q-item .q-body strong { display: block; font-size: 15px; color: var(--navy); }
.q-item .q-body .meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.q-item .q-actions { display: flex; gap: 6px; align-items: center; }
.q-item form { display: inline; }

/* ============================================================
   Public survey page — clean, mobile-first
   ============================================================ */

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--off-white);
}
.public-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.public-header img { height: 32px; display: block; margin: 0 auto; }
.public-content {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.public-content .intro h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin-bottom: 12px;
}
.public-content .intro .sub {
  font-size: 16px; color: var(--text-soft); line-height: 1.55;
  margin-bottom: 28px;
}
.public-q {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}
.public-q .q-pos {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--green-deep);
  margin-bottom: 8px;
}
.public-q h2 {
  font-size: 18px; line-height: 1.4; margin-bottom: 6px;
}
.public-q .desc { font-size: 13px; color: var(--text-soft); margin-bottom: 16px; }

.scale-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 16px 0 10px;
}
.scale-row.scale-5 { grid-template-columns: repeat(5, 1fr); }
.scale-row label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--navy-faint);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--navy);
  cursor: pointer;
  transition: all .15s;
  min-height: 56px;
}
.scale-row label:hover { border-color: var(--green-deep); background: var(--white); }
.scale-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.scale-row input[type="radio"]:checked + span { color: var(--white); }
.scale-row label:has(input:checked) {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--white);
}
.scale-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
}

.choices { display: grid; gap: 10px; margin: 12px 0 6px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
}
.choice:hover { border-color: var(--green-deep); }
.choice input { accent-color: var(--green-deep); }
.choice:has(input:checked) { border-color: var(--green-deep); background: var(--green-ghost); }

.public-submit {
  display: flex; justify-content: center; margin-top: 24px;
}
.public-submit .btn { padding: 14px 36px; font-size: 16px; }

.required-mark { color: var(--red); margin-left: 4px; }

/* Helpers */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.no-break { white-space: nowrap; }
