/* ============================================================
   Virtus Currículos — App Shell
   ============================================================ */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; overflow-x:hidden; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--f-body); font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden; width:100%;
}
img{ max-width:100%; display:block; }
button{ font-family:inherit; }
a{ color:var(--brand-2); }
.visually-hidden{ position:absolute!important; width:1px;height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* ---------- Header ---------- */
.app-header{
  position:sticky; top:0; z-index:40;
  height:var(--header-h);
  display:flex; align-items:center; gap:var(--sp-4);
  padding:0 var(--sp-5);
  background:var(--brand);
  color:#fff;
  border-bottom:3px solid var(--accent);
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-family:var(--f-display); font-weight:700; font-size:18px;
  letter-spacing:.2px; text-decoration:none; color:#fff;
  margin-right:auto;
}
.brand .brand-mark{
  width:34px; height:34px; border-radius:9px;
  background:var(--accent);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--f-display); font-weight:800; color:var(--brand);
  font-size:16px;
}
.brand small{
  display:block; font-family:var(--f-mono); font-weight:400;
  font-size:10px; letter-spacing:.08em; color:#B9C7DA; text-transform:uppercase;
}

/* Split-flap style counters (elemento assinatura) */
.flap-counters{ display:flex; gap:var(--sp-3); }
.flap{
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius-s);
  padding:6px 10px;
}
.flap-icon{ font-size:15px; opacity:.85; }
.flap-num{
  font-family:var(--f-mono); font-weight:600; font-size:14px;
  letter-spacing:.03em; color:#fff; font-variant-numeric:tabular-nums;
}
.flap-label{
  font-family:var(--f-mono); font-size:9px; text-transform:uppercase;
  letter-spacing:.08em; color:#9FB1C8; line-height:1.2;
}
@media (max-width:760px){ .flap-counters{ display:none; } }

/* ---------- Layout with ad rails ---------- */
.page-shell{
  display:grid;
  grid-template-columns: minmax(0,220px) minmax(0,1fr) minmax(0,220px);
  gap:var(--sp-5);
  max-width:1440px; margin:0 auto;
  padding:var(--sp-5);
  align-items:start;
}
@media (max-width:1180px){
  .page-shell{ grid-template-columns: 1fr; }
  .ad-rail{ display:none; }
}

.ad-rail{ position:sticky; top:calc(var(--header-h) + var(--sp-4)); display:flex; flex-direction:column; gap:var(--sp-4); }
.ad-slot{
  display:block; border-radius:var(--radius-m); overflow:hidden;
  border:1px solid var(--line); background:var(--paper);
  box-shadow:var(--shadow-card); text-decoration:none;
  transition:transform .15s ease, box-shadow .15s ease;
}
.ad-slot:hover{ transform:translateY(-2px); box-shadow:var(--shadow-pop); }
.ad-slot img{ width:100%; height:auto; }
.ad-slot .ad-tag{
  font-family:var(--f-mono); font-size:9px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); padding:4px 8px;
  border-top:1px dashed var(--line-soft);
}
.ad-mobile{ display:none; }
@media (max-width:1180px){
  .ad-mobile{
    display:block; max-width:640px; margin:0 auto var(--sp-5);
    aspect-ratio:4/1; max-height:160px;
  }
  /* object-fit:contain evita que a arte fique cortada ou distorcida
     e o max-height acima garante que o anúncio nunca vire uma tela
     inteira, mesmo se a imagem enviada não tiver as proporções ideais. */
  .ad-mobile img{ width:100%; height:100%; object-fit:contain; }
}

.main-col{ min-width:0; max-width:900px; margin:0 auto; width:100%; }

