:root {
  --navy-950: #151d29;
  --navy-900: #1f2937;
  --navy-800: #293545;
  --navy-700: #364456;
  --gold: #e0d6c8;
  --gold-soft: #f2ece4;
  --ink: #1f2937;
  --muted: #687386;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f4f5f6;
  --success: #147a52;
  --warning: #95620d;
  --danger: #a83d3d;
  --shadow: 0 20px 55px rgba(11, 24, 42, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 0%, rgba(224, 214, 200, .28), transparent 24rem),
    var(--canvas);
  font-family: "Poppins", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-header {
  color: #fff;
  background:
    linear-gradient(95deg, rgba(31,41,55,.98), rgba(31,41,55,.93)),
    url("brand-hero.jpg") center 47%/cover;
  border-bottom: 3px solid var(--gold);
}
.app-header__inner {
  width: min(1480px, calc(100% - 48px));
  min-height: 112px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 215px 1fr auto;
  align-items: center;
  gap: 34px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 191px; height: auto; display: block; }
.header-copy { padding-left: 34px; border-left: 1px solid rgba(255,255,255,.22); }
.header-copy h1 { margin: 5px 0 0; font-size: clamp(21px, 2vw, 30px); letter-spacing: -.025em; }
.eyebrow, .section-kicker, .panel-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow { color: var(--gold-soft); }
.header-status { font-size: 12px; color: #dbe2eb; display: flex; align-items: center; gap: 9px; }
.header-status span { width: 8px; height: 8px; border-radius: 50%; background: #6ed7a5; box-shadow: 0 0 0 5px rgba(110,215,165,.13); }

.page-shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 58px; }
.intro { display: grid; grid-template-columns: 1fr minmax(360px, 650px); gap: 56px; align-items: end; margin: 0 0 28px; }
.section-kicker { color: var(--gold); }
.intro h2 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.045em; line-height: 1.05; }
.intro p { margin: 0 0 5px; color: var(--muted); line-height: 1.75; }

.app-grid { display: grid; grid-template-columns: minmax(390px, 520px) minmax(610px, 1fr); gap: 24px; align-items: start; }
.workspace { min-width: 0; display: grid; gap: 24px; }
.panel { background: var(--surface); border: 1px solid rgba(19,32,51,.08); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel--form { padding: 28px; position: sticky; top: 20px; }
.panel--preview { padding: 28px; }
.panel-heading { display: flex; gap: 15px; align-items: center; margin-bottom: 27px; }
.panel-heading--row { justify-content: space-between; }
.panel-heading__main { display: flex; gap: 15px; align-items: center; }
.step-number { flex: 0 0 43px; width: 43px; height: 43px; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.panel-label { color: var(--gold); }
.panel h3 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.025em; }
.compatibility-badge { color: var(--muted); background: #f5f7f9; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }

.field-grid { display: grid; gap: 15px; }
.field-grid--2 { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; }
.field--wide { grid-column: 1 / -1; }
.field > span { font-size: 12px; color: #3d485a; font-weight: 700; }
.field em { color: var(--muted); font-size: 10px; font-weight: 500; font-style: normal; }
.field input {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); background: #fff; padding: 0 13px; outline: none; transition: .2s ease;
}
.field input::placeholder { color: #a3abb7; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(224,214,200,.32); }
.field--compact { margin-top: 13px; }
.social-fields { gap: 12px; }
.optional-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.form-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.field--compact input { height: 42px; font-size: 12px; }
.form-divider { height: 1px; background: var(--line); margin: 25px 0; }

.asset-section { min-width: 0; }
.asset-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.asset-heading h4 { margin: 4px 0 0; font-size: 15px; }
.text-button { border: 0; padding: 5px 0; background: none; color: var(--gold); font-size: 11px; font-weight: 800; }
.text-button:hover { color: var(--navy-900); }
.upload-row { display: grid; grid-template-columns: 1fr 112px; gap: 12px; align-items: stretch; }
.upload-row--photo { grid-template-columns: 1fr auto; align-items: center; }
.upload-box { min-width: 0; min-height: 72px; border: 1px dashed #b9c1cc; border-radius: 10px; background: #fafbfc; display: flex; align-items: center; gap: 12px; padding: 13px; cursor: pointer; transition: .2s ease; }
.upload-box:hover { border-color: var(--gold); background: #fffdf9; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-box strong, .upload-box small { display: block; }
.upload-box strong { font-size: 12px; margin-bottom: 4px; }
.upload-box small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.upload-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--gold); background: rgba(224,214,200,.30); }
.upload-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.asset-thumb { border-radius: 10px; overflow: hidden; display: grid; place-items: center; padding: 12px; }
.asset-thumb--dark {
  background: var(--navy-900);
  border: 1px solid var(--navy-900);
}
.asset-thumb img { max-width: 100%; max-height: 48px; display: block; object-fit: contain; }
.photo-thumb { margin-top: 12px; aspect-ratio: 21 / 22; max-height: 250px; background: #fff; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.upload-status { min-height: 17px; margin-top: 7px; font-size: 10px; line-height: 1.45; color: var(--muted); }
.upload-status.is-success { color: var(--success); }
.upload-status.is-warning { color: var(--warning); }
.upload-status.is-error { color: var(--danger); }
.switch-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 34px; height: 19px; border-radius: 999px; background: #b8c0ca; padding: 2px; transition: .2s ease; }
.switch::before { content: ""; display: block; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch-label input:checked + .switch { background: var(--gold); }
.switch-label input:checked + .switch::before { transform: translateX(15px); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 24px; }

.button { min-height: 44px; border-radius: 8px; border: 1px solid transparent; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button--primary { color: #fff; background: var(--navy-900); box-shadow: 0 9px 20px rgba(16,28,45,.18); }
.button--primary:hover { background: var(--navy-700); }
.button--secondary { color: var(--navy-900); background: #fff; border-color: #cfd5dd; }
.button--secondary:hover, .button--ghost:hover { border-color: var(--gold); color: #926d38; }
.button--ghost { color: var(--muted); background: transparent; border-color: var(--line); }

.email-stage { background: #e8edf2; padding: clamp(18px, 3vw, 38px); border-radius: 13px; overflow-x: auto; }
.email-window { min-width: 820px; max-width: 900px; margin: 0 auto; background: #fff; box-shadow: 0 18px 40px rgba(16,28,45,.15); border-radius: 10px; overflow: hidden; }
.email-toolbar { height: 47px; display: flex; align-items: center; gap: 7px; padding: 0 16px; color: #788395; font-size: 11px; background: #f7f8fa; border-bottom: 1px solid #e5e8ec; }
.email-toolbar > span { width: 9px; height: 9px; border-radius: 50%; background: #c8ced6; }
.email-toolbar > div { margin-left: 8px; font-weight: 700; }
.email-meta { padding: 12px 22px 9px; border-bottom: 1px solid #e8ebef; font-family: "Poppins", Arial, sans-serif; font-size: 12px; color: #3b4555; }
.email-meta div { padding: 5px 0; }
.email-meta span { display: inline-block; width: 64px; color: #8b94a1; }
.email-body { min-height: 455px; padding: 27px 35px 38px; color: #3a4350; font-family: "Poppins", Arial, sans-serif; font-size: 13px; line-height: 1.55; }
.email-body > p { margin: 0 0 15px; }
.signature-preview { margin-top: 22px; width: 733px; max-width: 733px; padding: 3px 10px 14px 3px; border: 0; outline: 0; background: transparent; }
.primary-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.action-message { min-height: 20px; margin-top: 9px; color: var(--success); font-size: 11px; font-weight: 700; }
.action-message.is-error { color: var(--danger); }

.panel--code { overflow: hidden; }
.code-tabs { display: flex; gap: 4px; padding: 14px 16px 0; border-bottom: 1px solid var(--line); background: #fafbfc; }
.code-tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 11px 15px 12px; font-size: 11px; font-weight: 800; }
.code-tab.is-active { color: var(--navy-900); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.code-header { min-height: 42px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; color: #c4cedb; background: #152236; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.code-output { width: 100%; min-height: 275px; resize: vertical; border: 0; outline: 0; color: #dce6f2; background: #0d1727; padding: 18px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.65; white-space: pre; overflow: auto; }
.instructions { padding: 28px; }
.instructions h4 { margin: 0 0 18px; font-size: 18px; }
.instructions ol { margin: 0; padding-left: 21px; color: var(--muted); }
.instructions li { padding: 0 0 12px 4px; line-height: 1.55; }
.instructions strong { color: var(--ink); }
.notice { margin-top: 12px; padding: 14px 16px; color: #725528; background: #fff9ef; border-left: 3px solid var(--gold); font-size: 11px; line-height: 1.55; }

.app-footer { width: min(1480px, calc(100% - 48px)); margin: 0 auto; min-height: 70px; border-top: 1px solid #d9dee5; display: flex; align-items: center; justify-content: space-between; gap: 25px; color: #788293; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.app-footer a { text-decoration: none; color: var(--navy-900); }
.footer-credit { margin-left: auto; color: var(--navy-900); }
.footer-credit strong { font-weight: 800; letter-spacing: .06em; }

@media (max-width: 1160px) {
  .app-grid { grid-template-columns: 1fr; }
  .panel--form { position: static; }
  .intro { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 760px) {
  .app-header__inner { width: min(100% - 30px, 1480px); min-height: 120px; grid-template-columns: 130px 1fr; gap: 18px; }
  .brand img { width: 128px; }
  .header-copy { padding-left: 18px; }
  .header-copy h1 { font-size: 19px; }
  .header-status { display: none; }
  .page-shell { width: min(100% - 24px, 1480px); padding-top: 30px; }
  .intro h2 { font-size: 34px; }
  .panel--form, .panel--preview { padding: 20px; }
  .field-grid--2 { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1; }
  .panel-heading--row { align-items: flex-start; }
  .compatibility-badge { display: none; }
  .primary-actions .button { width: 100%; }
  .app-footer { width: min(100% - 24px, 1480px); padding: 18px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-credit { margin-left: 0; }
}
@media (max-width: 500px) {
  .app-header__inner { grid-template-columns: 1fr; gap: 0; padding: 19px 0; }
  .header-copy { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); padding: 12px 0 0; margin-top: 13px; }
  .upload-row { grid-template-columns: 1fr; }
  .asset-thumb { min-height: 76px; }
  .upload-row--photo { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; }
}
