:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --border: #e3e6ee;
  --text: #1b1e2b;
  --text-muted: #656b7a;
  --primary: #3457d5;
  --primary-dark: #2540a8;
  --good: #1c9c63;
  --good-bg: #e7f7ef;
  --warn: #c47a12;
  --warn-bg: #fbf1de;
  --bad: #c8402f;
  --bad-bg: #fbeae7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1340px;
}
.logo {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--primary); }
.logo-mark {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  flex: 0 0 auto;
}
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-header nav a.nav-cta {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
}
.site-header nav a.nav-cta:hover {
  background: var(--primary-dark, #2540a8);
  color: #ffffff;
}
.site-header nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 48px 0 28px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.lede {
  max-width: 640px;
  margin: 0 auto 14px;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.trust {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--good);
  background: var(--good-bg);
  padding: 6px 14px;
  border-radius: 999px;
}

/* Tool */
.tool { padding: 20px 0 40px; }

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 720px) {
  .input-grid { grid-template-columns: 1fr; }
}

.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.input-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.input-card-head h2 {
  font-size: 1rem;
  margin: 0;
}
.upload-btn {
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}
.upload-btn:hover { background: #eef0f6; }

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: #fbfcfe;
}
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.file-status:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.file-status.ok { background: var(--good-bg); color: var(--good); }
.file-status.err { background: var(--bad-bg); color: var(--bad); }
.file-status.loading { background: var(--bg); color: var(--text-muted); }
.file-status .remove-file {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: inherit;
  text-decoration: underline;
  padding: 0;
  flex-shrink: 0;
}

.char-count {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.analyze-row {
  text-align: center;
  margin-top: 24px;
}
.analyze-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.analyze-btn:hover { background: var(--primary-dark); }
.analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.error-msg {
  color: var(--bad);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* Results */
.results { margin-top: 40px; }

.score-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  flex-wrap: wrap;
}

.score-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.score-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}
.ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}
.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-weight: 700;
  font-size: 1.7rem;
}
.score-number small { font-size: 1rem; margin-left: 2px; color: var(--text-muted); }

.score-text h2 { margin: 0 0 6px; font-size: 1.2rem; }
.score-text p { margin: 0; color: var(--text-muted); max-width: 480px; }

