:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #202a36;
  --muted: #5c6875;
  --line: #d9dee4;
  --accent: #0f766e;
  --accent-dark: #0b514c;
  --warm: #be6a2c;
  --soft: #e9f5f2;
  --shadow: 0 18px 44px rgba(32, 42, 54, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

input, textarea, select, button { font: inherit; }
a { color: inherit; }

.site-header {
  background: #213140;
  color: #fff;
  padding: 24px;
}

.topbar, .hero, .page-shell, .site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

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

.brand, .site-nav a, .footer-nav a {
  text-decoration: none;
  font-weight: 800;
}

.site-nav, .footer-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a { color: #eef7f5; }
.site-nav a:hover, .footer-nav a:hover { text-decoration: underline; }

.language-switch {
  display: grid;
  gap: 6px;
  width: min(230px, 100%);
  font-weight: 700;
}

.language-switch select {
  min-height: 42px;
  border: 1px solid #c7d0d8;
  border-radius: 6px;
  padding: 8px 10px;
}

.hero {
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--warm);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.04; }
h2 { margin: 0 0 14px; font-size: 1.25rem; }
h3 { margin: 16px 0 6px; font-size: 1rem; }
.hero p:last-child { max-width: 760px; color: #dce8e5; font-size: 1.06rem; }

.page-shell {
  display: grid;
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr) minmax(112px, 150px);
  gap: 18px;
  align-items: start;
  padding: 24px 0 34px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(0, 1fr);
  gap: 18px;
}

.panel, .content-card, .ad-slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel, .content-card { padding: 20px; }
.form-panel { align-self: start; }

form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; font-weight: 800; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

input, textarea {
  width: 100%;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.25);
  outline-offset: 2px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend { padding: 0 6px; font-weight: 900; }

.template-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

button:hover { background: var(--accent-dark); }
button.secondary { background: #55616f; }

.preview-panel { overflow: hidden; }

.cv-page {
  min-height: 760px;
  background: #fff;
  border: 1px solid #cfd6de;
  border-radius: 8px;
  padding: 34px;
  color: #1d2733;
}

.cv-header { border-bottom: 2px solid #1d2733; padding-bottom: 14px; margin-bottom: 18px; }
.cv-name { margin: 0; font-size: 2rem; line-height: 1.1; }
.cv-title { margin: 6px 0 0; color: var(--muted); font-weight: 800; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.cv-section { margin-top: 18px; }
.cv-section h3 { margin: 0 0 8px; color: var(--accent-dark); text-transform: uppercase; font-size: 0.84rem; }
.cv-section p { margin: 0; white-space: pre-line; }

.template-modern .cv-header {
  border: 0;
  background: var(--soft);
  border-left: 6px solid var(--accent);
  padding: 20px;
  border-radius: 8px;
}

.template-modern .cv-section h3 { color: var(--accent); }

.template-compact {
  padding: 24px;
  font-size: 0.9rem;
}

.template-compact .cv-name { font-size: 1.55rem; }
.template-compact .cv-section { margin-top: 12px; }
.template-compact .cv-header { margin-bottom: 12px; padding-bottom: 10px; }

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.faq-card { grid-row: span 2; }
.content-card p, .content-card li { color: var(--muted); }

.ad-slot {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #65717d;
  background: #f8faf9;
  border-style: dashed;
  text-align: center;
  font-size: 0.88rem;
}

.mobile-ad {
  display: none;
  min-height: 92px;
  margin-top: 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 0 28px;
  color: var(--muted);
}

.footer-nav { color: var(--accent-dark); }

@media (max-width: 920px) {
  .page-shell, .tool-shell, .content-grid, .field-grid {
    grid-template-columns: 1fr;
  }

  .side-ad { display: none; }
  .mobile-ad { display: grid; }
  .template-options { grid-template-columns: 1fr; }
  .cv-page { padding: 22px; min-height: auto; }
}

@media print {
  body { background: #fff; }
  .site-header, .form-panel, .content-grid, .ad-slot, .site-footer, .section-head {
    display: none;
  }
  .page-shell, .tool-shell {
    display: block;
    width: 100%;
    padding: 0;
  }
  .preview-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .cv-page {
    border: 0;
    border-radius: 0;
    min-height: auto;
    padding: 0;
  }
}