/* ---------- Hero / intro ---------- */
.hero{
  text-align:center; padding:var(--sp-6) var(--sp-4) var(--sp-5);
}
.hero .eyebrow{
  font-family:var(--f-mono); font-size:11px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--ok); background:var(--ok-tint);
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 12px; border-radius:999px; margin-bottom:var(--sp-4);
}
.hero .eyebrow .dot{ width:6px; height:6px; border-radius:50%; background:var(--ok); }
.hero h1{
  font-family:var(--f-display); font-weight:700; font-size:clamp(28px,5vw,42px);
  line-height:1.12; margin:0 0 var(--sp-3);
  color:var(--brand);
}
.hero h1 em{ color:var(--accent); font-style:normal; }
.hero p{ color:var(--ink-soft); max-width:520px; margin:0 auto; font-size:16px; }

/* ---------- Stepper ---------- */
.stepper{
  display:flex; align-items:center; justify-content:center;
  gap:0; margin:var(--sp-6) 0 var(--sp-5); overflow-x:auto; padding-bottom:2px;
}
.step-pill{
  display:flex; align-items:center; gap:8px;
  padding:9px 16px; border-radius:999px; white-space:nowrap;
  font-size:13px; font-weight:600; color:var(--muted);
  background:transparent; border:1px solid transparent; cursor:pointer;
  min-height:40px;
}
.step-pill .num{
  width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--line-soft); font-family:var(--f-mono); font-size:10.5px; color:var(--ink-soft);
}
.step-pill.is-active{ background:var(--brand-tint); color:var(--brand); }
.step-pill.is-active .num{ background:var(--brand); color:#fff; }
.step-pill.is-done .num{ background:var(--ok); color:#fff; }
.step-pill.is-done .num::before{ content:"✓"; }
.step-connector{ width:16px; height:1px; background:var(--line); flex:none; }

/* ---------- Card / Panels ---------- */
.panel{
  background:var(--paper); border:1px solid var(--line); border-radius:var(--radius-l);
  box-shadow:var(--shadow-card); padding:var(--sp-7) var(--sp-6);
}
@media (max-width:640px){ .panel{ padding:var(--sp-5) var(--sp-4); border-radius:var(--radius-m); } }

.panel h2{
  font-family:var(--f-display); font-size:20px; margin:0 0 4px; color:var(--brand);
}
.panel .step-hint{ color:var(--muted); font-size:13.5px; margin:0 0 var(--sp-5); }

/* ---------- Form elements ---------- */
.field-grid{ display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-4) var(--sp-5); }
.field-grid.cols-3{ grid-template-columns:1fr 1fr 1fr; }
@media (max-width:600px){ .field-grid, .field-grid.cols-3{ grid-template-columns:1fr; } }

.field{ display:flex; flex-direction:column; gap:7px; margin-bottom:var(--sp-5); }
.field label{
  font-size:13px; font-weight:600; color:var(--ink-soft);
  display:flex; justify-content:space-between; gap:6px;
}
.field label .opt{ font-weight:400; color:var(--muted); font-size:11.5px; }
.field input, .field select, .field textarea{
  border:1.5px solid var(--line); border-radius:var(--radius-s);
  padding:12px 14px; font-size:15px; font-family:var(--f-body);
  color:var(--ink); background:#fff; width:100%; min-height:46px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.field textarea{ resize:vertical; min-height:96px; line-height:1.55; }
.field input:focus, .field select:focus, .field textarea:focus{
  outline:none; border-color:var(--brand-2); box-shadow:0 0 0 3px var(--brand-tint);
}
.field .hint{ font-size:11.5px; color:var(--muted); }
.field.error input, .field.error textarea{ border-color:var(--warn); }
.field .error-msg{ font-size:11.5px; color:var(--warn); display:none; }
.field.error .error-msg{ display:block; }

/* Campo de data (dd/mm/aaaa com máscara + botão de calendário) */
.date-input{ position:relative; }
.date-input input[type="text"]{ padding-right:42px; letter-spacing:.02em; font-variant-numeric:tabular-nums; }
.date-input-cal{
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  width:36px; height:36px; border:none; background:transparent; border-radius:var(--radius-s);
  font-size:16px; cursor:pointer; color:var(--muted);
  display:flex; align-items:center; justify-content:center;
}
.date-input-cal:hover{ background:var(--brand-tint); }
.date-input-native{
  position:absolute; inset:0; width:1px; height:1px; opacity:0; pointer-events:none;
}

.check-row{ display:flex; align-items:flex-start; gap:10px; padding:12px 0; }
.check-row input[type=checkbox]{ margin-top:3px; width:16px; height:16px; accent-color:var(--brand); }
.check-row label{ font-size:13.5px; color:var(--ink-soft); }

.suggest-btn{
  border:1px dashed var(--brand-2); background:var(--brand-tint); color:var(--brand-2);
  font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:999px; cursor:pointer;
}
.suggest-btn:hover{ background:var(--brand); color:#fff; border-color:var(--brand); }

/* Photo uploader */
.photo-upload{
  display:flex; align-items:center; gap:var(--sp-4); padding:var(--sp-4);
  border:1.5px dashed var(--line); border-radius:var(--radius-m); background:var(--paper-alt);
}
.photo-preview{
  width:76px; height:76px; border-radius:50%; background:var(--bg-deep);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  border:2px solid var(--line); flex:none; color:var(--muted); font-size:11px; text-align:center;
}
.photo-preview img{ width:100%; height:100%; object-fit:cover; }
.photo-actions{ display:flex; flex-direction:column; gap:6px; }

/* Repeatable list items (experiências) */
.repeat-list{ display:flex; flex-direction:column; gap:var(--sp-4); }
.repeat-item{
  border:1px solid var(--line); border-radius:var(--radius-m); padding:var(--sp-4);
  background:var(--paper-alt); position:relative;
}
.repeat-item .repeat-head{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--sp-3);
}
.repeat-item .repeat-title{ font-weight:700; font-size:13px; color:var(--brand); }
.item-remove{
  border:none; background:none; color:var(--warn); font-size:12px; font-weight:600;
  cursor:pointer; padding:4px 8px; border-radius:6px;
}
.item-remove:hover{ background:#FCEAE1; }
.add-item-btn{
  border:1.5px dashed var(--brand-2); background:#fff; color:var(--brand-2);
  border-radius:var(--radius-m); padding:12px; font-weight:700; font-size:13.5px;
  cursor:pointer; width:100%; display:flex; align-items:center; justify-content:center; gap:6px;
}
.add-item-btn:hover{ background:var(--brand-tint); }

/* ---------- Buttons ---------- */
.btn{
  font-family:var(--f-body); font-weight:700; font-size:14.5px;
  padding:13px 24px; min-height:48px; border-radius:999px; border:1.5px solid transparent;
  cursor:pointer; display:inline-flex; align-items:center; gap:8px; justify-content:center;
  transition:transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--accent); color:#fff; box-shadow:0 8px 20px -8px rgba(255,122,48,.65); }
.btn-primary:hover{ background:var(--accent-dark); }
.btn-ghost{ background:transparent; color:var(--brand); border-color:var(--line); }
.btn-ghost:hover{ background:var(--brand-tint); }
.btn-dark{ background:var(--brand); color:#fff; }
.btn-dark:hover{ background:var(--brand-2); }
.btn[disabled]{ opacity:.45; cursor:not-allowed; }
.btn-block{ width:100%; }

.wizard-actions{
  display:flex; justify-content:space-between; align-items:stretch; gap:var(--sp-3);
  margin-top:var(--sp-6); padding-top:var(--sp-5); border-top:1px solid var(--line-soft);
}
/* Botões do mesmo tamanho lado a lado — antes um ficava largo (Avançar)
   e o outro estreito (Voltar), dando a sensação de botões desproporcionais. */
.wizard-actions .btn{ flex:1; max-width:220px; }
@media (max-width:480px){ .wizard-actions .btn{ max-width:none; font-size:14px; padding:13px 14px; } }

/* ---------- Template gallery ---------- */
.tpl-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:var(--sp-4);
}
.tpl-card{
  border:2px solid var(--line); border-radius:var(--radius-m); overflow:hidden;
  cursor:pointer; background:#fff; text-align:left; padding:0;
  transition:border-color .15s ease, transform .15s ease;
}
.tpl-card:hover{ transform:translateY(-3px); }
.tpl-card.is-selected{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-tint); }
.tpl-thumb{
  height:118px; display:flex; flex-direction:column; padding:10px 12px; gap:5px;
  background:linear-gradient(180deg,#fff, #F7F8FB);
}
.tpl-thumb .bar{ height:6px; border-radius:3px; background:var(--brand); width:60%; }
.tpl-thumb .ln{ height:4px; border-radius:2px; background:var(--line); }
.tpl-thumb .ln.w80{ width:80%; } .tpl-thumb .ln.w60{ width:60%; } .tpl-thumb .ln.w40{ width:40%; }
.tpl-meta{ padding:10px 12px 12px; border-top:1px solid var(--line-soft); }
.tpl-meta .tpl-name{ font-weight:700; font-size:13.5px; color:var(--ink); }
.tpl-meta .tpl-desc{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.tpl-meta .tpl-badge{
  display:inline-block; margin-top:6px; font-size:9.5px; font-family:var(--f-mono);
  text-transform:uppercase; letter-spacing:.06em; color:var(--ok); background:var(--ok-tint);
  padding:2px 7px; border-radius:999px;
}

/* ---------- Preview toggle (mobile) ---------- */
.view-toggle{ display:none; gap:8px; margin-bottom:var(--sp-5); }
@media (max-width:900px){ .view-toggle{ display:flex; } }
.view-toggle button{
  flex:1; min-height:46px; padding:11px; border-radius:var(--radius-s); border:1.5px solid var(--line);
  background:#fff; font-weight:700; font-size:13.5px; color:var(--ink-soft); cursor:pointer;
}
.view-toggle button.is-active{ background:var(--brand); color:#fff; border-color:var(--brand); }

/* ---------- Split view: form + live preview ---------- */
.split-view{ display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-5); align-items:start; }
.split-view > *{ min-width:0; } /* evita que a folha A4 (escalada) force o grid a estourar a largura da tela */
@media (max-width:900px){
  .split-view{ grid-template-columns:1fr; }
  .preview-col.is-hidden-mobile, .form-col.is-hidden-mobile{ display:none; }
}
.preview-col{ position:sticky; top:calc(var(--header-h) + var(--sp-4)); }
@media (max-width:900px){ .preview-col{ position:static; } }

.preview-frame{
  background:#DDE3EC; border-radius:var(--radius-l); padding:var(--sp-5);
  display:flex; justify-content:center; box-shadow:inset 0 2px 10px rgba(22,50,79,.08);
  overflow:hidden; max-width:100%;
}
#preview-surface{
  width:100%; max-width:560px; background:#fff; box-shadow:var(--shadow-pop);
  transform-origin:top center;
}

/* ---------- Footer ---------- */
.app-footer{
  text-align:center; padding:var(--sp-7) var(--sp-4) var(--sp-6);
  color:var(--muted); font-size:12.5px;
}
.app-footer a{ color:var(--brand-2); text-decoration:none; }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:24px; transform:translate(-50%,120%);
  background:var(--ink); color:#fff; padding:12px 18px; border-radius:999px;
  font-size:13.5px; font-weight:600; box-shadow:var(--shadow-pop);
  transition:transform .25s ease; z-index:100; display:flex; align-items:center; gap:8px;
}
.toast.is-visible{ transform:translate(-50%,0); }
.toast .dot{ width:7px; height:7px; border-radius:50%; background:var(--ok); }

/* scrollbar niceties for stepper on mobile */
.stepper::-webkit-scrollbar{ height:4px; }
.stepper::-webkit-scrollbar-thumb{ background:var(--line); border-radius:4px; }

/* Cópia usada só para gerar o PDF (ver css/print.css) — nunca deve
   aparecer na tela normal. Antes ficava sem nenhuma regra aqui, então
   uma cópia inteira do currículo (794px de largura) sobrava solta na
   página, causando o "estouro" horizontal e uma sobra enorme embaixo. */
#print-root{ display:none; }
