/* =========================================================
   pdfyhteen.fi — styles
   Tyyli: valkoinen, asiallinen, suomalainen
   Korostus: hyvin vaalea sininen
   Kortit:   vaaleanharmaa, ohut reuna
   ========================================================= */

:root {
  /* paletti */
  --bg:            #ffffff;
  --bg-soft:       #f6f8fb;
  --surface:       #ffffff;
  --surface-alt:   #f3f5f8;
  --border:        #e4e8ee;
  --border-strong: #d3d9e2;

  --text:          #14202c;
  --text-muted:    #5a6573;
  --text-soft:     #7a8492;

  --accent:        #1f5fa8;   /* sininen, ei räikeä */
  --accent-strong: #174c87;
  --accent-soft:   #eaf2fb;   /* hyvin vaalea sininen */
  --accent-ring:   rgba(31, 95, 168, 0.22);

  --success:       #1f7a4c;
  --success-soft:  #e8f4ed;
  --danger:        #a33232;

  /* typografia */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* spacing */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 44, 0.04);
  --shadow:    0 4px 14px rgba(20, 32, 44, 0.06);

  --container: 1080px;
}

/* reset / perus */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ========== HEADER ========== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border-radius: 8px;
}
.brand-text { font-size: 16px; }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14.5px;
}
.site-nav a {
  color: var(--text-muted);
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 640px) {
  .site-nav { display: none; }
}

/* ========== HERO ========== */
.hero {
  padding: 64px 0 28px;
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 760px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--text);
}
.lead {
  margin: 0 auto 26px;
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-muted);
  max-width: 620px;
}

.trust-badges {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  max-width: 720px;
}
.trust-badges li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.trust-badges svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 18px;
}

/* ========== KORTIT ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-head { margin-bottom: 18px; }
.card-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); margin: 0; }

section { padding: 40px 0; }
section.hero { padding-top: 64px; }

/* ========== TYÖKALU ========== */
.tool { padding-top: 32px; }
.tool-card {
  padding: 28px;
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 3px rgba(31, 95, 168, 0.08);
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dz-title { margin: 6px 0 0; font-weight: 600; color: var(--text); }
.dz-sub   { margin: 0; color: var(--text-soft); font-size: 14px; }
.dz-hint  { margin-top: 6px; font-size: 13px; color: var(--text-soft); }

/* tiedostolista */
.file-list-wrap { margin-top: 22px; }
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.list-title { margin: 0; font-size: 15px; color: var(--text-muted); font-weight: 600; }

.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.file-item:hover { border-color: var(--border-strong); }
.file-index {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
}
.file-info { min-width: 0; }
.file-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14.5px;
  color: var(--text);
}
.file-meta { display: block; color: var(--text-soft); font-size: 12.5px; }

.file-actions { display: inline-flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 8px;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.icon-btn.danger:hover { color: var(--danger); border-color: #e0c4c4; }

.actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 22px;
  align-items: center;
}

.status { margin: 14px 0 0; min-height: 1.2em; font-size: 14px; color: var(--text-muted); }
.status.error   { color: var(--danger); }
.status.success { color: var(--success); }

/* napit */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary[disabled] {
  background: #c9d4e2;
  color: #fff;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #185f3b; text-decoration: none; }
.btn-outline {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-strong); }

/* ========== TRUST ========== */
.trust .trust-card h2,
.finland .finland-card h2,
.promo .promo-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.trust-list li {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.trust-list strong { display: block; margin-bottom: 2px; color: var(--text); }

/* ========== FINLAND ========== */
.finland-card { background: var(--surface-alt); }
.finland-card p { margin: 0; color: var(--text-muted); }

/* ========== PROMO ========== */
.promo-card {
  display: grid;
  gap: 14px;
  align-items: start;
}
.promo-card p { margin: 0; color: var(--text-muted); }
.promo-card .btn { justify-self: start; margin-top: 4px; }

/* ========== FOOTER ========== */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  padding: 32px 20px;
}
.footer-col h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.footer-brand { margin: 0 0 4px; font-weight: 600; }
.footer-muted { margin: 0; color: var(--text-muted); font-size: 14px; }
.footer-col p { margin: 0 0 6px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  color: var(--text-soft);
  font-size: 13px;
}

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

/* ========== COOKIE BANNER ========== */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(20, 32, 44, 0.12);
  padding: 16px 18px;
  max-width: 720px;
  margin: 0 auto;
}
.cookie-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.cookie-title { margin: 0 0 4px; font-weight: 600; }
.cookie-body { margin: 0; color: var(--text-muted); font-size: 14px; }
.cookie-actions { display: inline-flex; gap: 8px; }

@media (max-width: 620px) {
  .cookie-inner { grid-template-columns: 1fr; }
  .cookie-actions { justify-content: flex-end; }
}

/* ========== MODAL ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 32, 44, 0.45);
}
.modal-panel {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(20, 32, 44, 0.25);
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
}
.modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 22px 24px; }
.modal-body h3 { margin: 18px 0 6px; font-size: 15px; }
.modal-body p, .modal-body ul { color: var(--text-muted); }
.modal-body ul { padding-left: 1.1em; }
.modal-body strong { color: var(--text); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px;
}

.cookie-group {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}
.cookie-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cookie-group p { margin: 2px 0 0; font-size: 13px; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--success-soft);
  color: var(--success);
}
.badge-muted { background: var(--surface-alt); color: var(--text-soft); border: 1px solid var(--border); }

/* ========== RESPONSIIVISUUS ========== */
@media (max-width: 480px) {
  .hero { padding: 44px 0 18px; }
  .card, .tool-card { padding: 20px; }
  .dropzone { padding: 28px 14px; }
  .actions .btn { width: 100%; }
}

/* Pidetään fokus saavutettavana modalin sisällä */
.modal:not([hidden]) ~ * { /* placeholder */ }

/* tulostus */
@media print {
  .site-header, .site-footer, .cookie-banner, .modal { display: none !important; }
  .card { box-shadow: none; border-color: #ccc; }
}
