/* ===== Онлайн-конструктор «Адаптация к саду» ===== */

:root {
  --yellow: #fff3d6;
  --yellow-deep: #ffe29a;
  --mint: #ddf5ec;
  --mint-deep: #7bc9a6;
  --peach: #ffe3d3;
  --peach-deep: #ffb08a;
  --lavender: #e8e1f7;
  --lavender-deep: #b8a7e8;
  --ink: #4a4458;
  --ink-soft: #7a7490;
  --card: #ffffff;
  --bg: #fdf9f3;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(94, 78, 128, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

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

a { color: inherit; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Шапка ---------- */
.site-header {
  background: linear-gradient(120deg, var(--yellow) 0%, var(--peach) 55%, var(--lavender) 100%);
  padding: 18px 0;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .emoji { font-size: 1.6rem; }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.2s;
}

.site-nav a:hover, .site-nav a.active { background: #fff; }

/* ---------- Герой на главной ---------- */
.hero {
  text-align: center;
  padding: 56px 0 30px;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 900;
  margin-bottom: 14px;
}

.hero p {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Карточки продуктов ---------- */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  padding: 30px 0 20px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s;
}

.product-card:hover { transform: translateY(-4px); }

.product-card .icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.icon--memo { background: var(--mint); }
.icon--color { background: var(--peach); }
.icon--check { background: var(--lavender); }

.product-card h2 { font-size: 1.25rem; font-weight: 800; }
.product-card p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.1s;
  background: var(--mint-deep);
  color: #fff;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }

.btn--peach { background: var(--peach-deep); }
.btn--lavender { background: var(--lavender-deep); }

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 2px solid #e4ddd2;
}
.btn--ghost:hover { background: #f4efe7; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Примеры на главной ---------- */
.samples {
  padding: 26px 0 60px;
}

.samples h2 {
  text-align: center;
  font-weight: 900;
  margin-bottom: 20px;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.sample {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  font-size: 0.85rem;
}

.sample h3 { font-size: 0.95rem; margin-bottom: 8px; }
.sample .mini-doc {
  background: #fffdf8;
  border: 1px dashed #e0d6c4;
  border-radius: 12px;
  padding: 12px;
  color: var(--ink-soft);
}
.sample .mini-doc li { margin-left: 18px; }

/* ---------- Мастер (wizard) ---------- */
.wizard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 30px 0 60px;
}

.wizard-head h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 900;
}

.wizard-head p.sub { color: var(--ink-soft); margin-top: 4px; }

.progress {
  height: 10px;
  background: #f0ebe2;
  border-radius: 999px;
  margin: 20px 0 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint-deep), var(--lavender-deep));
  width: 0;
  transition: width 0.3s;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.step { display: none; animation: fadeIn 0.25s ease; }
.step.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.step h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.step .hint { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 18px; }

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

/* ---------- Поля форм ---------- */
.field { margin-bottom: 18px; }

.field label.title {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

input[type="text"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 16px;
  border: 2px solid #e8e1d4;
  border-radius: 14px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus, textarea:focus { border-color: var(--mint-deep); }

textarea { min-height: 110px; resize: vertical; }

/* Пилюли-переключатели (пол, возраст, количество, сложность) */
.pill-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  position: relative;
}

.pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid #e8e1d4;
  background: #fffdf8;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.pill input:checked + span {
  background: var(--mint);
  border-color: var(--mint-deep);
}

.pill input:focus-visible + span { outline: 3px solid var(--lavender-deep); }

/* Чекбоксы-карточки */
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fffdf8;
  border: 2px solid #eee7da;
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.check-card:hover { border-color: var(--mint-deep); }

.check-card input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--mint-deep);
  flex-shrink: 0;
}

.check-card .cc-title { font-weight: 800; }
.check-card .cc-desc { font-size: 0.88rem; color: var(--ink-soft); }

.check-card.done .cc-title { text-decoration: line-through; opacity: 0.6; }

.group-title {
  font-weight: 900;
  margin: 22px 0 10px;
  padding-left: 12px;
  border-left: 5px solid var(--peach-deep);
  border-radius: 3px;
}

