:root {
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --bg: #ffffff;
  --bg-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --warn-bg: #fff7ed;
  --warn-border: #f59e0b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--blue); }

.site-header {
  background: var(--blue);
  color: #fff;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.logo { color: #fff; font-weight: 700; text-decoration: none; font-size: 18px; }
.logo span { font-weight: 400; opacity: .85; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: #dbeafe; text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: #fff; text-decoration: underline; }

.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  color: #dbeafe;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 5px;
}
.lang-switch a.active { color: var(--blue); background: #fff; border-color: #fff; }
.lang-switch a:not(.active):hover { border-color: #fff; color: #fff; }

main { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section h1 { font-size: 28px; margin: 0 0 16px; color: var(--blue-dark); }
.section h2 { font-size: 22px; margin: 0 0 16px; color: var(--blue-dark); }
.section h3 { font-size: 16px; margin: 24px 0 10px; color: var(--blue-dark); }
.section ul { padding-left: 20px; }
.section li { margin-bottom: 4px; }

.warning-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.form-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; max-width: 480px; }
.form-field label { font-size: 13px; color: var(--muted); }
.form-field input, .form-field textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
.form-field textarea { min-height: 100px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--blue-dark); }
.form-success { color: #15803d; font-weight: 600; }
.form-error, .validation-summary-errors { color: #b91c1c; font-weight: 600; }

.api-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.api-table th, .api-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.api-table th { background: var(--bg-alt); }
code { background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }

esp-web-install-button { display: inline-block; margin: 8px 0 20px; }
.manual-flash { margin-top: 20px; }
.manual-flash pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
}
.manual-flash code { background: none; padding: 0; }

.code-sample {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 480px;
  overflow-y: auto;
}
.code-sample code { background: none; padding: 0; white-space: pre; }

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .disclaimer { font-weight: 600; color: var(--blue-dark); margin: 0 0 8px; }
.site-footer .sep { margin: 0 6px; opacity: .6; }
.site-footer a { color: var(--blue); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal-links { margin-top: 6px; }

.legal-doc h1 { font-size: 26px; margin-bottom: 8px; }
.legal-doc h2 { font-size: 17px; margin: 26px 0 8px; }
.legal-doc .legal-meta {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
}
.legal-doc .legal-meta p { margin: 4px 0; }
.legal-doc p, .legal-doc li { font-size: 14px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.cookie-table th, .cookie-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.cookie-table th { background: var(--bg-alt); }

@media (max-width: 480px) {
  .section { padding: 28px 0; }
}
