/* AutoRecode.pro - beta.autorecode.pro public site
 * Component: WebUI (public). Vehicle Platform: not applicable.
 *
 * The palette and geometry are the project's design tokens, copied from the approved mock-up
 * (src/web/autorecode-web/src/styles/tokens.css) so the beta site reads as the same product. Light
 * only, as the rest of the project is. Unlike the diagnostic app - a fixed-width workshop tool - a
 * public site must work on a phone, so the shell collapses to a stacked layout below 820px.
 */

:root {
  --navy-900: #0A1220;
  --navy-850: #0C1626;
  --navy-800: #101F35;
  --navy-700: #13253F;
  --navy-line: #1B2C45;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F4F8;
  --border: #E4E8EF;
  --border-strong: #D3DAE5;

  --text: #16202F;
  --text-2: #4A5567;
  --text-3: #5F6B80;
  --text-disabled: #9AA4B5;
  --text-inv: #FFFFFF;
  --text-inv-2: #8FA0B8;

  --blue: #2563EB;
  --blue-600: #1D5FD0;
  --blue-soft: #EAF1FE;
  --blue-line: #C6DAFB;
  --green: #17A64A;
  --green-soft: #E7F7ED;
  --green-text: #0F7A36;
  --amber: #E28A0C;
  --amber-soft: #FEF4E5;
  --amber-text: #9A5B00;
  --red: #DC3232;
  --red-soft: #FDEDED;
  --red-text: #B52525;
  --violet: #7C4DE0;

  --r-lg: 10px;
  --r: 8px;
  --r-sm: 6px;
  --r-pill: 999px;
  --sidebar-w: 236px;

  --shadow-1: 0 1px 2px rgba(16, 32, 55, .05);
  --shadow-2: 0 2px 8px rgba(16, 32, 55, .07);

  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100%; }

.sidebar {
  display: flex; flex-direction: column;
  background: var(--navy-850);
  border-right: 1px solid var(--navy-line);
  color: var(--text-inv-2);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  height: 60px; padding: 0 18px;
  background: var(--navy-900);
  border-bottom: 1px solid var(--navy-line);
  color: var(--text-inv);
}
.sidebar-brand .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, #2563EB, #7C4DE0);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.sidebar-brand .name { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.sidebar-brand .name small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--text-inv-2); text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 12px;
  border-left: 2px solid transparent; border-radius: var(--r-sm);
  color: var(--text-inv-2);
  font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item:hover { background: var(--navy-800); color: var(--text-inv); text-decoration: none; }
.nav-item.is-active { background: var(--navy-700); color: var(--text-inv); border-left-color: var(--blue); }
.nav-item.is-active svg { opacity: 1; color: #93C5FD; }
.nav-spacer { flex: 1; }
.nav-foot { padding: 12px 14px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-inv-2); opacity: .7; border-top: 1px solid var(--navy-line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; max-width: 940px; margin: 0 auto; padding: 30px 28px 48px; }

/* ---------- page heads ---------- */

.page-head { margin: 0 0 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 750; letter-spacing: .01em; }
.page-head p { margin: 0; color: var(--text-3); font-size: 13.5px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }

/* ---------- cards / news ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 20px 22px;
}
.card + .card { margin-top: 16px; }

.news-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.news-meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-meta .by { font-weight: 650; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; }
.news-meta time { font-family: var(--mono); }
.news-meta .edited { color: var(--text-disabled); }

.empty { padding: 40px 22px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }

/* ---------- pagination ---------- */

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
}
.pager a:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.pager .is-current { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager .disabled { opacity: .45; cursor: not-allowed; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 17px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 650; letter-spacing: .05em;
  transition: .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); border-color: var(--blue-600); }
.btn-danger { border-color: var(--red); color: var(--red); background: var(--surface); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 11px; }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.field > input, .field > textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.field > input { height: 40px; }
.field > textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field > input:focus, .field > textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.field .req { color: var(--red); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.form-narrow { max-width: 540px; }
.val { display: block; margin-top: 5px; color: var(--red-text); font-size: 12px; }

/* ---------- notices ---------- */

.notice { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.notice-error { background: var(--red-soft); border: 1px solid var(--red); color: var(--red-text); }
.notice-info { background: var(--blue-soft); border: 1px solid var(--blue-line); color: var(--text-2); }
.notice-ok { background: var(--green-soft); border: 1px solid var(--green); color: var(--green-text); }

/* ---------- login card ---------- */

.centre { display: grid; place-items: center; min-height: 100%; padding: 40px 20px; }
.login-card { width: 100%; max-width: 380px; padding: 28px 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.login-card h1 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.login-card h1 + p { margin: 0 0 20px; font-size: 12.5px; color: var(--text-3); }

/* ---------- admin table ---------- */

.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.admin-row .excerpt { white-space: pre-wrap; color: var(--text); font-size: 13.5px; max-height: 5.2em; overflow: hidden; }
.admin-row .row-meta { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.admin-row .row-meta .spacer { flex: 1; }
.admin-row time { font-family: var(--mono); }

/* ---------- faq ---------- */

.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; }
.faq-item h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.faq-step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.faq-step:first-of-type { border-top: 0; padding-top: 4px; }
.faq-step .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-600); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.faq-step .body { min-width: 0; }
.faq-step .body h3 { margin: 2px 0 6px; font-size: 14px; font-weight: 650; }
.faq-step .body p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.faq-figure { margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-3); color: var(--text-disabled);
  aspect-ratio: 16 / 7; display: grid; place-items: center; text-align: center; font-size: 12px; letter-spacing: .04em; }
.faq-figure .ph { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.faq-figure svg { width: 34px; height: 34px; opacity: .5; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; padding: 16px 28px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-foot .spacer { flex: 1; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--navy-line); }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 8px 10px; }
  .nav-item { height: 38px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item.is-active { border-left: 0; border-bottom-color: var(--blue); }
  .nav-spacer { display: none; }
  .nav-foot { display: none; }
  .content { padding: 22px 18px 36px; }
}
