:root {
  --ink: #172033;
  --muted: #64748b;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --line: #dce4ef;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent: #0891b2;
  --success: #059669;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 4%, rgba(79, 70, 229, .1), transparent 28rem),
    radial-gradient(circle at 96% 24%, rgba(8, 145, 178, .08), transparent 25rem),
    var(--canvas);
  font-family: "Plus Jakarta Sans", sans-serif;
}

button, input, textarea { font: inherit; }
input, textarea { user-select: text; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(220, 228, 239, .85);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.header-inner,
.page-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .22);
}

.back-link {
  color: var(--muted);
  font-size: 13px;
  transition: color .2s ease, transform .2s ease;
}

.back-link:hover { color: var(--primary); transform: translateX(-2px); }

.page-shell { padding: 52px 0 72px; }

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  color: #111827;
  font-family: Montserrat, sans-serif;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.page-intro p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(.92rem, 1.6vw, 1.05rem);
  line-height: 1.75;
}

.privacy-note {
  max-width: 280px;
  padding: 16px 18px;
  border: 1px solid rgba(8, 145, 178, .2);
  border-radius: 18px;
  color: #0f5f73;
  background: rgba(236, 254, 255, .72);
  font-size: 12px;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(440px, .82fr) minmax(520px, 1.18fr);
  gap: 28px;
  align-items: start;
}

.editor-panel,
.preview-panel {
  border: 1px solid rgba(220, 228, 239, .9);
  border-radius: 30px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 70px rgba(30, 41, 59, .09);
}

.editor-panel { overflow: hidden; }

