* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --blue: #1560f5;
  --blue-dark: #0a1a5c;
  --blue-mid: #1245b8;
  --blue-light: #eef3ff;
  --blue-pale: #f5f8ff;
  --bg: #f4f7fe;
  --border: #dde4ff;
  --border-strong: #c0ccee;
  --text: #0d1b4b;
  --text-2: #2a3a6a;
  --muted: #6b7baa;
  --muted-light: #9caad4;
  --green: #1b8c5a;
  --green-bg: #e6f7ef;
  --red: #e53935;
  --orange: #e67e22;
  --orange-bg: #fef3e8;
  --shadow-sm: 0 1px 4px rgba(21, 96, 245, 0.09);
  --radius: 10px;
  --radius-sm: 6px;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* HEADER */
.header {
  background: linear-gradient(135deg, #0a1a5c 0%, #0d2a8a 100%);
  padding: 24px 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  top: -200px;
  right: -100px;
  pointer-events: none;
}
.header-logo {
  position: relative;
  z-index: 1;
  height: 32px;
  display: block;
  filter: brightness(0) invert(1);
  margin-bottom: 10px;
}
.header-badge {
  background: rgba(21, 96, 245, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.header-title {
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}
.header-sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 500px;
  line-height: 1.5;
}

/* LAYOUT */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* STEPS */
.steps {
  display: flex;
  margin-bottom: 26px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 4px;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
  cursor: default;
}
.step:last-child {
  border-right: none;
}
.step.active {
  background: var(--blue-light);
}
.step.done {
  background: var(--green-bg);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.step.active .step-num {
  background: var(--blue);
  color: #fff;
}
.step.done .step-num {
  background: var(--green);
  color: #fff;
}
.step-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.step.active .step-label {
  color: var(--blue);
}
.step.done .step-label {
  color: var(--green);
}

/* CARD */
.card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.card-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* FORM */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-label span {
  color: var(--red);
}
.field-hint {
  font-size: 11.5px;
  color: var(--muted-light);
  line-height: 1.4;
}
input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  font-family: "Inter", sans-serif;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}
textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}
select {
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 30px 9px 11px;
  outline: none;
  width: 100%;
  font-family: "Inter", sans-serif;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7BAA' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

/* LOGOS UPLOAD */
.logo-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.logo-upload:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.logo-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.logo-preview {
  max-height: 54px;
  max-width: 160px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.logo-upload-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.logo-upload-label strong {
  color: var(--blue);
}
.logo-upload-hint {
  font-size: 10.5px;
  color: var(--muted-light);
  margin-top: 2px;
}

/* ELIST */
.elist-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}
.elist-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--blue-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.elist-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.elist-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-light);
  font-size: 16px;
  line-height: 1;
  padding: 0 3px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.elist-del:hover {
  color: var(--red);
}
.elist-add-row {
  display: flex;
  gap: 6px;
}
.elist-add-row input {
  flex: 1;
}
.elist-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: 1.5px dashed var(--border);
  background: #fff;
  color: var(--blue);
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.elist-add-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

/* CHIPS */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.chip {
  font-size: 11.5px;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid rgba(21, 96, 245, 0.2);
  border-radius: 4px;
  padding: 3px 9px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
  user-select: none;
}
.chip:hover {
  background: #d4e0ff;
}

/* PRAZO */
.prazo-row {
  display: flex;
  gap: 7px;
}
.prazo-num {
  width: 85px !important;
  flex-shrink: 0;
}
.prazo-sel {
  flex: 1;
}

/* CHECKBOXES */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 6px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.check-item:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.check-item.checked {
  border-color: var(--blue);
  background: var(--blue-light);
}
.check-item input {
  display: none;
}
.check-box {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.check-item.checked .check-box {
  background: var(--blue);
  border-color: var(--blue);
}
.check-box svg {
  display: none;
  color: #fff;
}
.check-item.checked .check-box svg {
  display: block;
}
.check-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  line-height: 1.3;
}

/* TAGS */
.tag-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 42px;
  cursor: text;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  background: #fff;
}
.tag-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-light);
  color: var(--blue-mid);
  border: 1px solid rgba(21, 96, 245, 0.2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 500;
}
.tag-x {
  cursor: pointer;
  opacity: 0.6;
  font-size: 13px;
  line-height: 1;
}
.tag-x:hover {
  opacity: 1;
}
.tag-input {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  color: var(--text);
  background: transparent;
  padding: 2px 3px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21, 96, 245, 0.3);
}
.btn-primary:hover {
  background: var(--blue-mid);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}