.tips {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tip {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.tip.warn { border-color: #f0ddb3; background: var(--warn-bg); color: #7a4f0d; }
.tip.bad { border-color: #f0c9c2; background: var(--bad-bg); color: #8f2c1e; }
.tip.good { border-color: #bfe6d1; background: var(--good-bg); color: #12603f; }

.keyword-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}
@media (max-width: 720px) {
  .keyword-cols { grid-template-columns: 1fr; }
}
.keyword-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.keyword-col h3 { margin: 0 0 10px; font-size: 0.95rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 500;
}
.chip.matched { background: var(--good-bg); color: var(--good); }
.chip.missing { background: var(--bad-bg); color: var(--bad); }
.chip.missing.critical { background: #f6d9d3; font-weight: 700; }
.chip small { opacity: 0.7; font-weight: 400; }
.empty-note { color: var(--text-muted); font-size: 0.88rem; }

.promo-slot {
  margin-top: 20px;
  background: #fff9ec;
  border: 1px dashed #e3c98a;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
}

/* FAQ */
.faq { padding: 30px 0 60px; }
.faq h2 { font-size: 1.3rem; margin-bottom: 14px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--text-muted); margin: 10px 0 2px; }

/* Footer — unified dark/blue treatment to match the rest of mycv.fi */
.mycv-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 56px 24px 24px;
  margin-top: 40px;
}
.mycv-footer-inner { max-width: 1340px; margin: 0 auto; }
.mycv-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 0.9fr 0.7fr; gap: 32px; padding-bottom: 40px; }
.mycv-footer-brand { position: relative; padding-left: 60px; }
.mycv-footer-brand::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: url("https://mycv.fi/wp/wp-content/uploads/2026/08/mycv-logo-mark-c1.png") no-repeat;
  background-size: contain;
}
.mycv-footer-brand h3 { color: #fff; font-size: 22px; margin: 0 0 12px; }
.mycv-footer-brand p { margin: 0; line-height: 1.6; color: #94a3b8; max-width: 320px; }
.mycv-footer-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.mycv-footer-badges span { font-size: 12px; color: #cbd5e1; background: #1b2438; border: 1px solid #263049; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.mycv-footer-col h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 16px; }
.mycv-footer-col ul { list-style: none; margin: 0; padding: 0; }
.mycv-footer-col li { margin-bottom: 10px; }
.mycv-footer-col a { color: #cbd5e1; text-decoration: none; }
.mycv-footer-col a:hover { color: #fff; text-decoration: underline; }
.mycv-footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: #64748b; }
@media (max-width: 768px) { .mycv-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .mycv-footer-grid { grid-template-columns: 1fr; } }

/* Header nav: hover accent */
.site-header nav a:hover { color: var(--primary); }

/* Mobile nav: hamburger toggle opening a full-screen blue overlay,
   unified with the rest of mycv.fi (white text on blue background) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}
.nav-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
body.nav-open { overflow: hidden; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-header nav.site-nav {
    position: fixed;
    inset: 0;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1000;
  }
  .site-header nav.site-nav.is-open {
    transform: translateX(0);
  }
  .site-header nav.site-nav a {
    color: #ffffff !important;
    font-size: 1.3rem;
    font-weight: 600;
    margin-left: 0;
    padding: 10px 24px;
    background: transparent !important;
    border-radius: 0 !important;
  }
  .site-header nav.site-nav a:hover { color: #cfe0ff !important; }
  .nav-close { display: block; }
}

/* Footer secondary links (Tietoa / Tietosuoja) */
/* Simple static pages (about/privacy) */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.page-content h1 { margin-bottom: 6px; }
.page-content p { color: var(--text-muted); }

/* Työnhakijan oppaat -pudotusvalikko (mega-menu), synkassa WP:n navigaation kanssa */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 24px;
}
.nav-dropdown .nav-cta { margin-left: 0; }
.nav-dropdown-toggle {
  margin-left: 4px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
}
.nav-dropdown-toggle:hover { background: var(--bg); color: var(--text); }
.nav-dropdown-toggle svg { transition: transform 0.2s ease; display: block; }
.nav-dropdown.is-open .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--primary);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(20, 24, 40, 0.28);
  padding: 8px;
  z-index: 500;
}
.nav-dropdown-panel[hidden] { display: none; }
.site-header .nav-dropdown-panel .nav-dropdown-viewall,
.site-header .nav-dropdown-panel .nav-dropdown-cat-link,
.site-header .nav-dropdown-panel .nav-dropdown-sub a {
  display: block;
  margin-left: 0 !important;
  text-decoration: none !important;
  background: transparent !important;
  border-radius: 8px !important;
}
.site-header .nav-dropdown-panel .nav-dropdown-viewall {
  padding: 10px 14px !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 4px !important;
}
.site-header .nav-dropdown-panel .nav-dropdown-viewall:hover { text-decoration: underline !important; }
.nav-dropdown-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
}
.nav-dropdown-cat-row:hover { background: rgba(255, 255, 255, 0.1); }
.site-header .nav-dropdown-panel .nav-dropdown-cat-link {
  flex: 1;
  padding: 10px 8px 10px 14px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
}
.nav-dropdown-cat-toggle {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border: none;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
}
.nav-dropdown-cat-toggle:hover { background: rgba(255, 255, 255, 0.15); }
.nav-dropdown-cat-toggle svg { transition: transform 0.2s ease; display: block; }
.nav-dropdown-cat.is-open .nav-dropdown-cat-toggle svg { transform: rotate(180deg); }
.nav-dropdown-sub {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px 14px;
  display: none;
}
.nav-dropdown-cat.is-open .nav-dropdown-sub { display: block; }
.nav-dropdown-sub li { margin: 0; }
.nav-dropdown-sub li + li { margin-top: 2px; }
.site-header .nav-dropdown-panel .nav-dropdown-sub a {
  padding: 7px 10px !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.83rem !important;
  font-weight: 400 !important;
  line-height: 1.3;
}
.site-header .nav-dropdown-panel .nav-dropdown-sub a:hover { background: rgba(255, 255, 255, 0.14) !important; color: #ffffff !important; }

@media (max-width: 720px) {
  .site-header nav.site-nav {
    overflow-y: auto;
    padding: 90px 20px 40px;
  }
  .nav-dropdown {
    flex-direction: column;
    margin-left: 0;
  }
  .nav-dropdown-toggle {
    color: #ffffff;
    margin-left: 10px;
  }
  .nav-dropdown-toggle:hover { background: rgba(255, 255, 255, 0.15); }
  .nav-dropdown-panel {
    position: static;
    width: 100%;
    max-width: 340px;
    margin-top: 14px;
    box-shadow: none;
  }
}