/* Конструктор чехла с фото — мобайл-фёрст, одна колонка */

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

:root {
  --accent: #1d4ed8;
  --accent-dark: #1e40af;
  --ink: #0f1116;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ok: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

.topbar {
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.tagline { font-size: 13px; opacity: .75; }

main { max-width: 520px; margin: 0 auto; padding: 14px 12px 40px; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 17, 22, .07);
}

h2 { font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.step-num {
  background: var(--accent);
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; flex: none;
}

select, input[type="text"], textarea {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.note.center { text-align: center; }

/* Редактор */
.editor-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #f9fafb 0% 50%) 50% / 18px 18px;
  border-radius: 12px;
}
.editor-wrap .canvas-container { box-shadow: 0 4px 16px rgba(15, 17, 22, .18); }

.toolbar { display: flex; gap: 10px; margin-top: 12px; }

.btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
}
.btn.primary { background: var(--accent); color: #fff; flex: 1; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #93a5e8; cursor: default; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 4px; }
.btn.ghost {
  width: 100%;
  background: none;
  color: var(--muted);
  border: 1.5px dashed #d1d5db;
  margin-top: 10px;
  font-weight: 500;
}
.btn.ghost:hover { color: var(--ink); border-color: var(--muted); }

/* Цвет фона */
.bg-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bg-label { font-size: 14px; color: var(--muted); margin-right: 2px; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  cursor: pointer;
  padding: 0;
}
.swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(29, 78, 216, .25); }
.swatch.custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  display: inline-flex; overflow: hidden;
}
.swatch.custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* Индикатор качества */
.quality {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
}
.quality.ok   { background: #ecfdf5; color: var(--ok); }
.quality.warn { background: #fffbeb; color: var(--warn); }
.quality.bad  { background: #fef2f2; color: var(--bad); }

/* Форма */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field > span em { font-weight: 400; color: var(--muted); font-style: normal; }
.field small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.hp { position: absolute; left: -5000px; top: -5000px; }

.agree { display: flex; gap: 10px; font-size: 13.5px; color: #374151; margin: 14px 0; }
.agree input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.agree a { color: var(--accent); }

.form-error {
  background: #fef2f2;
  color: var(--bad);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 10px;
}

.foot { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 14px; }

/* Бейдж персональной ссылки заказа */
.order-badge {
  background: #eff6ff;
  color: var(--accent-dark);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Модалка «Итоговая проверка» */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px 18px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(15, 17, 22, .35);
  /* на телефоне в ландшафте модалка выше экрана — прокручиваем, а не прячем кнопки */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.low-dpi-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 14px;
  cursor: pointer;
}
.low-dpi-consent input { margin-top: 2px; }

.btn.primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.modal-box h3 { font-size: 19px; margin-bottom: 8px; }
.modal-box > p { font-size: 14px; color: #374151; margin-bottom: 10px; }
.modal-x {
  position: absolute;
  top: 10px; right: 14px;
  border: none; background: none;
  font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.checklist { list-style: none; margin-bottom: 16px; }
.checklist li {
  font-size: 14px;
  color: #374151;
  padding: 5px 0 5px 26px;
  position: relative;
}
.checklist li::before {
  content: "✔";
  position: absolute; left: 2px;
  color: var(--ok);
  font-weight: 700;
}
.modal-actions { display: flex; gap: 10px; }
.btn.back { flex: 1; background: #e5e7eb; color: #374151; }
.btn.back:hover { background: #d1d5db; }
.modal-actions .btn.primary { flex: 2; }

/* Успех (success.html) */
.success-page { text-align: center; padding: 60px 20px; }
.success-page .emoji { font-size: 56px; }
.success-page h1 { margin: 16px 0 10px; }
.success-page p { color: var(--muted); max-width: 420px; margin: 0 auto 24px; }
.success-page .btn { display: inline-block; text-decoration: none; }

/* Политика (policy.html) */
.policy { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }
.policy h1 { font-size: 22px; margin-bottom: 14px; }
.policy h2 { font-size: 16px; margin: 18px 0 8px; display: block; }
.policy p, .policy li { font-size: 14px; color: #374151; margin-bottom: 8px; }
.policy ul { padding-left: 20px; }
