/* MotionGIF — shared site styles.
   Design system (redesign approved 2026-12-02, demo 4 / onlinegiftools style):
   white flat canvas, steel-blue #4a7fb5 primary, coral #e85a4a accent,
   cyan #0e9bd8 promo strip, pale blue-grey panel headers #e8eef5 / #eef3f9,
   white cards with pastel icon tiles, steel-blue titles and chevron circles.
   Same class names and layout behaviour as before — design only. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #2e3a4a;
  --muted: #67727f;
  --border: #dde4ec;
  --accent: #4a7fb5;
  --accent-dark: #3d6d9e;
  --accent-soft: #e8eef5;
  --panel: #eef3f9;
  --panel2: #e8eef5;
  --coral: #e85a4a;
  --cyan: #0e9bd8;
  --orange: #f59e0b;
  --ok: #047857;
  --warn: #b45309;
  --radius: 12px;
  --soft: 0 4px 16px rgba(46, 58, 74, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img, canvas { max-width: 100%; }

/* Cyan promo strip (sits above the header on every page) */
.mg-promo {
  background: var(--cyan); color: #fff; text-align: center;
  font-weight: 700; font-size: 13.5px; padding: 9px 12px;
}

/* Header */
.mg-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mg-header-in {
  max-width: 1120px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; min-height: 64px;
  flex-wrap: wrap;
}
.mg-logo {
  font-size: 21px; font-weight: 800; letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--accent); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px;
}
.mg-logo::before {
  content: ""; flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--coral)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.8v12.4c0 .8.9 1.3 1.6.9l9.2-6.2c.6-.4.6-1.4 0-1.8L9.6 4.9c-.7-.4-1.6.1-1.6.9Z' fill='%23fff'/%3E%3C/svg%3E")
    center / 21px 21px no-repeat;
}
.mg-logo span { color: var(--coral); }
.mg-logo:hover { color: var(--accent); }
.mg-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.mg-nav a {
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px;
}
.mg-nav a:hover { color: var(--accent); background: var(--panel); }

/* Layout */
.mg-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.mg-breadcrumbs { font-size: 14px; color: var(--muted); padding: 16px 0 0; }
.mg-breadcrumbs a { color: var(--muted); }
.mg-eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px;
  font-weight: 700; color: var(--accent); margin: 24px 0 4px;
}
h1 { font-size: clamp(28px, 4.5vw, 38px); line-height: 1.15; margin: 8px 0 10px; letter-spacing: -0.01em; font-weight: 600; }
h1 .mg-h1-accent { color: var(--accent); }
h2 { font-size: 24px; margin: 36px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 22px 0 6px; }
.mg-lede { font-size: 18px; color: var(--muted); max-width: 46em; margin: 0 0 8px; }
p { max-width: 46em; }
li { max-width: 44em; }