.btn-ghost:hover {
  color: var(--text);
}
.btn-green {
  background: var(--green);
  color: #fff;
}
.btn-green:hover {
  background: #157a4c;
}
.btn-lg {
  padding: 13px 28px;
  font-size: 14.5px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}
.btn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* PROMPT SCREEN */
.pstep {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.pstep-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pstep-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.pstep-text strong {
  color: var(--text);
}
.ai-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}
.ai-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.ai-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
#prompt-box {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: "Inter", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

/* EDITOR DE RESULTADO */
#editor-wrap {
  position: relative;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.12s;
}
.tb-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.result-doc {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  line-height: 1.75;
  font-size: 13.5px;
  color: var(--text-2);
  outline: none;
  min-height: 300px;
}
.result-doc:focus {
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}

/* ESTILOS DO DOCUMENTO */
.result-doc .doc-logos {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border);
  gap: 20px;
}
.result-doc .doc-logo-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.result-doc .doc-logo-box img {
  max-height: 50px;
  max-width: 150px;
  object-fit: contain;
}
.result-doc .doc-logo-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.result-doc h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.result-doc h1.doc-titulo {
  font-size: 23px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.doc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.result-doc h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--doc-primary, var(--blue));
  margin: 18px 0 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.result-doc h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}
.result-doc h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 7px;
}
.result-doc p {
  line-height: 1.75;
  margin-bottom: 10px;
}
.result-doc ul,
ol {
  padding-left: 18px;
  margin-bottom: 12px;
}
.result-doc li {
  line-height: 1.7;
  margin-bottom: 3px;
}
.result-doc strong {
  color: var(--text);
  font-weight: 700;
}
.result-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 13px 0;
  font-size: 12.5px;
}
.result-doc th {
  background: var(--blue-light);
  color: var(--blue-mid);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
}
.result-doc td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.result-doc tr:nth-child(even) td {
  background: var(--bg);
}

/* ORIENTAÇÕES — destaque laranja, removíveis */
.result-doc .orientacao {
  background: var(--orange-bg);
  border: 1.5px solid #f0c090;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 12.5px;
  color: #7a3c00;
  line-height: 1.6;
  position: relative;
}
.result-doc .orientacao::before {
  content: "⚠️ ORIENTAÇÃO — remover antes de enviar ao cliente";
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--orange);
  margin-bottom: 5px;
}
.result-doc .orientacao .rm-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #c0692a;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.15s;
  font-family: "Inter", sans-serif;
}
.result-doc .orientacao .rm-btn:hover {
  background: #fde4c8;
}

/* DOWNLOADS */
.dl-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--blue-dark);
  border-radius: var(--radius);
  margin-top: 18px;
  align-items: center;
}
.dl-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-dl:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-dl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-dl svg {
  flex-shrink: 0;
}

/* CTA */
.doc-assinaturas {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  flex-wrap: wrap;
}
.assinatura-box {
  flex: 1;
  min-width: 160px;
  text-align: center;
}
.assinatura-linha {
  border-top: 1.5px solid var(--text);
  margin-bottom: 8px;
  width: 100%;
}
.assinatura-nome {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.assinatura-cargo {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}
.assinatura-local {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
  padding-bottom: 24px;
}
/* Rodapé informativo do contratado */
.doc-rodape {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.doc-rodape-col-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--doc-primary, var(--blue));
  margin-bottom: 8px;
}
.doc-rodape-col table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.doc-rodape-col td {
  padding: 2px 0;
  color: var(--text-2);
  vertical-align: top;
  line-height: 1.5;
}
.doc-rodape-col td:first-child {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-right: 10px;
  white-space: nowrap;
  width: 1%;
}
/* ATT block no topo do documento */
.doc-att {
  margin-bottom: 22px;
  padding: 14px 18px;
  background: var(--blue-pale);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}
