.sfa-designer {
  --sfa-navy: #102a43;
  --sfa-navy-deep: #071a2d;
  --sfa-red: #a61b29;
  --sfa-gold: #b99032;
  --sfa-ink: #172331;
  --sfa-muted: #5d6875;
  --sfa-line: #d8dee6;
  --sfa-surface: #f6f8fb;
  --sfa-white: #fff;
  clear: both;
  margin: 2rem 0;
  border: 1px solid var(--sfa-line);
  border-radius: 18px;
  background: var(--sfa-white);
  box-shadow: 0 18px 45px rgb(16 42 67 / 10%);
  color: var(--sfa-ink);
  overflow: hidden;
}

.sfa-designer *,
.sfa-designer *::before,
.sfa-designer *::after {
  box-sizing: border-box;
}

.sfa-designer__heading {
  position: relative;
  padding: 1.35rem clamp(1.25rem, 4vw, 2.4rem);
  border-bottom: 4px solid var(--sfa-gold);
  background:
    linear-gradient(118deg, rgb(7 26 45 / 98%), rgb(16 42 67 / 94%)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgb(255 255 255 / 3%) 8px 9px);
  color: var(--sfa-white);
}

.sfa-designer__heading::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 100%;
  background: var(--sfa-red);
  content: "";
}

.sfa-designer__heading h2 {
  margin: 0.15rem 0 0.4rem;
  color: var(--sfa-white);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
}

.sfa-designer__heading > p:last-child {
  max-width: 74ch;
  margin: 0;
  color: rgb(255 255 255 / 82%);
  font-size: 0.96rem;
}

.sfa-designer__eyebrow {
  margin: 0;
  color: #f2d98d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sfa-designer__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1.25rem, 4vw, 2.4rem);
}

.sfa-designer__preview-column {
  min-width: 0;
}

.sfa-preview {
  position: sticky;
  top: 1rem;
  isolation: isolate;
  width: 100%;
  min-height: 340px;
  aspect-ratio: 4 / 3;
  border: 1px solid #cbd4de;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 35%, rgb(255 255 255 / 98%), rgb(233 238 244 / 92%)),
    linear-gradient(135deg, #eef2f6, #dce4ec);
  box-shadow: inset 0 0 0 6px rgb(255 255 255 / 70%), 0 12px 30px rgb(16 42 67 / 12%);
  overflow: hidden;
}

.sfa-preview::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 1px solid rgb(185 144 50 / 36%);
  border-radius: 14px;
  content: "";
  pointer-events: none;
}

.sfa-preview__image {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.sfa-preview__placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  color: #768392;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sfa-preview__area {
  position: absolute;
  z-index: 3;
  top: var(--sfa-y);
  left: var(--sfa-x);
  display: grid;
  width: var(--sfa-w);
  height: var(--sfa-h);
  place-items: center;
  padding: 2px 4px;
  border: 1px dashed rgb(16 42 67 / 20%);
  border-radius: 4px;
  color: rgb(16 42 67 / 42%);
  line-height: 1.08;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}

