/* ============================================================
   SIMULADOR PNA — style.css
   Design coerente com os restantes simuladores Adhara
   (Montserrat · teal #1AA3BB · cartões claros · sombras suaves)

   NOTA: as variáveis --primary, --ok, --bad e --text-secondary
   são usadas inline pelo simulador.js. Não remover.
   ============================================================ */

:root{
  /* Marca */
  --teal:#1AA3BB;
  --teal-700:#147f92;
  --teal-900:#0c5564;

  --cyan:#DFFAFF;
  --cyan-soft:#DFFAFF;
  --cyan-100:#DFFAFF;

  --ink:#3D3D3D;
  --ink-soft:#6f7174;
  --ink-faint:#9aa0a2;

  --surface:#ffffff;
  --bg:#f3fbfd;
  --line:#e4eef1;
  --line-strong:#cfe6ec;

  --radius:16px;
  --radius-sm:12px;
  --radius-lg:22px;

  --shadow-sm:0 1px 2px rgba(12,85,100,.06), 0 4px 12px -6px rgba(12,85,100,.16);
  --shadow-md:0 12px 30px -16px rgba(12,85,100,.32), 0 2px 6px rgba(12,85,100,.05);
  --shadow-lg:0 26px 64px -28px rgba(12,85,100,.42), 0 2px 6px rgba(12,85,100,.05);

  /* Aliases exigidos pelo simulador.js (NÃO remover) */
  --primary:#1AA3BB;
  --ok:#1f9d68;
  --bad:#d64535;
  --text-secondary:#6f7174;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  font-family:'Montserrat',system-ui,-apple-system,sans-serif;
  font-weight:500;
  color:var(--ink);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  background:
    radial-gradient(1100px 560px at 86% -14%, var(--cyan) 0%, transparent 58%),
    radial-gradient(820px 480px at -12% 110%, #e9f8fb 0%, transparent 55%),
    var(--bg);
  background-attachment:fixed;
  min-height:100vh;
}

a{color:var(--teal);text-decoration:none;font-weight:600}
a:hover{color:var(--teal-700);text-decoration:underline}

button{font-family:inherit;cursor:pointer;border:none;background:none}
input,select{font-family:inherit}

:focus-visible{outline:3px solid var(--cyan);outline-offset:2px;border-radius:8px}
::selection{background:var(--cyan);color:var(--teal)}

/* ---------- Layout ---------- */
.wrap{
  width:100%;
  padding:32px 18px 90px;
  display:flex;
  justify-content:center;
}
.simulator{
  width:100%;
  max-width:880px;
}

/* ---------- Cabeçalho ---------- */
header{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:26px 28px 22px;
  margin-bottom:22px;
}
header h1{
  margin:0 0 18px;
  font-size:clamp(22px,3.4vw,30px);
  font-weight:700;
  letter-spacing:-.015em;
  color:var(--teal);
  line-height:1.15;
}
header h1::before{
  content:"";
  display:inline-block;
  width:9px;height:22px;
  margin-right:11px;
  border-radius:4px;
  background:var(--teal);
  vertical-align:-3px;
}

/* Controlos */
.controls{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:14px;
}
.controls > div{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:130px;
}
.controls label{
  font-size:12px;
  font-weight:600;
  color:var(--ink-soft);
  letter-spacing:.01em;
  display:flex;
  align-items:center;
  gap:5px;
}
.nota-curso-hint{
  display:inline-grid;
  place-items:center;
  width:16px;height:16px;
  border-radius:50%;
  background:var(--cyan);
  color:var(--teal);
  font-size:11px;
  font-weight:700;
  cursor:help;
  font-style:normal;
}

.controls input,
.controls select{
  width:100%;
  padding:11px 13px;
  border:1.6px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--surface);
  color:var(--ink);
  font-size:14.5px;
  font-weight:500;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.controls input::placeholder{color:var(--ink-faint)}
.controls input:hover,
.controls select:hover{border-color:var(--line-strong)}
.controls input:focus,
.controls select:focus{
  outline:none;
  border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(26,163,187,.16);
}
.controls select{
  appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231AA3BB' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:34px;
  cursor:pointer;
}

/* Botões submeter (topo + rodapé) */
#submit,
#submitBottom{
  padding:12px 26px;
  border-radius:var(--radius-sm);
  background:var(--teal);
  color:#fff;
  font-weight:700;
  font-size:14.5px;
  letter-spacing:.01em;
  box-shadow:0 10px 22px -10px rgba(26,163,187,.75);
  transition:background .15s, transform .05s, box-shadow .15s;
}
#submit{align-self:flex-end;height:fit-content}
#submit:hover,
#submitBottom:hover{background:var(--teal-700)}
#submit:active,
#submitBottom:active{transform:translateY(1px)}

