/* ==========================================================================
   poster.css — the promo poster studio. Deliberately small and self-contained
   rather than pulling in the main site's stylesheet: this is an internal tool
   and it shouldn't drag 1,700 lines of landing-page CSS along with it.
   ========================================================================== */

:root {
  --ink: #0a0a0b;
  --ink-2: #121316;
  --card: #17181c;
  --line: rgba(255,255,255,.09);
  --txt: #f4f5f7;
  --txt-2: rgba(244,245,247,.76);
  --txt-3: rgba(244,245,247,.46);
  --red: #c3002f;
  --red-lift: #ff5a76;
  --green: #86efac;
  --r: 14px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--txt);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
}

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,11,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar__back {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--txt-3); text-decoration: none; font-size: 13.5px;
  transition: color .2s var(--ease);
}
.topbar__back:hover { color: var(--txt); }
.topbar__back .ms { font-size: 18px; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.3; }
.topbar__title strong { font-size: 15px; font-weight: 600; }
.topbar__title span { font-size: 12px; color: var(--txt-3); }

/* ── layout ── */
.wrap {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  padding: clamp(18px, 3vw, 34px);
  max-width: 1500px; margin: 0 auto;
}

.panel {
  position: sticky; top: 78px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.008));
}
.panel__title {
  margin: 26px 0 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--txt-3);
}
.panel__title:first-child { margin-top: 0; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.field label { font-size: 13px; font-weight: 500; color: var(--txt-2); }
.field label em { font-style: normal; color: var(--txt-3); }

input[type="text"], select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: inherit;
  font: inherit; font-size: 14.5px;
  appearance: none; -webkit-appearance: none;
  color-scheme: dark;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input::placeholder { color: rgba(255,255,255,.3); }
input:focus, select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(195,0,47,.16);
}
.select { position: relative; }
.select select { padding-right: 40px; cursor: pointer; }
.select select option { background: #15171c; color: var(--txt); }
.select .ms {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--txt-3); font-size: 20px;
}

.seg {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.seg__btn {
  flex: 1; padding: 8px 10px;
  border: 0; border-radius: 9px;
  background: none; color: var(--txt-3);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg__btn:hover { color: var(--txt-2); }
.seg__btn.is-active { background: rgba(255,255,255,.1); color: var(--txt); }

.check {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 2px; font-size: 13.5px; color: var(--txt-2); cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  display: grid; place-items: center;
  width: 20px; height: 20px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255,255,255,.04);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.check__box .ms { font-size: 15px; color: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.check input:checked + .check__box { background: var(--red); border-color: var(--red); }
.check input:checked + .check__box .ms { transform: scale(1); }

.hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--txt-3); }
.hint:empty { display: none; }
.hint strong { color: var(--green); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  border: 1px solid transparent; border-radius: 11px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn .ms { font-size: 18px; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: #d80435; }
.btn--ghost { border-color: var(--line); background: rgba(255,255,255,.03); color: var(--txt-2); }
.btn--ghost:hover { background: rgba(255,255,255,.08); color: var(--txt); }

/* ── preview ── */
.preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preview__stage {
  width: 100%;
  display: grid; place-items: center;
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid var(--line); border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.005)),
    repeating-conic-gradient(rgba(255,255,255,.022) 0% 25%, transparent 0% 50%) 50% / 22px 22px;
}
#poster {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: min(74vh, 900px);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.preview__note { margin: 0; font-size: 12.5px; color: var(--txt-3); text-align: center; }
.preview__note code {
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255,255,255,.06);
  font-size: 12px;
}

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 50;
  padding: 12px 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(22,23,27,.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 13.5px;
  opacity: 0; visibility: hidden;
  transform: translate3d(-50%, 12px, 0);
  transition: opacity .3s var(--ease), transform .35s var(--ease), visibility .3s;
}
.toast.is-up { opacity: 1; visibility: visible; transform: translate3d(-50%, 0, 0); }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .panel { position: static; }
  .preview { order: -1; }
  #poster { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
}
