/* Photo to Coloring Page — styles */
:root {
  --accent: #f97316;        /* warm orange */
  --accent-dark: #ea580c;
  --accent-soft: #fff4ec;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fffdfb;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(31, 41, 55, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 41, 55, 0.06);
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: transform .05s, background .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; }

/* ---------- navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 251, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 15px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 24px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.5px; }
.hero h1 .hl { color: var(--accent); }
.hero .sub { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 10px; }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

/* ---------- tool ---------- */
.tool { padding: 20px 0 48px; }
.tool-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
}

.dropzone {
  margin: 26px; border: 2px dashed #f0c9ad; border-radius: 18px;
  background: var(--accent-soft);
  padding: 54px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: #fff0e6; }
.dropzone .dz-icon { font-size: 46px; margin-bottom: 10px; }
.dropzone h3 { margin: 0 0 6px; font-size: 20px; }
.dropzone p { margin: 0; color: var(--muted); }
.dz-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* editor */
.editor { display: grid; grid-template-columns: 1fr 320px; gap: 0; }
.preview {
  position: relative; padding: 22px; background: #faf7f4;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.pane { text-align: center; }
.pane h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pane .canvas-box {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; min-height: 180px; display: grid; place-items: center;
}
.pane canvas { max-width: 100%; max-height: 420px; border-radius: 6px; }

.controls { padding: 22px; border-left: 1px solid var(--line); }
.controls h3 { margin: 0 0 14px; font-size: 16px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.preset:hover { border-color: var(--accent); }
.preset.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field.checkbox label { justify-content: flex-start; gap: 8px; cursor: pointer; font-weight: 500; }

.export-row { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.control-foot { display: flex; justify-content: space-between; margin-top: 14px; }

.spinner {
  position: absolute; inset: 22px; background: rgba(255,255,255,.6);
  display: grid; place-items: center; border-radius: 12px; z-index: 5;
}
.spinner .dot {
  width: 34px; height: 34px; border: 4px solid var(--accent-soft);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  margin: 0 26px 20px; background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px; font-size: 14px;
}

/* dialog */
dialog {
  border: none; border-radius: 18px; padding: 0; box-shadow: var(--shadow);
  max-width: 380px; width: 92%;
}
dialog::backdrop { background: rgba(31,41,55,.45); }
.dialog-body { padding: 24px; }
.dialog-body h3 { margin: 0 0 16px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.select-field { margin-bottom: 14px; }
.select-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.select-field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: 14px; background: #fff;
}

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-title { text-align: center; margin: 0 0 8px; font-size: 30px; }
.section-lead { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 36px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-align: center; box-shadow: var(--shadow-sm);
}
.step .num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 800; display: grid; place-items: center; margin: 0 auto 12px; font-size: 18px;
}
.step h3 { margin: 0 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ba-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.ba-imgs { display: grid; grid-template-columns: 1fr 1fr; }
.ba-imgs figure { margin: 0; position: relative; }
.ba-imgs figcaption {
  position: absolute; bottom: 6px; left: 6px; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 999px;
}
.ba-imgs svg { display: block; width: 100%; height: auto; background: #fff; }
.ba-card p { margin: 0; padding: 14px 16px; font-size: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.info-card h3 { margin: 0 0 8px; font-size: 18px; }
.info-card p { margin: 0; color: var(--muted); font-size: 15px; }

.ad-slot {
  margin: 40px auto; max-width: 728px; min-height: 90px;
  border: 1px dashed var(--line); border-radius: 12px;
  display: grid; place-items: center; color: #c4c4c4; font-size: 13px;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 16px 20px; font-size: 16px; font-weight: 600; font-family: inherit; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q::after { content: '+'; color: var(--accent); font-size: 22px; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; padding: 0 20px; color: var(--muted); }
.faq-item.open .faq-a { max-height: 260px; padding: 0 20px 18px; }

/* alt background */
.alt { background: #faf6f2; }

/* footer */
.footer { background: #1f2937; color: #cbd5e1; padding: 48px 0 28px; margin-top: 40px; }
.footer a { color: #e5e7eb; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #fff; margin: 0 0 12px; font-size: 15px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer .brand { color: #fff; margin-bottom: 10px; }
.footer .brand .logo { background: var(--accent); }
.footer-bottom { border-top: 1px solid #374151; margin-top: 32px; padding-top: 18px; font-size: 13px; color: #9ca3af; text-align: center; }

/* simple page (privacy/terms/about) */
.page { max-width: 760px; margin: 0 auto; padding: 48px 20px 20px; }
.page h1 { font-size: 34px; margin: 0 0 6px; }
.page h2 { font-size: 22px; margin: 30px 0 10px; }
.page p, .page li { color: #374151; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .editor { grid-template-columns: 1fr; }
  .controls { border-left: none; border-top: 1px solid var(--line); }
  .steps, .gallery, .cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 20px; width: 100%; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .preview { grid-template-columns: 1fr; }
}

/* ---------- cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-width: 720px; margin: 0 auto;
}
.cookie-inner {
  display: flex; align-items: center; gap: 18px; padding: 16px 20px;
}
.cookie-text { margin: 0; font-size: 14px; color: var(--ink); flex: 1; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-actions .btn { padding: 9px 18px; font-size: 14px; }
@media (max-width: 560px) {
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}