/* Категории раскрасок */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.cat-card {
  position: relative;
  border: 2px solid #eee7da;
  border-radius: 16px;
  background: #fffdf8;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.cat-card input { position: absolute; opacity: 0; }

.cat-card .cat-emoji { font-size: 2rem; display: block; margin-bottom: 6px; }
.cat-card .cat-name { font-weight: 800; font-size: 0.95rem; }
.cat-card .cat-desc { font-size: 0.8rem; color: var(--ink-soft); }

.cat-card.selected {
  border-color: var(--peach-deep);
  background: var(--peach);
}

/* Превью раскрасок */
.coloring-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.coloring-thumb {
  border: 2px solid #eee7da;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  text-align: center;
}

.coloring-thumb svg { width: 100%; height: auto; }
.coloring-thumb .cap { font-size: 0.8rem; color: var(--ink-soft); }

/* Свои пункты */
.custom-add {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.custom-add input { flex: 1; min-width: 200px; }

.custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--lavender);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 8px;
  font-weight: 700;
}

.custom-item button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* ---------- Предпросмотр документа ---------- */
.doc-preview {
  border: 2px solid #eee7da;
  border-radius: 16px;
  background: #fff;
  padding: 30px clamp(16px, 4vw, 40px);
  max-height: 70vh;
  overflow: auto;
}

.autosave-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: right;
  margin-top: 10px;
}

/* ---------- Стили самого документа (экран + печать) ---------- */
.doc h1.doc-title {
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 4px;
}

.doc .doc-subtitle {
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 22px;
  font-size: 0.95rem;
}

.doc h2.doc-block {
  font-size: 1.12rem;
  font-weight: 900;
  margin: 22px 0 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--mint);
  break-after: avoid;
}

.doc--checklist h2.doc-block { background: var(--lavender); }

.doc ul.doc-list { list-style: none; }

.doc ul.doc-list li {
  position: relative;
  padding: 5px 0 5px 32px;
  break-inside: avoid;
}

.doc ul.doc-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 9px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--mint-deep);
  border-radius: 5px;
  background: #fff;
}

.doc ul.doc-list li.checked::before {
  content: '✓';
  color: #fff;
  background: var(--mint-deep);
  font-size: 12px;
  line-height: 15px;
  text-align: center;
}

.doc ul.doc-list li.checked { opacity: 0.65; }

.doc ul.doc-list.plain li { padding-left: 20px; }
.doc ul.doc-list.plain li::before {
  content: '•';
  border: none;
  background: none;
  color: var(--peach-deep);
  font-size: 1.3rem;
  top: 1px;
  left: 4px;
  width: auto;
  height: auto;
}

.doc .notes-box {
  border: 2px dashed var(--lavender-deep);
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 16px;
  white-space: pre-wrap;
}

.doc .doc-footer {
  margin-top: 26px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.doc .write-lines .line {
  border-bottom: 1.5px solid #d8d0c2;
  height: 28px;
}

/* Страница раскраски в документе */
.coloring-page {
  text-align: center;
  padding: 10px 0 30px;
}

.coloring-page svg {
  width: 100%;
  max-width: 620px;
  height: auto;
}

.coloring-page .cap {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 6px;
}

/* ---------- Подвал ---------- */
.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 26px 16px 34px;
}

/* ---------- Печать / PDF ---------- */
@media print {
  @page { size: A4; margin: 14mm; }

  body { background: #fff; }

  .site-header, .site-footer, .wizard-head, .progress, .progress-label,
  .step-nav, .no-print, .autosave-note { display: none !important; }

  .wizard { box-shadow: none; padding: 0; margin: 0; border-radius: 0; }

  .doc-preview {
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  .step { display: none !important; }
  .step.print-target { display: block !important; }

  .doc h2.doc-block {
    background: #eef7f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .coloring-page {
    page-break-after: always;
    break-after: page;
    padding: 0;
  }

  .coloring-page:last-child { page-break-after: auto; break-after: auto; }

  .coloring-page svg {
    max-width: 100%;
    max-height: 240mm;
  }
}

/* Элементы, видимые только на печати */
.screen-hidden { display: none; }

@media print {
  .screen-hidden { display: block !important; }
}

/* ---------- Мобильные ---------- */
@media (max-width: 560px) {
  .wizard { padding: 20px 16px; }
  .step-nav .btn { flex: 1; }
  .pill span { padding: 10px 14px; font-size: 0.92rem; }
}