.doc-att strong {
  color: var(--text);
  font-weight: 700;
}
/* Título principal — Proposta de serviços */
.doc-titulo-proposta {
  font-size: 26px;
  font-weight: 900;
  color: var(--doc-secondary, var(--text));
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
  text-align: center;
}
.doc-subtitulo-tipo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border);
  text-align: center;
}
/* Títulos de seção menores */
/* h2 override inline removido — definido no @media print */
/* Renomear "Objeto do Contrato" — feito via filtro JS */
/* Data e validade da proposta — bloco abaixo do rodapé de partes */
.doc-data-validade {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.doc-data-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-data-label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-data-valor {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}
/* Rodapé antigo — manter referência para não quebrar */
.doc-rodape-contratado {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.rodape-contratado-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.rodape-contratado-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.rodape-contratado-info span {
  white-space: nowrap;
}
/* Botões seletor IA */
.ai-sel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-sel-btn:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.ai-sel-btn.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}
/* Rodapé timbrado */
.rodape-doc {
  border-top: 1.5px solid var(--border);
  margin-top: 32px;
  padding-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
}
/* Salvar/Importar */
.save-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.save-bar-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: 4px;
  white-space: nowrap;
}
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-2);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-save:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-pale);
}
.btn-save-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-save-primary:hover {
  background: var(--blue-mid);
}
.cta-box {
  background: linear-gradient(135deg, #0a1a5c 0%, #0d2a8a 100%);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.cta-box h3 {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
}
.cta-box p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
}
.btn-white {
  background: #fff;
  color: #0a1a5c;
  font-weight: 700;
}
.btn-white:hover {
  background: var(--blue-light);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0a1a5c;
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .header {
    padding: 20px 18px 24px;
  }
  .container {
    padding: 20px 14px 60px;
  }
  .card {
    padding: 16px 15px 14px;
  }
  .result-doc {
    padding: 20px 15px;
  }
  .cta-box {
    padding: 18px;
  }
  .prazo-num {
    width: 70px !important;
  }
}
@media print {
  @page {
    size: A4;
    margin: 2cm;
  }
  .header,
  .steps,
  .btn-actions,
  .toast,
  .cta-box,
  .dl-bar,
  #section-form,
  #section-prompt,
  .editor-toolbar,
  .result-actions-bar,
  #save-bar,
  .orientacao,
  [onclick="resetForm()"] {
    display: none !important;
  }
  /* Esconder bloco "Remover orientações" + hint acima da dl-bar */
  #section-result > div:has(button[onclick="removerTodasOrientacoes()"]) {
    display: none !important;
  }
  .result-doc {
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }
  /* Evitar quebra de página em elementos críticos */
  h2,
  h3 {
    page-break-after: avoid;
  }
  p {
    orphans: 3;
    widows: 3;
  }
  table,
  ul,
  ol,
  .doc-logos,
  .doc-rodape,
  .doc-data-validade,
  .doc-att {
    page-break-inside: avoid;
  }
  li {
    page-break-inside: avoid;
  }
  /* Papel timbrado como fundo de página */
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* H1 comum */
  .result-doc h1 {
    font-size: 16pt !important;
    margin-bottom: 6pt;
  }
  /* Título principal da proposta (caixa alta) — fonte maior */
  .result-doc h1.doc-titulo {
    font-size: 22pt !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em;
    margin-bottom: 10pt;
  }
  /* Logos vazios: esconder box placeholder no print */
  .doc-logo-placeholder {
    display: none !important;
  }
  /* Rodapé informativo limpo no PDF */
  .doc-rodape {
    page-break-inside: avoid;
  }
  .doc-rodape-contratado {
    page-break-inside: avoid;
  }
  .doc-data-validade {
    page-break-inside: avoid;
  }
  /* ATT block no PDF */
  .doc-att {
    background: none !important;
    border-left: 2pt solid #1560f5 !important;
    padding: 8pt 12pt !important;
  }
  /* Rodapé timbrado — visível no PDF */
  .rodape-doc {
    display: block !important;
    border-top: 0.5pt solid #ccc;
    margin-top: 12pt;
    padding-top: 8pt;
    font-size: 9pt;
    color: #888;
    text-align: center;
    page-break-inside: avoid;
  }
  /* Títulos de seção menores no PDF */
  .result-doc h2 {
    font-size: 9pt !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
  }
  /* Título proposta maior no PDF */
  .doc-titulo-proposta {
    font-size: 26pt !important;
    margin-bottom: 4pt;
  }
  .doc-subtitulo-tipo {
    font-size: 12pt !important;
    margin-bottom: 16pt;
  }
  body {
    background: #fff;
  }
}