.sfa-preview__area span {
  display: block;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.08;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sfa-preview__area--filled {
  border-color: transparent;
  color: #111820;
  text-shadow: 0 1px 1px rgb(255 255 255 / 45%);
}

.sfa-preview.sfa-font--clean-sans-serif .sfa-preview__area span {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.sfa-preview.sfa-font--formal-script .sfa-preview__area span {
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-weight: 500;
}

.sfa-preview.sfa-font--military-stencil .sfa-preview__area span {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sfa-preview__artwork {
  position: absolute;
  z-index: 2;
  top: 12%;
  left: 7%;
  display: grid;
  width: 21%;
  height: 21%;
  place-items: center;
  padding: 4px;
  border: 1px dashed rgb(16 42 67 / 30%);
  border-radius: 7px;
  background: rgb(255 255 255 / 38%);
}

.sfa-preview__artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sfa-preview__note {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 0.8rem;
  padding: 0.8rem 0.95rem;
  border-left: 3px solid var(--sfa-gold);
  background: #fbf8ef;
  color: #54504a;
  font-size: 0.84rem;
  line-height: 1.45;
}

.sfa-preview__note > span {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--sfa-navy);
  color: var(--sfa-white);
  font-size: 0.72rem;
  font-weight: 800;
}

.sfa-designer__controls {
  min-width: 0;
}

.sfa-field {
  margin: 0 0 1rem;
}

.sfa-field > label,
.sfa-upload-field > label {
  display: block;
  margin: 0 0 0.4rem;
  color: var(--sfa-ink);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sfa-required {
  color: var(--sfa-red);
}

.sfa-field input[type="text"],
.sfa-field input[type="file"],
.sfa-field textarea,
.sfa-field select {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0.72rem 0.8rem;
  border: 1px solid #b8c3cf;
  border-radius: 8px;
  background: var(--sfa-white);
  color: var(--sfa-ink);
  font: inherit;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgb(7 26 45 / 3%);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.sfa-field input[type="file"] {
  padding: 0.5rem;
  background: var(--sfa-surface);
}

.sfa-field input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: var(--sfa-navy);
  color: var(--sfa-white);
  font-weight: 750;
  cursor: pointer;
}

.sfa-field input:focus,
.sfa-field textarea:focus,
.sfa-field select:focus {
  outline: none;
  border-color: var(--sfa-navy);
  box-shadow: 0 0 0 3px rgb(16 42 67 / 14%);
}

.sfa-field input:invalid:focus,
.sfa-field textarea:invalid:focus,
.sfa-proof-approval input:invalid:focus {
  border-color: var(--sfa-red);
  box-shadow: 0 0 0 3px rgb(166 27 41 / 13%);
}

.sfa-field__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.3rem;
  color: var(--sfa-muted);
  font-size: 0.76rem;
}

.sfa-option-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.85rem;
  padding-top: 0.2rem;
}

.sfa-help,
.sfa-upload-status {
  margin: 0.4rem 0 0;
  color: var(--sfa-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.sfa-upload-status:not(:empty) {
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: #eef5ed;
  color: #24582b;
  font-weight: 700;
}

.sfa-designer__summary {
  margin: 1.15rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--sfa-line);
  border-radius: 10px;
  background: var(--sfa-surface);
}

.sfa-designer__summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.26rem 0;
  color: var(--sfa-muted);
  font-size: 0.9rem;
}

.sfa-designer__summary strong {
  color: var(--sfa-ink);
}

.sfa-designer__summary .sfa-designer__total {
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid #cbd4de;
  color: var(--sfa-ink);
  font-size: 1rem;
  font-weight: 800;
}

.sfa-designer__total strong {
  color: var(--sfa-red);
  font-size: 1.12rem;
}

.sfa-proof-approval {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.95rem;
  border: 1px solid #d7c58d;
  border-radius: 9px;
  background: #fffaf0;
  color: #453d29;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
  cursor: pointer;
}

.sfa-proof-approval input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0.08rem 0 0;
  accent-color: var(--sfa-navy);
}

.sfa-designer + .quantity,
.sfa-designer ~ .quantity {
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .sfa-designer__workspace {
    grid-template-columns: 1fr;
  }

  .sfa-preview {
    position: relative;
    top: auto;
    max-width: 720px;
    margin-inline: auto;
  }
}

@media (max-width: 540px) {
  .sfa-designer {
    border-radius: 12px;
  }

  .sfa-designer__workspace,
  .sfa-designer__heading {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .sfa-preview {
    min-height: 260px;
  }

  .sfa-option-controls {
    grid-template-columns: 1fr;
  }

  .sfa-field__meta {
    gap: 0.5rem;
    font-size: 0.72rem;
  }
}

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