:root {
  --bg: #f6f7f3;
  --panel: #ffffff;
  --ink: #18201d;
  --muted: #65706a;
  --line: #dde3dc;
  --soft-line: #eef1ec;
  --accent: #16806d;
  --accent-2: #d66b3d;
  --gold: #e7a92f;
  --shadow: 0 26px 80px rgba(31, 42, 37, 0.14);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(22, 128, 109, 0.07), transparent 36%),
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 52%, #eef1ec 100%);
  color: var(--ink);
}

button,
a,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #18201d;
  color: #fff;
  font-weight: 850;
  font-size: 0.82rem;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 1rem;
  line-height: 1.15;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.topbar-actions,
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.nav-link:hover {
  background: #f2f5f1;
  color: var(--ink);
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 28px rgba(24, 32, 29, 0.18);
}

.button-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  min-height: 0;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
}

.controls {
  padding: 32px clamp(20px, 3vw, 42px);
  overflow: auto;
}

.intro-block {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 860;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-block h1 {
  font-size: clamp(2rem, 1.55rem + 1.6vw, 3.05rem);
  line-height: 1;
  margin: 0;
  letter-spacing: 0;
}

.intro-block p:not(.eyebrow) {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.trust-row span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfa;
  color: #39443f;
  padding: 0 11px;
  font-size: 0.78rem;
  font-weight: 760;
}

.trust-row svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.control-form {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--soft-line);
  padding-top: 22px;
}

.form-section-heading {
  display: grid;
  gap: 5px;
}

.form-section-heading h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.form-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.option-group legend {
  color: #39443f;
  font-weight: 760;
  font-size: 0.82rem;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7ded6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.35;
}

.field input[type="color"] {
  padding: 5px;
  min-height: 44px;
  cursor: pointer;
}

.field input[type="file"] {
  padding: 9px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 128, 109, 0.13);
}

.field-row {
  display: grid;
  grid-template-columns: 0.58fr 1fr;
  gap: 12px;
}

.option-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.template-option,
.segmented button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.template-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-weight: 720;
}

.template-option.is-active,
.segmented button.is-active {
  border-color: var(--accent);
  background: #f7fbf8;
  box-shadow: 0 0 0 4px rgba(22, 128, 109, 0.11);
}

.template-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  flex: 0 0 auto;
}

