:root {
  --red: #ed1c24;
  --red-dark: #c80f17;
  --ink: #202326;
  --muted: #687075;
  --line: #dedfdf;
  --warm: #f5f2ed;
  --soft-red: #f9e1e3;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(237, 28, 36, 0.1), transparent 24rem),
    #fbfaf8;
  font-family: "Montserrat", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(460px, 1.25fr);
  gap: clamp(48px, 7vw, 110px);
  width: min(1320px, calc(100% - 64px));
  min-height: calc(100vh - 76px);
  margin-inline: auto;
  padding: 72px 0 58px;
  align-items: center;
}

.intro {
  max-width: 545px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.eyebrow span {
  width: 28px;
  height: 2px;
  background: currentColor;
}

h1 {
  margin: 20px 0 22px;
  font-size: clamp(42px, 4.9vw, 68px);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--red);
  font-style: normal;
}

.lead {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.68;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0;
  border-block: 1px solid var(--line);
}

.step {
  min-width: 0;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
}

.step:first-child {
  padding-left: 0;
}

.step:last-child {
  border-right: 0;
}

.step b,
.step span {
  display: block;
}

.step b {
  margin-bottom: 7px;
  color: var(--red);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.step span {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.upload-panel {
  padding: 22px;
  border: 1px dashed #c8cbcd;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
  transition: 0.2s ease;
}

.upload-panel.is-dragging {
  border-color: var(--red);
  background: var(--soft-red);
  transform: translateY(-1px);
}

#logo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.primary-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--red);
  box-shadow: 0 14px 28px rgba(237, 28, 36, 0.18);
}

.primary-button:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.primary-button:focus-within,
.download-button:focus-visible {
  outline: 3px solid rgba(237, 28, 36, 0.22);
  outline-offset: 3px;
}

.primary-button svg,
.download-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-status {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.file-status.success {
  color: #178742;
}

.file-status.error {
  color: var(--red-dark);
}

.privacy-note {
  margin: 16px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #7c8285;
  font-size: 10px;
  line-height: 1.55;
}

.download-button {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: var(--ink);
}

.download-button:hover:not(:disabled) {
  background: #090a0b;
  transform: translateY(-1px);
}

.download-button:disabled {
  color: #9da2a4;
  background: #e7e8e8;
  cursor: not-allowed;
}

.preview-section {
  min-width: 0;
}

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.preview-kicker {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

h2 {
  margin: 7px 0 0;
  font-size: clamp(24px, 2.3vw, 34px);
  letter-spacing: -0.04em;
}

.format-pill {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #606669;
  background: var(--warm);
  font-size: 10px;
  font-weight: 800;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(32, 35, 38, 0.16);
}

#design-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.logo-hint {
  position: absolute;
  right: 4.25%;
  bottom: 2.8%;
  display: grid;
  place-items: center;
  width: 25%;
  height: 7.1%;
  pointer-events: none;
}

.logo-hint span {
  color: #b5b7b8;
  font-size: clamp(7px, 0.8vw, 11px);
  font-weight: 700;
  text-align: center;
}

.logo-hint.is-hidden {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px max(32px, calc((100% - 1320px) / 2));
  color: rgba(255, 255, 255, 0.58);
  background: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

footer span:first-child {
  color: #fff;
  font-weight: 900;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100% - 40px));
    padding-top: 52px;
  }

  .intro {
    max-width: 680px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 28px, 520px);
    gap: 48px;
    padding: 38px 0 46px;
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 15px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step,
  .step:first-child {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .step:last-child {
    border-bottom: 0;
  }

  .step b {
    margin: 0;
  }

  .preview-heading {
    align-items: flex-start;
  }

  .format-pill {
    margin-top: 2px;
  }

  footer {
    flex-direction: column;
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Two-step template selection and personalization flow. */
[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 78px;
  padding: 13px max(32px, calc((100% - 1320px) / 2));
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(13px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.brand span {
  color: #4d5052;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong {
  color: var(--red);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.progress {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.progress li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9a9ea0;
  font-size: 12px;
  font-weight: 800;
}

.progress li:not(:last-child)::after {
  content: "";
  width: 22px;
  height: 1px;
  margin-left: 4px;
  background: #d7d9da;
}

.progress b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: inherit;
  background: #f0f0ef;
  font-size: 10px;
}

.progress li.is-active {
  color: var(--ink);
}

.progress li.is-active b,
.progress li.is-complete b {
  color: #fff;
  background: var(--red);
}

.progress li.is-complete {
  color: var(--red);
}

main {
  min-height: calc(100vh - 154px);
}

.screen {
  width: min(1320px, calc(100% - 64px));
  margin-inline: auto;
}

.template-screen {
  padding: clamp(62px, 8vw, 104px) 0 92px;
}

.screen-heading {
  max-width: 850px;
  margin: 0 auto 52px;
  text-align: center;
}

.screen-heading .eyebrow {
  justify-content: center;
}

.screen-heading h1 {
  max-width: 850px;
  margin-inline: auto;
}

.screen-heading .lead {
  margin-inline: auto;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
  gap: 25px;
  max-width: 1120px;
  margin-inline: auto;
  justify-content: center;
}

.template-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(32, 35, 38, 0.08);
  transition: 0.22s ease;
}

.template-card:hover,
.template-card:focus-visible {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 24px 58px rgba(32, 35, 38, 0.15);
  transform: translateY(-4px);
}

.template-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f2f1ef;
}

.template-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.25s ease;
}

.template-card:hover img {
  transform: scale(1.015);
}

.choose-label {
  position: absolute;
  right: 15px;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 10px 25px rgba(82, 0, 4, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.choose-label b {
  font-size: 18px;
}

.template-copy {
  display: block;
  padding: 23px 24px 26px;
}

.template-copy small,
.template-copy strong {
  display: block;
}

.template-copy small {
  margin-bottom: 9px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.template-copy strong {
  font-size: 17px;
  line-height: 1.35;
}

.editor-screen {
  padding: 28px 0 68px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border: 0;
  color: #5d6467;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.back-button:hover {
  color: var(--red);
}

.back-button span {
  font-size: 18px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(350px, 0.72fr) minmax(500px, 1.28fr);
  gap: clamp(50px, 7vw, 100px);
  padding-top: 22px;
  align-items: center;
}

.editor-panel {
  max-width: 510px;
}

.editor-panel h1 {
  font-size: clamp(39px, 4vw, 58px);
}

.form-section {
  margin-top: 29px;
}

.field-label,
.field > span {
  display: block;
  margin-bottom: 9px;
  color: #454a4d;
  font-size: 13px;
  font-weight: 800;
}

.field > span small {
  color: #8b9092;
  font-size: 11px;
  font-weight: 600;
}

.editor-panel .upload-panel {
  padding: 15px;
}

.editor-panel .primary-button {
  min-height: 49px;
}

.editor-panel .file-status {
  font-size: 12px;
}

.clear-logo {
  display: block;
  margin: 10px auto 0;
  padding: 4px;
  border: 0;
  color: #686e71;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.clear-logo:hover {
  color: var(--red);
}

.alternative {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0;
  color: #a3a7a9;
  font-size: 12px;
  font-weight: 700;
}

.alternative::before,
.alternative::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.field {
  display: block;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #d7dadb;
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  transition: 0.18s ease;
}

.field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.field input:disabled {
  color: #9b9fa1;
  background: #f1f1ef;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 15px;
}

.editor-panel .privacy-note {
  margin: 17px 0 0;
  font-size: 12px;
}

.download-help {
  margin: 10px 0 0;
  color: #8a9093;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.download-help.success {
  color: #178742;
}

.editor-layout .logo-hint {
  right: 6.55%;
  bottom: 3.35%;
  width: 34.8%;
  height: 9.2%;
}

.editor-layout .logo-hint span {
  font-size: clamp(7px, 0.7vw, 10px);
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .progress li {
    font-size: 0;
  }

  .progress li:not(:last-child)::after {
    width: 17px;
  }

  .editor-layout {
    grid-template-columns: 1fr;
    width: min(760px, 100%);
    margin-inline: auto;
  }

  .editor-panel {
    max-width: 680px;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
    padding-inline: 18px;
  }

  .brand span {
    display: none;
  }

  .brand strong {
    font-size: 22px;
  }

  .screen {
    width: min(100% - 28px, 620px);
  }

  .template-screen {
    padding: 58px 0 68px;
  }

  .screen-heading {
    margin-bottom: 35px;
    text-align: left;
  }

  .screen-heading .eyebrow {
    justify-content: flex-start;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .template-card {
    max-width: 470px;
  }

  .editor-screen {
    padding-top: 15px;
  }

  .editor-layout {
    gap: 45px;
    padding-top: 12px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .progress {
    gap: 6px;
  }

  .progress li:not(:last-child)::after {
    width: 9px;
    margin-left: 0;
  }

  .progress b {
    width: 23px;
    height: 23px;
  }
}
