/* IronGenie legal/support pages — shared shell, matches the site (docs/index.html). */
:root {
  color-scheme: dark;
  --accent: #5D9AE0;
  --accent-soft: #A9CEF6;
  --canvas: #0B0D10;
  --card: #151920;
  --surface-2: #1C2129;
  --ink: #F5F7FA;
  --read: #C4CBD6;
  --muted: #9AA3B0;
  --faint: #5C6675;
  --r-card: 24px;
  --r-control: 14px;
  --r-pill: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--read);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #C9DEF8; }

.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,16,0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--accent-soft); }
.brand img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 0.95rem; text-decoration: none; transition: color .15s ease; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.btn-beta {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 15px;
  border-radius: var(--r-control); background: var(--accent); color: #ffffff;
  font-size: 0.88rem; font-weight: 600; text-decoration: none; transition: background .15s ease;
}
.btn-beta:hover { background: #6FA8E8; color: #fff; }
.nav-links a.btn-beta, .nav-links a.btn-beta:hover { color: #ffffff; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- Article ---------- */
main { padding: clamp(16px, 3vw, 32px) 0 24px; }
.legal { width: min(760px, calc(100% - 40px)); margin: 0 auto; }
.back-link {
  display: flex; width: fit-content; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  margin-bottom: 20px; transition: color .15s ease;
}
.back-link:hover { color: var(--ink); }
.eyebrow {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--accent-soft);
  padding: 5px 11px; border-radius: var(--r-pill);
  background: rgba(93,154,224,0.10); border: 1px solid rgba(93,154,224,0.20); margin-bottom: 18px;
}
.legal h1 {
  margin: 0 0 8px; color: var(--ink);
  font-size: clamp(1.65rem, 8vw, 2.9rem); line-height: 1.1; letter-spacing: -0.6px; font-weight: 800;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.updated { margin: 0 0 36px; color: var(--faint); font-size: 0.9rem; }
.legal h2 {
  margin: 40px 0 12px; color: var(--ink);
  font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.3px; font-weight: 700;
  padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal h3 {
  margin: 28px 0 10px; color: var(--ink);
  font-size: 1.08rem; line-height: 1.35; letter-spacing: -0.2px; font-weight: 700;
}
.legal p { margin: 0 0 16px; color: var(--read); font-size: 1rem; }
.legal ul { margin: 0 0 16px; padding-left: 22px; color: var(--read); }
.legal li { margin: 0 0 8px; }
.legal strong { color: var(--ink); }
.legal code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em; color: var(--ink);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 0.08rem 0.32rem;
}

/* contact / key blocks */
.contact-card {
  background: var(--surface-2); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-control); padding: 18px 20px; margin: 0 0 16px;
}
.contact-card p { margin: 0; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 48px; padding: 36px 0 56px; }
.foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.foot > * { min-width: 0; }
.foot .brand img { width: 24px; height: 24px; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-size: 0.9rem; text-decoration: none; transition: color .15s ease; }
.foot-links a:hover { color: var(--ink); }
.copyright { color: var(--faint); font-size: 0.84rem; width: 100%; margin-top: 4px; overflow-wrap: anywhere; }

/* ---------- Language picker ---------- */
.lang-select {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-pill); padding: 0 8px 0 11px; color: var(--muted);
}
.lang-select:hover { border-color: rgba(255,255,255,0.18); }
.lang-ic { flex: none; }
.lang-select select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: transparent; border: 0; color: var(--ink);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  padding: 9px 22px 9px 4px; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239AA3B0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}
.lang-select select option { background: var(--card); color: var(--ink); }
.lang-select.compact { padding: 0 6px 0 9px; }
.lang-select.compact select { font-size: 0.84rem; padding: 7px 20px 7px 4px; }

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .nav, [dir="rtl"] .foot { direction: rtl; }
[dir="rtl"] .legal { text-align: right; }
[dir="rtl"] .legal h1, [dir="rtl"] .eyebrow { letter-spacing: 0; }
[dir="rtl"] .eyebrow { text-transform: none; }
[dir="rtl"] .legal ul { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .back-link { flex-direction: row; }
[dir="rtl"] .lang-select { padding: 0 11px 0 8px; }
[dir="rtl"] .lang-select select { padding: 9px 4px 9px 22px; background-position: left 2px center; }
/* keep code/URLs and the contact email readable left-to-right inside RTL */
[dir="rtl"] .legal code, [dir="rtl"] .legal a[href^="mailto:"], [dir="rtl"] .legal a[href^="http"] { direction: ltr; unicode-bidi: embed; }