.panel-section { padding: 26px; border-bottom: 1px solid var(--line); }
.panel-section:last-child { border-bottom: 0; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.preview-heading h2 {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.section-heading p,
.preview-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.model-label {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #eef2ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.model-card {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.model-card:hover { transform: translateY(-2px); border-color: #a5b4fc; box-shadow: 0 12px 28px rgba(79, 70, 229, .1); }
.model-card:focus-visible { outline: 3px solid rgba(79, 70, 229, .25); outline-offset: 2px; }
.model-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, .13); }
.model-card.is-selected::after {
  content: "\f00c";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font: 900 9px "Font Awesome 6 Free";
}

.model-card strong { display: block; margin-top: 8px; font-size: 11px; }
.model-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.model-thumb { height: 78px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.model-thumb-classic { padding: 10px; }
.model-thumb-classic span { display: block; height: 3px; margin-bottom: 5px; border-radius: 4px; background: #cbd5e1; }
.model-thumb-classic span:first-child { width: 55%; height: 7px; background: #1e293b; }
.model-thumb-classic span:nth-child(3) { width: 32%; margin-top: 10px; background: var(--primary); }
.model-thumb-sidebar { display: grid; grid-template-columns: 34% 66%; }
.model-thumb-sidebar::before { content: ""; background: linear-gradient(180deg, #3f3f46, #52525b); }
.model-thumb-sidebar::after { content: ""; background: linear-gradient(#a9cad8 0 24%, #fff 24%); }
.model-thumb-timeline { padding: 10px; background: linear-gradient(#f8fafc 0 26%, #fff 26%); }
.model-thumb-timeline::before { content: ""; display: block; width: 50%; height: 8px; margin-bottom: 17px; border-radius: 2px; background: #334155; }
.model-thumb-timeline::after { content: ""; display: block; height: 30px; border-left: 3px solid #16a34a; background: repeating-linear-gradient(to bottom, #e2e8f0 0 3px, transparent 3px 8px); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #334155; font-size: 11px; font-weight: 800; }
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: #f8fafc;
  font-size: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.field input:focus,
.field textarea:focus { outline: 0; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, .1); }

.experience-title { grid-column: 1 / -1; margin: 6px 0 -2px; font-size: 12px; font-weight: 800; }
.experience-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #f8fafc; }
.experience-card span { color: var(--primary); font-size: 10px; font-weight: 800; }

.download-area { padding: 22px 26px 26px; background: #f8fafc; }
.download-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--success);
  box-shadow: 0 15px 30px rgba(5, 150, 105, .2);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.download-button:hover { transform: translateY(-2px); background: #047857; box-shadow: 0 18px 36px rgba(5, 150, 105, .25); }
.download-button:disabled { opacity: .65; cursor: wait; transform: none; }

.preview-panel { position: sticky; top: 96px; padding: 22px; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; color: #047857; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 5px rgba(16, 185, 129, .12); }
.preview-stage { overflow: auto; padding: 28px; border-radius: 22px; background: #253047; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
#preview-render { width: 750px; min-height: 970px; margin: 0 auto; background: #fff; box-shadow: 0 24px 60px rgba(2, 6, 23, .28); transform-origin: top left; }

#cv-template-container { position: absolute; left: -9999px; top: -9999px; }
#cv-template, #preview-render > div { width: 750px; min-height: 970px; padding: 50px; color: #111; background: #fff; font-family: Montserrat, sans-serif; }
.cv-header { margin-bottom: 25px; padding: 20px 0; border-top: 2px solid #111; border-bottom: 2px solid #111; }
.cv-nome { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; }
.cv-contatos { display: flex; align-items: center; gap: 25px; margin-top: 15px; }
.cv-contato-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.cv-icon-circle { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: #111; font-size: 10px; }
.cv-section { margin-bottom: 22px; }
.cv-titulo { margin-bottom: 10px; color: #111; font-size: 14px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; }
.cv-texto { color: #111; font-size: 12.5px; font-weight: 500; line-height: 1.6; }
.cv-list-bullet { margin: 0; padding-left: 20px; list-style: disc; }
.cv-list-bullet li { margin-bottom: 4px; color: #111; font-size: 12.5px; font-weight: 500; line-height: 1.6; }
.exp-bloco { margin-bottom: 14px; }
.exp-subtitulo { display: block; margin-bottom: 4px; color: #111; font-size: 12.5px; font-weight: 800; }
.exp-detalhes { padding-left: 15px; color: #111; font-size: 12px; line-height: 1.5; }

#cv-template.cv-model-sidebar, #preview-render > .cv-model-sidebar { display: grid; grid-template-columns: 225px 525px; min-height: 1040px; padding: 0; }
.cv-sidebar { padding: 48px 26px; color: #fff; background: #414141; }
.cv-sidebar-contact { padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.75); text-align: center; }
.cv-sidebar-contact .cv-icon-circle { margin: 0 auto 8px; background: transparent; font-size: 15px; }
.cv-sidebar-contact .cv-contato-item { display: block; margin-bottom: 20px; color: #fff; font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.cv-sidebar-section { padding: 25px 0 20px; border-bottom: 1px solid rgba(255,255,255,.55); }
.cv-sidebar-section:last-child { border-bottom: 0; }
.cv-sidebar-title { margin-bottom: 15px; color: #fff; font-size: 15px; font-weight: 800; line-height: 1.25; text-transform: uppercase; }
.cv-sidebar .cv-list-bullet { padding-left: 16px; }
.cv-sidebar .cv-list-bullet li { color: #fff; font-size: 11px; font-weight: 500; line-height: 1.45; }
.cv-sidebar-main { background: #fff; }
.cv-sidebar-hero { padding: 56px 28px 42px; background: #a9cad8; }
.cv-sidebar-hero .cv-nome { font-size: 31px; font-weight: 500; letter-spacing: 2px; }
.cv-sidebar-hero .cv-cargo { margin-top: 9px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.cv-sidebar-content { padding: 35px 28px; }
.cv-model-sidebar .cv-section { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid #333; }
.cv-model-sidebar .cv-section:last-child { border-bottom: 0; }
.cv-model-sidebar .cv-titulo { font-size: 15px; }
.cv-model-sidebar .cv-texto, .cv-model-sidebar .cv-list-bullet li { font-size: 11.5px; line-height: 1.55; }
.cv-model-sidebar .exp-subtitulo { font-size: 11.5px; }
.cv-model-sidebar .exp-detalhes { font-size: 10.8px; }

#cv-template.cv-model-timeline, #preview-render > .cv-model-timeline { min-height: 1040px; padding: 42px 34px; color: #30343b; }
.cv-timeline-header { padding-bottom: 24px; }
.cv-timeline-header .cv-nome { color: #30343b; font-size: 29px; letter-spacing: -.5px; text-transform: none; }
.cv-timeline-header .cv-cargo { margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.cv-timeline-header .cv-texto { margin-top: 20px; color: #475569; font-size: 10px; line-height: 1.55; }
.cv-timeline-section { margin-bottom: 17px; }
.cv-timeline-title { margin-bottom: 13px; padding: 9px 13px; color: #4b5563; background: #f1f1f1; font-size: 14px; font-weight: 500; text-transform: uppercase; }
.cv-timeline-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 2px 8px; }
.cv-timeline-contact .cv-contato-item { display: block; font-size: 10px; font-weight: 500; }
.cv-timeline-contact strong { display: block; margin-bottom: 5px; font-size: 9px; text-transform: uppercase; }
.cv-timeline-list { margin-left: 7px; padding-left: 18px; border-left: 2px solid #16a34a; }
.cv-model-timeline .exp-bloco { position: relative; margin-bottom: 18px; }
.cv-model-timeline .exp-bloco::before { content: ""; position: absolute; top: 2px; left: -24px; width: 7px; height: 7px; background: #16a34a; }
.cv-model-timeline .exp-subtitulo { color: #374151; font-size: 11.5px; }
.cv-model-timeline .exp-detalhes { color: #4b5563; font-size: 9.5px; line-height: 1.55; }
.cv-model-timeline .cv-list-bullet { padding-left: 2px; columns: 2; column-gap: 28px; list-style: none; }
.cv-model-timeline .cv-list-bullet li { position: relative; padding-left: 15px; font-size: 10px; break-inside: avoid; }
.cv-model-timeline .cv-list-bullet li::before { content: ""; position: absolute; top: 7px; left: 0; width: 6px; height: 6px; background: #16a34a; }
.cv-model-timeline .cv-education-list { columns: 1; }

.donation-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .72); backdrop-filter: blur(12px); }
.donation-card { width: min(100%, 390px); padding: 30px; border-radius: 26px; background: #fff; box-shadow: 0 28px 80px rgba(2, 6, 23, .3); text-align: center; }
.donation-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 17px; color: var(--primary); background: #eef2ff; font-size: 21px; }
.donation-card h2 { margin: 0; font: 800 1.15rem Montserrat, sans-serif; }
.donation-card p { margin: 12px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pix-box { padding: 14px; border: 1px dashed #a5b4fc; border-radius: 18px; background: #f8fafc; }
.pix-box label { display: block; margin-bottom: 7px; color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pix-box input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: #475569; background: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.pix-box button, .confirm-download { width: 100%; margin-top: 10px; padding: 11px; border: 0; border-radius: 12px; color: #fff; background: var(--primary); font-size: 11px; font-weight: 800; cursor: pointer; }
.confirm-download { margin-top: 16px; background: var(--success); }
.skip-button { margin-top: 13px; border: 0; color: #94a3b8; background: transparent; font-size: 11px; text-decoration: underline; cursor: pointer; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-stage { max-height: none; }
}

@media (max-width: 720px) {
  .header-inner, .page-shell { width: min(100% - 28px, 1480px); }
  .header-inner { min-height: 62px; }
  .brand span { display: none; }
  .page-shell { padding: 34px 0 52px; }
  .page-intro { grid-template-columns: 1fr; gap: 18px; }
  .privacy-note { max-width: none; }
  .workspace { gap: 18px; }
  .editor-panel, .preview-panel { border-radius: 22px; }
  .panel-section, .preview-panel { padding: 18px; }
  .model-grid { grid-template-columns: 1fr; }
  .model-card { display: grid; grid-template-columns: 100px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
  .model-card strong, .model-card small { grid-column: 2; }
  .model-card strong { grid-row: 1; align-self: end; }
  .model-card small { grid-row: 2; align-self: start; }
  .model-thumb { grid-row: 1 / span 2; height: 66px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full, .experience-title { grid-column: auto; }
  .download-area { padding: 18px; }
  .preview-stage { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
