/* --- Variáveis de Estilo Moderno --- */
:root {
  --bg-body: #020617;
  --bg-card: #0f172a;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #60a5fa;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 8%;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

header a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  transition: 0.3s;
}

header a:hover { color: var(--white); }

/* --- Layout Principal --- */
.container {
  display: grid;
  grid-template-columns: 400px 1fr; /* Coluna fixa para o form, flexível para o preview */
  gap: 2rem;
  padding: 2rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Formulário de Entrada --- */
.formulario {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  height: fit-content;
  position: sticky; /* Mantém o formulário visível ao rolar o currículo longo */
  top: 100px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.formulario h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}

input, textarea {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.9rem;
  transition: 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea { min-height: 100px; resize: none; }

button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

/* Estilo Botão Preview */
button[onclick="gerarPreview()"] {
  background: #334155;
  color: var(--white);
}

/* Estilo Botão Baixar */
button[onclick="baixarPDF()"] {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

/* --- Area do Preview (O Currículo em si) --- */
.preview {
  background: var(--white);
  color: #1e293b;
  padding: 60px;
  border-radius: 4px; /* Mais quadrado para parecer papel */
  min-height: 842px; /* Altura proporcional ao A4 */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: 0.3s;
}

/* Estilização interna do Currículo */
.preview h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 5px;
  letter-spacing: -1px;
}

.preview #previewCargo {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.preview hr {
  border: 0;
  border-top: 2px solid #f1f5f9;
  margin: 20px 0;
}

.preview h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  color: #0f172a;
  margin: 30px 0 10px;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
}

.preview p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.preview ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 10px;
}

.preview ul li {
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* --- Responsividade --- */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  .formulario {
    position: static;
    order: 2;
  }
  
  .preview {
    order: 1;
    padding: 30px;
    min-height: auto;
  }
}

/* Ajuste fino para a exportação do PDF não sair com bordas arredondadas */
@media print {
    .preview {
        box-shadow: none;
        border: none;
    }
}