/* RideDiag site stylesheet — shared by all pages */

:root {
  --bg: #f7f6f4;
  --bg-alt: #ffffff;
  --text: #1c1a19;
  --text-muted: #52504d;
  --border: #e2ded9;
  --accent: #43494f; /* neutral slate default */
  --accent-contrast: #ffffff;
  --card-bg: #ffffff;
  --code-bg: #efece7;
  --warn-bg: #fff4e5;
  --warn-border: #e8b95c;
  --link: var(--accent);
  --focus: #2e6bb8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --bg-alt: #1f2023;
    --text: #eeeceb;
    --text-muted: #b7b3ae;
    --border: #33353a;
    --card-bg: #222327;
    --code-bg: #2a2b2f;
    --warn-bg: #362b12;
    --warn-border: #a9791f;
  }
}

/* Brand accent overrides */
.brand-guzzi {
  --accent: #8a332b;
  --focus: #8a332b;
}

.brand-bmw {
  --accent: #2e6bb8;
  --focus: #2e6bb8;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

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

a:focus,
button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

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

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.logo span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
}

.lang-switch {
  font-size: 0.85rem;
}

/* Hero */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 12px;
  line-height: 1.15;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 24px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.badge.beta {
  background: var(--warn-bg);
  color: #7a5310;
  border: 1px solid var(--warn-border);
}

@media (prefers-color-scheme: dark) {
  .badge.beta {
    color: #e8c27a;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card h3 {
  margin-top: 0;
}

.brand-card-guzzi {
  border-top: 4px solid #8a332b;
}

.brand-card-bmw {
  border-top: 4px solid #2e6bb8;
}

/* Sections */
section {
  padding: 40px 0;
}

section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

h2 + p.section-sub {
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 24px;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  counter-reset: step;
}

.step {
  text-align: left;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

/* Lists */
ul.plain,
ol.plain {
  padding-left: 1.2em;
}

ul.adapter-list li,
ol.plain li {
  margin-bottom: 6px;
}

table.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

table.spec th,
table.spec td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.spec th {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* FAQ */
details.faq {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--card-bg);
}

details.faq summary {
  font-weight: 700;
  cursor: pointer;
}

details.faq p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Notice boxes */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.placeholder {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.site-footer nav a {
  color: var(--text-muted);
}

.footer-disclaimer {
  max-width: 720px;
}

/* Legal pages */
.legal h1 {
  margin-bottom: 4px;
}

.legal .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal h2 {
  margin-top: 40px;
  font-size: 1.3rem;
}

.legal h3 {
  margin-top: 24px;
  font-size: 1.05rem;
}

.legal ol.sections {
  padding-left: 1.2em;
}

.legal ol.sections > li {
  margin-bottom: 4px;
}

.legal main {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* Utility */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  section {
    padding: 28px 0;
  }
}
