:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1f36;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --radius: 12px;
  --max: 960px;
}

* { box-sizing: border-box; }

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

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { font-size: 1.4rem; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.main-nav > a,
.nav-dropbtn {
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.main-nav > a:hover,
.nav-dropbtn:hover { color: var(--text); }
.caret { font-size: 0.7rem; }
.nav-dropdown { position: relative; }
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin-top: 0.5rem;
  padding: 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 30;
}
.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu { display: block; }
.nav-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-menu a:hover { background: #f0f6ff; color: var(--primary); }
.lang-switcher select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

/* Hero */
.hero { text-align: center; padding: 3rem 0 1.5rem; }
.hero h1 { font-size: 2.25rem; margin: 0 0 0.5rem; }
.subtitle { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* Converter card */
.converter { margin: 1.5rem auto 3rem; max-width: 640px; }
#convertForm {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: #f0f6ff;
}
.drop-icon { font-size: 2rem; }
.drop-text { font-weight: 600; }
.drop-hint { color: var(--muted); font-size: 0.9rem; }
.file-name { font-weight: 600; margin: 1rem 0 0; }

.btn-primary {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.status-msg { margin: 1rem 0 0; min-height: 1.2em; color: var(--muted); }
.status-msg.error { color: #dc2626; }

.btn-download {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #16a34a;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}

/* Tools hub (homepage) */
.tools { margin: 1.5rem 0 3rem; }
.tools h2 { text-align: center; margin-bottom: 1.5rem; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-3px);
}
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  font-size: 1.5rem;
  background: #eef2ff;
  border-radius: 14px;
}
.tool-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.tool-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.tool-badge {
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #16a34a;
  border-radius: 999px;
}
@media (max-width: 560px) { .tools-grid { grid-template-columns: 1fr; } }

/* How-to steps */
.how-to { margin: 3.5rem 0; }
.how-to h2 { text-align: center; margin-bottom: 2rem; }
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 760px;
  display: grid;
  gap: 1.25rem;
}
.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.step-num {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.step-body h3 { margin: 0.1rem 0 0.35rem; }
.step-body p { margin: 0; color: var(--muted); }

/* Benefits */
.benefits { margin: 3.5rem 0; }
.benefits h2 { text-align: center; margin-bottom: 0.75rem; }
.benefits-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.benefit {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.benefit h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.benefit p { margin: 0; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 3rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 1rem 1.5rem;
}
.footer-brand .brand-name { font-weight: 700; }
.footer-tagline { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; max-width: 320px; }
.footer-col h4 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  margin: 0.4rem 0;
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.footer-bottom p { margin: 0; }
.powered-by { color: var(--primary); text-decoration: none; font-weight: 600; }
.powered-by:hover { text-decoration: underline; }

/* FAQ */
.faq { margin: 3.5rem 0; }
.faq h2 { text-align: center; margin-bottom: 1.5rem; }
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1.25rem;
  margin: 0 0 0.75rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 700; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 1rem; color: var(--muted); }

/* 404 */
.notfound { text-align: center; padding: 4rem 1rem; }
.notfound h1 { font-size: 4rem; margin: 0; color: var(--primary); }
.btn-inline { display: inline-block; width: auto; text-decoration: none; padding: 0.75rem 1.5rem; }

/* Legal pages (terms / privacy) */
.legal { max-width: 760px; padding-top: 2.5rem; padding-bottom: 2rem; }
.legal h1 { margin-bottom: 0.25rem; }
.legal .last-updated { color: var(--muted); margin: 0 0 2rem; font-size: 0.9rem; }
.legal-section { margin: 0 0 1.75rem; }
.legal-section h2 { font-size: 1.25rem; margin: 0 0 0.6rem; }
.legal-section p { margin: 0 0 0.75rem; color: #374151; }

@media (max-width: 720px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .hero h1 { font-size: 1.75rem; }
  /* Header: brand + language on the first row, nav centered on the second */
  .lang-switcher { margin-left: auto; }
  .main-nav { order: 3; width: 100%; margin-left: 0; justify-content: center; gap: 1.75rem; }
}
