/*
  CarDiag AI pages on racemeasureapp.com.
  Base = the legal-page style of /privacy/, /terms/ and /about/ (same sizes, panel and footer),
  loaded BEFORE the shared racemeasure-typography/shell/light stylesheets, exactly like those pages.
  Only CarDiag-specific parts (brand mark, language switcher, landing blocks, FAQ) are new.
*/

:root {
  --text: #000000;
  --muted: #6e6e73;
  --cyan: #0a84ff;
  --lime: #34c759;
  --line: #d1d1d6;
  --cd-brand: #08d6ff;
  --cd-ink: #0a1620;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #f2f2f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.58;
  letter-spacing: 0;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: #0077ed;
  text-decoration: underline;
}

.wrap {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
  overflow-wrap: break-word;
}

/* Long German and Russian words, e-mail addresses and URLs must never widen the page on a phone. */
h1,
h2,
h3 {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
}

a[href^="mailto:"],
a[href^="http"] {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 34px 0 10px;
  color: var(--cyan);
  font-size: 22px;
  line-height: 1.18;
}

h3 {
  margin: 22px 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

p,
li {
  color: var(--muted);
  font-size: 17px;
}

li + li {
  margin-top: 4px;
}

strong {
  color: #1c1c1e;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--lime);
  font-weight: 850;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(22px, 4vw, 34px);
  background: #ffffff;
}

.panel > h2:first-child,
.panel > h3:first-child {
  margin-top: 0;
}

.panel + .panel {
  margin-top: 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-top: 22px;
  color: var(--muted);
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- brand in the shared site header ---------- */

.site-header .cardiag-brand {
  gap: 10px;
  color: #000000;
  text-decoration: none;
}

.site-header .cardiag-brand:hover {
  text-decoration: none;
}

.cardiag-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--cd-brand) url("/cardiag/assets/cardiag-icon-180.png") center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.cardiag-name {
  color: #000000;
  font-size: 20px;
  white-space: nowrap;
}

/* ---------- language switcher ---------- */

.lang-switch {
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-switch a {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c7c7cc;
  border-radius: 999px;
  color: #1c1c1e;
  background: #ffffff;
  font-size: 15px;
  text-decoration: none;
}

.lang-switch a:hover {
  border-color: #8e8e93;
  text-decoration: none;
}

.lang-switch a[aria-current="true"] {
  color: #ffffff;
  border-color: var(--cyan);
  background: var(--cyan);
}

/* One language at a time once cardiag.js has chosen it (html[data-lang]). */
html[data-lang="en"] [data-lang-block]:not([lang="en"]),
html[data-lang="ru"] [data-lang-block]:not([lang="ru"]),
html[data-lang="de"] [data-lang-block]:not([lang="de"]) {
  display: none;
}

/* Without JavaScript all three languages stay visible, one after another. */
html:not([data-lang]) [data-lang-block] + [data-lang-block] {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 2px solid var(--line);
}

/* ---------- small helpers ---------- */

.note {
  margin: 18px 0 0;
  border: 1px solid #ffd79a;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff6e8;
}

.note p:last-child,
.note ul:last-child {
  margin-bottom: 0;
}

.todo {
  border: 1px dashed #ff3b30;
  border-radius: 6px;
  padding: 1px 6px;
  color: #b3261e;
  background: #fff0ef;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 4px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px 10px 0;
  color: var(--muted);
  font-size: 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #1c1c1e;
}

/* ---------- landing ---------- */

.app-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.app-hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  box-shadow: 0 14px 34px rgba(8, 214, 255, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tagline {
  margin-bottom: 12px;
  color: #3c3c43;
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.35;
}

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

.hero-actions .button {
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c7c7cc;
  border-radius: 10px;
  color: #1c1c1e;
  background: #ffffff;
  font-size: 16px;
  text-decoration: none;
}

.hero-actions .button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.72;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.feature-grid .card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: #ffffff;
}

.feature-grid .card h3 {
  margin-top: 0;
}

.feature-grid .card p {
  margin-bottom: 0;
  font-size: 16px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
}

.steps li {
  position: relative;
  padding-left: 46px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cd-ink);
  background: var(--cd-brand);
  font-size: 16px;
}

.section-title {
  margin: 40px 0 14px;
  color: #000000;
  font-size: 26px;
}

.fine {
  font-size: 15px;
}

/* ---------- support FAQ ---------- */

.faq details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  min-height: 48px;
  padding: 12px 34px 12px 0;
  position: relative;
  display: flex;
  align-items: center;
  color: #000000;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  color: var(--cyan);
  font-size: 24px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > :not(summary) {
  margin-left: 0;
}

.faq details p,
.faq details ul,
.faq details ol {
  margin-bottom: 14px;
}

.contact-box {
  margin-top: 22px;
  border: 1px solid rgba(10, 132, 255, 0.32);
  border-radius: 14px;
  padding: 18px 20px;
  background: #eef5fa;
}

.contact-box p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .app-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .app-hero-icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
  }

  .lang-switch {
    justify-content: flex-start;
  }

  p,
  li {
    font-size: 16px;
  }
}

/* Vgate guide: scoped to the CarDiag landing, without changing shared brand pages. */
.cardiag-home #vgate {
  scroll-margin-top: 100px;
}

.cardiag-home .adapter-panel {
  margin-top: 48px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #b8dce5;
  border-radius: 22px;
  background: #eefaff;
}

.cardiag-home .adapter-panel h2 {
  margin: 8px 0 16px;
  color: #102d3d;
  font-size: clamp(28px, 5vw, 40px);
}

.cardiag-home .adapter-panel .adapter-intro {
  max-width: 720px;
  color: #344e5c;
  font-size: 19px;
}

.cardiag-home .adapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.cardiag-home .adapter-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid #c7dfe6;
  border-radius: 16px;
  background: #ffffff;
}

.cardiag-home .adapter-card h3 {
  margin: 18px 0 12px;
  color: #102d3d;
  font-size: 23px;
}

.cardiag-home .adapter-card p,
.cardiag-home .adapter-setup li {
  color: #425d6b;
  font-size: 16px;
}

.cardiag-home .adapter-label {
  display: inline-block;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  background: #def4ed;
  color: #216146;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.cardiag-home .adapter-label-neutral {
  background: #edf1f5;
  color: #40546a;
}

.cardiag-home .adapter-link {
  display: inline-block;
  padding: 8px 0;
  color: #006b88;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cardiag-home .adapter-setup h3 {
  margin: 24px 0 18px;
  color: #102d3d;
  font-size: 23px;
}

.cardiag-home .adapter-panel .fine {
  margin-top: 18px;
}

.cardiag-home .adapter-caveat {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid #c7dfe6;
  color: #4a626f;
  font-size: 14px;
}

@media (max-width: 650px) {
  .cardiag-home .adapter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cardiag-home .adapter-card {
    padding: 18px;
  }

  .cardiag-home .hero-actions .button {
    padding: 10px 16px;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
}
