/* DomRabota — сайт. Палитра и формы взяты из приложения (lib/core/theme/app_palette.dart):
   зелёный фон иконки, изумрудные кнопки, мятные поверхности, мягкие волны. Без теней,
   градиентов и внешних ресурсов. */

:root {
  color-scheme: light dark;
  --bg: #f9fdf0;
  --card: #ffffff;
  --tonal: #e2fad4;
  --text: #13261b;
  --muted: #4b6152;
  --border: #d3eac6;
  --primary: #19a854;
  --accent: #037a47;
  --on-accent: #ffffff;
  --light: #62cb4f;
  --icon-bg: #e2fad4;
  --icon-fg: #037a47;
  --error: #c62828;
  --wave-1: #e2fad4;
  --wave-2: #62cb4f;
  --wave-3: #19a854;
  --footer: #e2fad4;
  --focus: #037a47;
  --radius: 20px;
  --radius-sm: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1b12;
    --card: #13291c;
    --tonal: #13291c;
    --text: #e4f3e7;
    --muted: #a9c4b1;
    --border: #24432f;
    --primary: #6fd65c;
    --accent: #6fd65c;
    --on-accent: #06210f;
    --light: #9ee68c;
    --icon-bg: #1e3b28;
    --icon-fg: #9ee68c;
    --error: #ffb4ab;
    --wave-1: #13291c;
    --wave-2: #1e3b28;
    --wave-3: #24432f;
    --footer: #13291c;
    --focus: #9ee68c;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.7rem, 7vw, 3rem);
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2.1rem, 8vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  scroll-margin-top: 88px;
}

h3 {
  font-size: 1.15rem;
  scroll-margin-top: 88px;
}

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

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.35em;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 600px) {
  .wrap {
    padding: 0 28px;
  }
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* --- Шапка ------------------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  border-radius: 11px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 750;
  font-size: 1.15rem;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--tonal);
  color: var(--accent);
}

@media (max-width: 520px) {
  .site-header {
    position: static;
  }
  .header-row {
    justify-content: flex-start;
  }
  .top-nav {
    width: 100%;
    margin-left: -8px;
    gap: 0;
  }
  .top-nav a {
    padding: 6px 8px;
    font-size: 0.92rem;
  }
}

/* --- Кнопки ----------------------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.5em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  text-decoration: underline;
}

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

.btn-secondary:hover {
  background: var(--tonal);
}

/* --- Главная: первый экран ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 48px 0 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: center;
  padding-bottom: 24px;
}

@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: 1.3fr 1fr;
    padding-bottom: 8px;
  }
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tonal);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.lead {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--muted);
  max-width: 36em;
}

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: min(320px, 70vw);
  border-radius: 22%;
}

.hero-waves {
  display: block;
  width: 100%;
  height: clamp(60px, 9vw, 120px);
  margin-top: 8px;
}

.wave-1 {
  fill: var(--wave-1);
}

.wave-2 {
  fill: var(--wave-2);
}

.wave-3 {
  fill: var(--bg);
}

/* --- Секции ----------------------------------------------------------------------------- */

.section {
  padding: 64px 0;
}

.section-tonal {
  background: var(--tonal);
}

.section-head {
  max-width: 46em;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cards > li {
  margin: 0;
}

.card {
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card h3 {
  margin: 14px 0 6px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--icon-bg);
  color: var(--icon-fg);
}

.icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.split {
  display: grid;
  gap: 16px;
}

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

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.panel h3 {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.checks {
  list-style: none;
  padding: 0;
}

.checks li {
  position: relative;
  padding-left: 30px;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--primary);
  border-bottom: 2.5px solid var(--primary);
  transform: rotate(-45deg);
}

.dots li::marker {
  color: var(--primary);
}

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

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 18px 68px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps strong {
  display: block;
}

.steps p {
  margin: 4px 0 0;
  color: var(--muted);
}

.note {
  border-left: 4px solid var(--primary);
  background: var(--card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.section-tonal .note {
  background: var(--bg);
}

.store-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.store-box h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.store-box p {
  color: var(--muted);
  max-width: 34em;
  margin: 0 auto;
}

.store-box .actions {
  justify-content: center;
}

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

.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 20px;
}

.faq summary {
  cursor: pointer;
  font-weight: 650;
  padding: 16px 28px 16px 0;
  position: relative;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 1.4rem;
  color: var(--accent);
}

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

.faq details > :not(summary) {
  color: var(--muted);
}

.faq details[open] {
  padding-bottom: 6px;
}

/* --- Документы и руководство ------------------------------------------------------------- */

.page-head {
  padding-top: 40px;
  padding-bottom: 8px;
}

.page-head p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 44em;
}

.doc {
  max-width: 800px;
  padding-bottom: 64px;
}

.doc h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin-top: 1.8em;
}

.doc h3 {
  margin-top: 1.4em;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.doc-meta div {
  display: flex;
  gap: 6px;
}

.doc-meta dt::after {
  content: ":";
}

.doc-meta dd {
  margin: 0;
  color: var(--text);
}

.facts {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

.facts li {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.facts span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.2em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.97rem;
}

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

th {
  background: var(--tonal);
}

tr:last-child td {
  border-bottom: 0;
}

.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 8px 0 24px;
}

.toc .toc-title {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
}

.toc li + li {
  margin-top: 0.15em;
}

.guide-layout {
  display: grid;
  gap: 8px 40px;
  padding-bottom: 64px;
}

@media (min-width: 980px) {
  .guide-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
  }
  .guide-layout .toc {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    font-size: 0.95rem;
  }
}

.guide-content {
  max-width: 780px;
}

.lesson {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 28px;
}

.lesson:first-child {
  border-top: 0;
  margin-top: 8px;
  padding-top: 0;
}

.lesson h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
}

.lesson-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  margin-right: 10px;
  border-radius: 10px;
  background: var(--tonal);
  color: var(--accent);
  font-size: 1rem;
  vertical-align: 0.15em;
}

.result {
  color: var(--text);
}

.result strong,
.tip strong {
  color: var(--accent);
}

.tip {
  background: var(--tonal);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.screen {
  margin: 20px 0;
  max-width: 300px;
}

.screen img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.screen figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.notfound {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 64px;
}

.notfound p {
  color: var(--muted);
}

.notfound .actions {
  justify-content: center;
}

/* --- Подвал ----------------------------------------------------------------------------- */

.site-footer {
  margin-top: 0;
}

.footer-waves {
  display: block;
  width: 100%;
  height: 60px;
}

.wave-a {
  fill: var(--wave-2);
  fill-opacity: 0.35;
}

.wave-b {
  fill: var(--footer);
}

.footer-body {
  background: var(--footer);
  padding: 8px 0 32px;
}

.footer-row {
  display: grid;
  gap: 12px;
}

.footer-brand {
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.footer-nav li + li {
  margin-top: 0;
}

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

.footer-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 650;
}

.copyright {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}