/* Estatísticas */
.stats{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.stat{
  font-size:13px;
  font-weight:600;
  color:var(--ink-soft);
  background:var(--cyan-soft);
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 14px;
}
.stat b{color:var(--teal);font-weight:700}

/* ---------- Cartão de resultado ---------- */
.result-card{
  background:var(--surface);
  border:1px solid var(--line-strong);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:24px 26px;
}
.result-card--erro{
  border-color:#f1b6ad;
  background:linear-gradient(0deg, rgba(214,69,53,.04), rgba(214,69,53,.04)), var(--surface);
}
.result-title{
  margin:0 0 10px;
  font-size:20px;
  font-weight:700;
  letter-spacing:-.01em;
  color:var(--teal);
}
.result-title--erro{color:var(--bad)}
.result-muted{
  margin:0 0 4px;
  font-size:13.5px;
  color:var(--ink-soft);
}
.result-muted b{color:var(--ink);font-weight:700}
.result-detalhe{
  margin-top:12px;
  padding:12px 14px;
  background:#fbf4f3;
  border:1px solid #f1d9d5;
  border-radius:var(--radius-sm);
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px;
  color:#7a3a30;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:240px;
  overflow:auto;
}

/* Grelha de estatísticas do resultado */
.result-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
  margin:16px 0;
}
.result-stat-box{
  background:var(--cyan-soft);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:14px 12px;
  text-align:center;
}
.result-stat-label{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--ink-soft);
  margin-bottom:5px;
}
.result-stat-value{
  font-size:26px;
  font-weight:700;
  color:var(--teal);
  line-height:1;
}
.result-stat-sub{
  font-size:13px;
  font-weight:500;
  color:var(--ink-faint);
  margin-left:1px;
}

.result-card hr{
  border:none;
  border-top:1px solid var(--line);
  margin:18px 0;
}
.result-card code{
  background:var(--cyan);
  color:var(--teal);
  border:1px solid var(--line-strong);
  border-radius:8px;
  padding:6px 12px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-weight:700;
}
#btnCopiarCodigo{
  border:1.5px solid var(--line-strong);
  border-radius:9px;
  background:var(--surface);
  color:var(--teal);
  font-weight:700;
  font-size:13px;
  transition:background .15s, border-color .15s;
}
#btnCopiarCodigo:hover{background:var(--cyan-soft);border-color:var(--teal)}

/* ---------- Barra de progresso ---------- */
.questions-box{margin-top:4px}
.progress{
  position:sticky;
  top:0;
  z-index:20;
  height:auto;
  margin:0 0 18px;
  padding:10px 0;
  background:linear-gradient(var(--bg) 62%, rgba(243,251,253,0));
}
.progress::before{
  content:"";
  position:absolute;
  inset:10px 0 auto 0;
  height:8px;
  border-radius:999px;
  background:var(--line);
}
#progressBar{
  position:relative;
  height:8px;
  width:0;
  border-radius:999px;
  background:var(--teal);
  box-shadow:0 1px 4px -1px rgba(26,163,187,.7);
  transition:width .25s ease;
}

/* ---------- Perguntas ---------- */
.questions-wrapper{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.q{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  padding:16px 18px;
  scroll-margin-top:64px;
  transition:border-color .15s, box-shadow .15s, background .3s;
}
.q:hover{border-color:var(--line-strong)}
.qhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:13px;
}
.qhead b{
  font-size:15px;
  font-weight:700;
  color:var(--teal);
}
.badge{
  font-size:20px;
  font-weight:600;
  line-height:1;
}

/* Opções A–E / N/A como chips */
.opts{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
.opt{
  position:relative;
  display:inline-flex;
  cursor:pointer;
}
.opt input[type=radio]{
  position:absolute;
  opacity:0;
  width:0;height:0;
  pointer-events:none;
}
.pill{
  display:grid;
  place-items:center;
  min-width:54px;
  padding:11px 16px;
  border:1.7px solid var(--line-strong);
  border-radius:var(--radius-sm);
  background:var(--surface);
  color:var(--ink-soft);
  font-weight:700;
  font-size:14.5px;
  letter-spacing:.02em;
  user-select:none;
  transition:border-color .14s, background .14s, color .14s, box-shadow .14s;
}
.opt:hover .pill{border-color:var(--teal);background:var(--cyan-soft)}
.opt input:checked + .pill{
  border-color:var(--teal);
  background:var(--cyan-soft);
  color:var(--teal);
  box-shadow:0 0 0 1.5px var(--teal);
}

/* ---------- Rodapé ---------- */
.footer{
  display:flex;
  justify-content:center;
  margin-top:26px;
}
.footer #submitBottom{padding:13px 40px;font-size:15px}

/* ---------- Voltar ao topo ---------- */
.btn-topo{
  display:none;            /* o simulador.js mostra/oculta consoante o scroll */
  position:fixed;
  right:22px;bottom:22px;
  z-index:60;
  width:46px;height:46px;
  border-radius:50%;
  background:var(--teal);
  color:#fff;
  font-size:20px;
  font-weight:700;
  box-shadow:0 12px 26px -10px rgba(26,163,187,.85);
  transition:background .15s, transform .12s;
}
.btn-topo:hover{background:var(--teal-700);transform:translateY(-2px)}

/* ---------- Responsivo ---------- */
@media (max-width:620px){
  .wrap{padding:20px 12px 80px}
  header{padding:20px 18px 18px;border-radius:var(--radius)}
  .controls{gap:12px}
  .controls > div{min-width:100%;flex:1 1 100%}
  #submit{width:100%}
  .result-grid{grid-template-columns:1fr;gap:10px}
  .result-stat-box{display:flex;align-items:baseline;justify-content:space-between;text-align:left}
  .result-stat-label{margin-bottom:0}
  .pill{min-width:48px;padding:10px 13px}
}