/* AS2Expert Relays — shared stylesheet (served at /assets/relay.css).
   Visual tokens follow www.as2expert.com: light theme, blue accent, system font. */

:root {
  --ink: #0b1220;
  --body: #39485c;
  --muted: #5f6f83;
  --faint: #9fb0cc;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --accent-soft: #eff4ff;
  --bg: #ffffff;
  --surface: #f6f8fb;
  --line: #e5eaf1;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --navy: #0f1b33;
  --code: #0e1a30;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 8px 24px -12px rgba(11, 18, 32, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2.4rem; font-weight: 750; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: .4em 0 .9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}
code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; color: var(--ink); word-break: break-all; }
pre {
  background: var(--code); color: #dbe4f3; border-radius: 10px; padding: 16px 18px;
  overflow: auto; line-height: 1.5; margin: .6em 0 1em;
}
pre code { background: none; border: 0; padding: 0; color: inherit; word-break: normal; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- nav ---------- */
.nav { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.nav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-weight: 750; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo .mark { color: var(--accent); }
.logo .sub { color: var(--muted); font-weight: 500; margin-left: .4em; }
.nav-links { display: flex; gap: 18px; flex: 1; }
.nav-links a { color: var(--body); font-weight: 500; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); text-decoration: none; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--faint); color: var(--ink); }
.btn-danger { background: #fff; color: var(--err); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--err-soft); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- cards / layout ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.stack > * + * { margin-top: 12px; }
section.pad { padding: 64px 0; }
section.alt { background: var(--surface); }

/* ---------- forms ---------- */
label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.hint { display: block; font-size: .82rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input[readonly] { background: var(--surface); color: var(--body); }
.field-inline { display: flex; gap: 8px; align-items: flex-start; }
.field-inline input { margin-bottom: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface); }

/* ---------- badges / alerts ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: #fecaca; }
.badge-muted { background: var(--surface); color: var(--muted); border-color: var(--line); }
.badge-info { background: var(--accent-soft); color: var(--accent-dark); border-color: #c7d7fe; }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .92rem; margin: 0 0 14px; }
.alert-ok { background: var(--ok-soft); border-color: #a7f3d0; color: #065f46; }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: #92400e; }
.alert-err { background: var(--err-soft); border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--accent-soft); border-color: #c7d7fe; color: var(--accent-dark); }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.secret { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; }
.secret code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); cursor: pointer; font-size: .78rem; padding: 2px 8px; font-family: inherit; }
.copy:hover { color: var(--ink); border-color: var(--faint); }
.bar { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; height: 10px; overflow: hidden; margin: 6px 0 4px; }
.bar > div { background: var(--accent); height: 100%; border-radius: 999px; transition: width .3s; }
.bar.warn > div { background: var(--warn); }
.bar.err > div { background: var(--err); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.toast {
  position: fixed; bottom: 22px; right: 22px; max-width: 420px; z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: .92rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); display: none;
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
.crumb { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step::before { counter-increment: s; content: counter(s); flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
footer.site { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--muted); margin-left: 16px; }
.cf-turnstile { margin: 4px 0 14px; }
.auth-card { max-width: 440px; margin: 48px auto; }
.auth-card h1 { font-size: 1.6rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: var(--warn); }
.hidden { display: none !important; }
@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  .card { padding: 18px 16px; }
  .kv { grid-template-columns: 1fr; }
}
