:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --border: #334155;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
  color: var(--text);
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 20px;
}

.panel {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.panel h2 {
  margin-top: 0;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.95rem;
  color: #cbd5e1;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.actions,
.preview-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
  color: var(--white);
}

button.secondary {
  background: #374151;
  color: var(--text);
}

.cv-preview {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 14px;
  padding: 28px;
  min-height: 900px;
}

.cv-doc h1,
.cv-doc h2,
.cv-doc h3,
.cv-doc p,
.cv-doc ul {
  margin-top: 0;
}

.cv-header {
  border-bottom: 2px solid #cbd5e1;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.cv-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.cv-role {
  font-size: 1.1rem;
  color: #334155;
  margin-bottom: 10px;
}

.cv-section {
  margin-bottom: 20px;
}

.cv-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0369a1;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-chip {
  padding: 6px 10px;
  background: #e0f2fe;
  border-radius: 999px;
  font-size: 0.9rem;
}

.exp-item {
  margin-bottom: 14px;
}

.exp-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.match-note {
  margin-top: 12px;
  font-size: 0.92rem;
  color: #475569;
  background: #f1f5f9;
  border-left: 4px solid #38bdf8;
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .cv-preview {
    min-height: 500px;
  }
}

@media print {
  body {
    background: white;
  }

  .hero,
  .input-panel,
  #downloadBtn {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .panel {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .cv-preview {
    padding: 0;
    border-radius: 0;
    min-height: auto;
  }
}
