/* CarApp Legal Site — Vyora Studios
 * Mobile-first, responsive, dark-mode-aware, print-friendly.
 * Palette: primary #1A3A6E (Vyora navy), accent #FF6B35 (Vyora orange).
 */

* {
  box-sizing: border-box;
}

:root {
  --color-primary: #1a3a6e;
  --color-primary-dark: #122b54;
  --color-accent: #ff6b35;
  --color-bg: #ffffff;
  --color-surface: #f7f8fb;
  --color-border: #e3e6ee;
  --color-text: #15233f;
  --color-text-muted: #5a6577;
  --color-link: #1a3a6e;
  --color-warning-bg: #fff4e6;
  --color-warning-border: #ff6b35;
  --color-warning-text: #7a3b10;
  --color-table-header: #1a3a6e;
  --color-table-row-alt: #f3f5fa;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 35, 63, 0.08);
  --max-width: 768px;
  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f1626;
    --color-surface: #19223a;
    --color-border: #2a334d;
    --color-text: #e7ecf6;
    --color-text-muted: #98a3bb;
    --color-link: #79a8ff;
    --color-warning-bg: #3a2410;
    --color-warning-border: #ff6b35;
    --color-warning-text: #ffd4a8;
    --color-table-header: #0f1626;
    --color-table-row-alt: #1f2841;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* Header */
.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: 16px 0;
  box-shadow: var(--shadow);
}

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

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.site-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.site-nav a:hover,
.site-nav a:focus {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
  outline: none;
}

.site-nav a.active {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.lang-switch button {
  background: transparent;
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--color-accent);
}

.lang-switch button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

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

main {
  padding: 32px 0 64px;
}

/* Headings */
h1,
h2,
h3,
h4 {
  color: var(--color-primary);
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

@media (prefers-color-scheme: dark) {
  h1,
  h2,
  h3,
  h4 {
    color: #e7ecf6;
  }
}

h1 {
  font-size: 28px;
  margin-top: 0.5em;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 12px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 1em;
}

ul,
ol {
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--color-accent);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 700;
}

code {
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  border: 1px solid var(--color-border);
}

/* Meta block */
.meta {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Notice / warning callout */
.notice {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning-border);
  color: var(--color-warning-text);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 15px;
}

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

/* Table of contents */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px 14px 30px;
  margin: 24px 0;
}

.toc h2 {
  font-size: 16px;
  margin: 0 0 8px -10px;
  color: var(--color-text);
  border: none;
  padding: 0;
}

.toc ol {
  margin: 0;
  padding-left: 18px;
  font-size: 15px;
}

.toc li {
  margin-bottom: 4px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background: var(--color-bg);
}

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

th {
  background: var(--color-table-header);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  th {
    color: #e7ecf6;
  }
}

tr:nth-child(even) td {
  background: var(--color-table-row-alt);
}

/* FAQ */
details.faq {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
}

details.faq summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 40px;
}

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

details.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--color-accent);
  font-weight: 700;
}

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

details.faq summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

details.faq > div.faq-body {
  padding: 0 18px 14px;
  border-top: 1px solid var(--color-border);
}

details.faq > div.faq-body p:first-child {
  margin-top: 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover,
.btn:focus {
  background: var(--color-primary-dark);
  color: #fff !important;
}

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

.btn.btn-accent:hover,
.btn.btn-accent:focus {
  background: #e85a26;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

/* Hero (index page) */
.hero {
  text-align: center;
  padding: 36px 0 24px;
}

.hero h1 {
  border-bottom: none;
  padding-bottom: 0;
  font-size: 32px;
}

.hero .lead {
  font-size: 17px;
  color: var(--color-text-muted);
  max-width: 540px;
  margin: 0 auto 24px;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 24px;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover,
.card:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
  color: inherit;
}

.card h3 {
  margin: 0 0 6px;
  color: var(--color-primary);
}

@media (prefers-color-scheme: dark) {
  .card h3 {
    color: #79a8ff;
  }
}

.card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: 48px;
  background: var(--color-surface);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

/* Language-controlled content (JS hides one) */
[data-lang] {
  display: block;
}

[data-lang][hidden] {
  display: none !important;
}

/* Small screens */
@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 19px;
  }
  body {
    font-size: 15px;
  }
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav {
    width: 100%;
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .lang-switch,
  .btn-row,
  .skip-link,
  .toc {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
  h1,
  h2,
  h3 {
    color: #000;
    page-break-after: avoid;
  }
  .notice {
    border: 1px solid #000;
    background: #f5f5f5;
    color: #000;
  }
  table {
    font-size: 10pt;
  }
  th {
    background: #ddd !important;
    color: #000 !important;
  }
}