/* Hero + tool grid (homepage — informational only, no tool UI) */
.mg-hero { padding: 30px 0 4px; text-align: center; }
.mg-hero .mg-eyebrow { margin-top: 0; }
.mg-hero .mg-lede { margin-left: auto; margin-right: auto; }
.mg-filter-row { margin: 22px 0 4px; }
.mg-filter-row label { font-weight: 600; display: block; margin-bottom: 6px; }
.mg-filter {
  width: 100%; max-width: 560px; min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 9px; font-size: 16px;
  background: var(--surface); color: var(--ink);
}
.mg-cat-desc { color: var(--muted); margin: 0 0 12px; }
.mg-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.mg-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--soft); padding: 20px 40px 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.mg-card { text-decoration: none; color: var(--ink); }
a.mg-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(46, 58, 74, 0.13); color: var(--ink); }
a.mg-card::after {
  content: "›"; position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel2); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; line-height: 1;
}
.mg-card h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--accent); line-height: 1.3; }
.mg-card p { margin: 0; color: var(--muted); font-size: 14px; }
.mg-card .mg-go { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: auto; }
/* Pastel icon tiles on cards (demo 4 palette, cycled by modifier class) */
.mg-ic {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: var(--accent);
  background: #e3ecf7; margin-bottom: 6px;
}
.mg-ic.p1 { background: #e3ecf7; color: #4a7fb5; }
.mg-ic.p2 { background: #fdeceb; color: #e85a4a; }
.mg-ic.p3 { background: #fdf3d7; color: #d99a06; }
.mg-ic.p4 { background: #e2f4ec; color: #1d9d74; }
.mg-ic.p5 { background: #eee9fb; color: #7a5fd0; }
.mg-ic.p6 { background: #e0f4fa; color: #0e9bd8; }
.mg-ic.p7 { background: #fdeef6; color: #d6337f; }
.mg-ic.p8 { background: #e8eef5; color: #5b7fa6; }
.mg-ic.p9 { background: #fdf0e2; color: #e07f13; }
.mg-ic.p10 { background: #e6f2fb; color: #2f7fc4; }
.mg-ic.p11 { background: #e2f5f0; color: #0f766e; }
.mg-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mg-badge {
  align-self: flex-start; font-size: 12px; font-weight: 700;
  background: var(--panel2); color: #5b7fa6;
  border-radius: 999px; padding: 2px 10px;
}
.mg-card-soon { opacity: 0.85; }
.mg-note {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin: 28px 0 0;
}
.mg-note p { margin: 0; }

/* Tool shell — two side-by-side panels (settings | preview) */
.mg-tool {
  display: grid; gap: 20px; margin-top: 20px;
  grid-template-columns: 380px 1fr; align-items: start;
}
@media (max-width: 860px) {
  .mg-tool { grid-template-columns: 1fr; }
}
.mg-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px;
}
/* Pale blue-grey panel header bar (demo 4 tool-page panels) */
.mg-panel > h2:first-child, .mg-preview-box > h2:first-child {
  margin: -18px -18px 14px; padding: 9px 14px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  font-size: 12.5px; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.mg-field { margin-bottom: 16px; }
.mg-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.mg-field .mg-hint { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
.mg-field textarea, .mg-field select, .mg-field input[type="text"] {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-family: inherit;
}
.mg-field textarea { min-height: 96px; resize: vertical; }
.mg-field input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.mg-field input[type="color"] {
  width: 64px; height: 44px; padding: 2px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface);
}
.mg-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; }
.mg-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.mg-check label { font-weight: 600; font-size: 15px; }
.mg-row { display: flex; gap: 12px; flex-wrap: wrap; }
.mg-row > .mg-field { flex: 1 1 150px; }

.mg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mg-btn:hover { border-color: var(--accent); }
.mg-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.mg-btn-primary:hover { background: var(--accent-dark); color: #fff; }
.mg-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.mg-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(74, 127, 181, 0.45); outline-offset: 2px;
}

.mg-preview-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px;
}
.mg-preview-stage {
  display: flex; justify-content: center; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  overflow: hidden;
}
.mg-preview-stage canvas { height: auto; }
canvas.mg-checker {
  background-image:
    linear-gradient(45deg, #d7dde8 25%, transparent 25%),
    linear-gradient(-45deg, #d7dde8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dde8 75%),
    linear-gradient(-45deg, transparent 75%, #d7dde8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #f1f5f9;
}
.mg-preview-meta { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.mg-status { font-size: 15px; margin: 12px 0 0; }
.mg-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Article */
.mg-article { margin-top: 8px; }
.mg-article ul, .mg-article ol { padding-left: 22px; }
.mg-faq h3 { margin-bottom: 2px; }
.mg-faq p { margin-top: 0; color: #3c4756; }

/* Footer */
.mg-footer {
  border-top: 1px solid var(--panel2); background: var(--surface);
  margin-top: 24px;
}
.mg-footer-in {
  max-width: 1120px; margin: 0 auto; padding: 24px 16px 32px;
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between;
}
.mg-footer p { color: var(--muted); font-size: 14px; margin: 4px 0; max-width: 34em; }
.mg-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.mg-footer nav a { color: var(--muted); font-size: 14px; }
