@import url('fonts.css');

:root {
  --navy: #171a5c;
  --navy-2: #2a1a63;
  --red: #e11d1d;
  --ink: #12172e;
  --muted: #5b6479;
  --line: #e2e6ef;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(18, 23, 46, .10);
  --grad: linear-gradient(100deg, #171a5c 0%, #3a1560 34%, #e11d1d 68%, #17b3c7 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }

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

/* ---------- header ---------- */
.site-head {
  background: var(--grad);
  color: #fff;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-head img { height: 34px; width: auto; display: block; filter: brightness(0) invert(1); }
.site-head .tag {
  font-size: 13px;
  font-weight: 500;
  opacity: .92;
  text-align: right;
}

/* ---------- hero / campaign title ---------- */
.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); }

/* ---------- stepper ---------- */
.steps {
  display: flex;
  gap: 8px;
  margin: 22px 0 8px;
  flex-wrap: wrap;
}
.steps li {
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: #eef1f8;
  border-radius: 999px;
  padding: 6px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.steps li .n {
  width: 18px; height: 18px; border-radius: 50%;
  background: #cdd4e4; color: #fff;
  display: grid; place-items: center;
  font-size: 11px;
}
.steps li.active { color: #fff; background: var(--navy); }
.steps li.active .n { background: var(--red); }
.steps li.done .n { background: #2fae6a; }

/* ---------- panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 18px 0 40px;
}
.panel h2 { font-size: 17px; margin: 0 0 4px; font-weight: 700; }
.panel .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

/* ---------- zone grid ---------- */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.zone-card {
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 14px 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: border-color .12s, background .12s, transform .06s;
}
.zone-card:hover { border-color: #9fb0d8; }
.zone-card:active { transform: scale(.985); }
.zone-card.selected { border-color: var(--navy); background: #f0f2fd; }
.zone-card small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; margin-top: 2px; }

/* ---------- orientation ---------- */
.orient-row { display: flex; gap: 14px; flex-wrap: wrap; }
.orient-card {
  flex: 1 1 200px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s, background .12s;
}
.orient-card.selected { border-color: var(--navy); background: #f0f2fd; }
.orient-card .thumb {
  margin: 0 auto 10px;
  background: #eceff6 center/cover no-repeat;
  border-radius: 6px;
}
.orient-card.landscape .thumb { width: 150px; height: 95px; }
.orient-card.portrait  .thumb { width: 95px;  height: 150px; }
.orient-card b { font-size: 14px; }
.orient-card span { display: block; color: var(--muted); font-size: 12px; }

/* ---------- form ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field input[type=text] {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--navy); }
.caption-preview {
  margin-top: 6px;
  background: var(--grad);
  color: #fff;
  border-radius: 9px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 15px;
  min-height: 20px;
}

/* ---------- create screen ---------- */
.create-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.create-head h2 { margin: 0; font-size: 18px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.hint-inline { display: block; color: var(--muted); font-size: 11.5px; margin-top: 5px; }

.toggle { display: flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.toggle button {
  flex: 1; border: 0; background: #fff; padding: 9px 8px; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; color: var(--muted);
}
.toggle button + button { border-left: 1.5px solid var(--line); }
.toggle button.active { background: var(--navy); color: #fff; }

.stage-loading { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- editor / canvas ---------- */
.editor-layout { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; }
.stage {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.stage.has-canvas {
  background: #eef1f6 repeating-linear-gradient(45deg, #e7ebf3 0 10px, #eef1f6 10px 20px);
  display: grid;
  place-items: center;
}
.stage canvas { display: block; max-width: 100%; max-height: 72vh; cursor: grab; }
.stage.dragging canvas { cursor: grabbing; }
.stage .hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: rgba(18,23,46,.72); color: #fff; font-size: 12px;
  padding: 5px 11px; border-radius: 999px; pointer-events: none;
}
.controls .field label { font-size: 12px; }
.controls input[type=range] { width: 100%; }
.controls .swap-photo {
  display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600;
  color: var(--navy); cursor: pointer; text-decoration: underline;
}

.dropzone {
  border: 2px dashed #b7c1d8;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: #fafbfe;
}
.dropzone.hover { border-color: var(--navy); background: #f0f2fd; color: var(--navy); }
.dropzone b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }

/* ---------- buttons ---------- */
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  background: #eceff6;
  color: var(--ink);
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); }

/* ---------- campaign list (index) ---------- */
.camp-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.camp-list a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.camp-list a:hover { border-color: #9fb0d8; }
.camp-list h3 { margin: 0 0 4px; font-size: 16px; }
.camp-list p { margin: 0; color: var(--muted); font-size: 13px; }

.site-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0 40px; }

.msg { padding: 14px 16px; border-radius: 10px; background: #fdecec; border: 1px solid #e6a6a6; color: #8a1f1f; }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); background: #f3f5fa; border-radius: 8px; padding: 10px 12px; }

@media (max-width: 760px) {
  .editor-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 22px; }
}