.template-swatch.clean {
  background: linear-gradient(135deg, #0f9f8f 0 48%, #ff6f59 48% 100%);
}

.template-swatch.cafe {
  background: linear-gradient(135deg, #2f7d5b 0 45%, #f2b84b 45% 100%);
}

.template-swatch.salon {
  background: linear-gradient(135deg, #c84a7a 0 45%, #1f2330 45% 100%);
}

.template-swatch.barber {
  background: linear-gradient(135deg, #cb2d3e 0 33%, #ffffff 33% 66%, #2657a8 66%);
}

.template-swatch.clinic {
  background: linear-gradient(135deg, #2f80ed 0 45%, #28b487 45% 100%);
}

.template-swatch.auto {
  background: linear-gradient(135deg, #20242b 0 55%, #f7b731 55% 100%);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented button {
  padding: 0 10px;
  font-weight: 760;
}

.preview-area {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 24px clamp(18px, 3vw, 40px) 36px;
}

.policy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #dfe5de;
  border-radius: 8px;
  background: #fbfcfa;
}

.policy-note svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.policy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 680;
}

.site-footer a:hover {
  color: var(--ink);
}

.simple-page {
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 24px;
  padding: clamp(22px, 5vw, 54px);
}

.simple-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.simple-panel {
  width: min(100%, 720px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(26, 34, 45, 0.1);
  padding: clamp(22px, 4vw, 38px);
}

.simple-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.simple-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

.simple-panel a:not(.button) {
  color: var(--ink);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.stack-form .button {
  justify-self: start;
}

.hidden-field {
  display: none;
}

.netlify-form-stubs {
  display: none;
}

.legal-copy h2 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.preview-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.preview-title strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0 13px;
  font-weight: 730;
  font-size: 0.84rem;
}

.poster-stage {
  min-height: 0;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 14px 0 24px;
}

.poster {
  width: min(100%, 560px);
  aspect-ratio: var(--poster-aspect, 8.5 / 11);
  background: #fff;
  color: var(--poster-ink, #17202a);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(24, 32, 29, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 6.6%, 46px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.poster[data-size="card"] {
  width: min(100%, 390px);
}

.poster.clean {
  --poster-bg: #ffffff;
  --poster-soft: #e7f7f5;
  --poster-ink: #17202a;
  --poster-accent: var(--accent);
  --poster-accent-2: #ff6f59;
}

.poster.cafe {
  --poster-bg: #fffdf7;
  --poster-soft: #e6f2e9;
  --poster-ink: #1f2a25;
  --poster-accent: #2f7d5b;
  --poster-accent-2: #f2b84b;
}

.poster.salon {
  --poster-bg: #fff8fb;
  --poster-soft: #f9e4ec;
  --poster-ink: #20232d;
  --poster-accent: #c84a7a;
  --poster-accent-2: #7dd3c7;
}

.poster.barber {
  --poster-bg: #ffffff;
  --poster-soft: #edf2fb;
  --poster-ink: #151922;
  --poster-accent: #cb2d3e;
  --poster-accent-2: #2657a8;
}

.poster.clinic {
  --poster-bg: #f9fcff;
  --poster-soft: #e9f6ff;
  --poster-ink: #162236;
  --poster-accent: #2f80ed;
  --poster-accent-2: #28b487;
}

.poster.auto {
  --poster-bg: #fbfbf7;
  --poster-soft: #f7efd5;
  --poster-ink: #20242b;
  --poster-accent: #20242b;
  --poster-accent-2: #f7b731;
}

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, var(--poster-soft), transparent 43%),
    linear-gradient(172deg, transparent 0 68%, rgba(255, 111, 89, 0.12) 68% 100%),
    var(--poster-bg);
  z-index: -2;
}

.poster::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -8%;
  width: 52%;
  height: 30%;
  background: var(--poster-accent-2);
  opacity: 0.13;
  transform: rotate(-11deg);
  z-index: -1;
}

.poster-stripes {
  position: absolute;
  inset: 0 0 auto;
  height: 15px;
  background: repeating-linear-gradient(
    90deg,
    var(--poster-accent) 0 34px,
    var(--poster-accent-2) 34px 68px,
    #fff 68px 102px
  );
  opacity: 0.9;
}

.poster-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.poster-logo {
  width: clamp(58px, 13%, 78px);
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--poster-accent);
  font-weight: 900;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 13px 30px rgba(24, 32, 29, 0.13);
}

.poster-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.poster-logo.has-image img {
  display: block;
}

.poster-logo.has-image span {
  display: none;
}

.poster-eyebrow {
  color: var(--poster-accent);
  font-weight: 860;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 1.4vw, 0.8rem);
  letter-spacing: 0.08em;
}

.poster h2 {
  margin: 2px 0 0;
  line-height: 1.02;
  letter-spacing: 0;
  font-size: clamp(1.6rem, 5.8vw, 3rem);
  max-width: 12ch;
  overflow-wrap: anywhere;
}

.poster-rating {
  display: flex;
  gap: clamp(7px, 1.5vw, 12px);
  margin: clamp(20px, 4vw, 34px) 0 clamp(14px, 3vw, 24px);
}

.poster-rating span {
  width: clamp(22px, 5vw, 38px);
  aspect-ratio: 1;
  background: var(--gold);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  filter: drop-shadow(0 6px 8px rgba(105, 76, 14, 0.12));
}

.poster-main {
  display: grid;
  gap: clamp(12px, 2.5vw, 18px);
  margin-bottom: clamp(20px, 4vw, 34px);
}

.poster-headline {
  margin: 0;
  max-width: 12ch;
  font-weight: 930;
  line-height: 0.96;
  letter-spacing: 0;
  font-size: clamp(2.6rem, 10vw, 5.9rem);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.poster-message {
  margin: 0;
  color: #4e5a55;
  max-width: 36ch;
  line-height: 1.35;
  font-weight: 620;
  font-size: clamp(1rem, 2.3vw, 1.35rem);
}

.qr-panel {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(24, 32, 29, 0.12);
  border-radius: 8px;
  padding: clamp(12px, 2.8vw, 20px);
  box-shadow: 0 18px 45px rgba(24, 32, 29, 0.15);
}

.qr-code {
  width: clamp(150px, 31vw, 230px);
  height: clamp(150px, 31vw, 230px);
  display: grid;
  place-items: center;
}

.qr-code canvas,
.qr-code img {
  width: clamp(150px, 31vw, 230px);
  height: clamp(150px, 31vw, 230px);
  display: block;
}

.poster-footer {
  display: grid;
  gap: 6px;
  margin-top: clamp(18px, 3vw, 28px);
  color: var(--poster-ink);
}

.poster-footer strong {
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  line-height: 1.1;
}

.poster-footer span {
  font-size: clamp(0.72rem, 1.7vw, 0.95rem);
  color: #65706a;
  overflow-wrap: anywhere;
}

@media (max-width: 880px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-area {
    padding-top: 16px;
  }

  .poster-stage {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .preview-toolbar {
    width: 100%;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .preview-actions {
    width: 100%;
  }

  .preview-actions .button {
    flex: 1;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .status-pill {
    justify-content: center;
  }

  .field-row,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .poster {
    border-radius: 6px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .controls,
  .preview-toolbar {
    display: none;
  }

  .workspace,
  .preview-area,
  .poster-stage {
    display: block;
    padding: 0;
    margin: 0;
  }

  .poster {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
