:root {
  --navy: #032b53;
  --navy-deep: #011c39;
  --blue: #075f97;
  --ice: #d5e8f6;
  --ink: #10243b;
  --muted: #64748b;
  --line: #d9e2ec;
  --panel: #f4f7fa;
  --white: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(130, 183, 220, .28), transparent 30rem),
    #edf2f6;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 3vw, 44px);
  color: #fff;
  background: linear-gradient(110deg, #011d3a, #063865 65%, #075f97);
  box-shadow: 0 4px 20px rgba(1, 28, 57, .22);
}

.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__brand strong { display: block; font-family: Georgia, serif; font-size: 22px; letter-spacing: .01em; }
.topbar__brand span { display: block; color: #cfe4f4; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.mini-mark { width: 42px; height: 42px; display: grid; place-items: center; border-right: 1px solid rgba(255,255,255,.6); padding-right: 10px; }
.mini-mark svg { width: 100%; fill: #fff; }

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255,255,255,.1);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.privacy-chip svg { width: 17px; fill: #fff; }

.workspace {
  width: min(1820px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 2.4vw, 38px) 48px;
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.editor {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  scrollbar-width: thin;
  padding-right: 5px;
}

.editor__intro { margin: 0 0 18px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.editor__intro h1 { margin: 0; color: var(--navy-deep); font-size: clamp(28px, 2.1vw, 38px); line-height: 1.05; letter-spacing: -.035em; }
.editor__intro > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.form-card {
  margin: 0 0 14px;
  padding: 20px;
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(15, 42, 66, .07);
}

.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.section-title span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 13px; font-weight: 800; }
.section-title h2 { margin: 0; color: var(--navy); font-size: 17px; }

label { display: block; margin: 13px 0 6px; color: #34465a; font-size: 12px; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd7e2;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--navy-deep);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,95,151,.12); }
input:disabled { background: #edf2f6; color: #8a9baa; }

.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; top: 50%; left: 12px; width: 18px; transform: translateY(-50%); fill: var(--blue); pointer-events: none; }
.input-wrap input { padding-left: 40px; }
.input-wrap .icon-button + input { padding-right: 40px; }
.icon-button { position: absolute; z-index: 2; right: 5px; top: 50%; width: 36px; height: 36px; transform: translateY(-50%); border: 0; border-radius: 8px; background: transparent; color: #5d7185; }
.icon-button:hover { background: #eef4f8; }
.icon-button svg { width: 19px; fill: currentColor; }

.field-row { display: grid; grid-template-columns: 1fr 130px; gap: 14px; align-items: end; }
.switch-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-bottom: 8px; }
.switch-row > span:first-child { white-space: nowrap; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 42px; height: 24px; display: block; position: relative; border-radius: 999px; background: #c8d4df; transition: .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch-row input:checked + .switch { background: var(--blue); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid rgba(7,95,151,.25); }

.privacy-note {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #bcd9ec;
  border-radius: 14px;
  background: #eaf6fd;
  color: #174464;
}
.privacy-note svg { width: 26px; min-width: 26px; fill: var(--blue); }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { font-size: 13px; margin-bottom: 3px; }
.privacy-note span { font-size: 11px; line-height: 1.45; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--navy); border-radius: 11px; padding: 11px; font-size: 13px; font-weight: 800; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .65; }
.button svg { width: 18px; fill: currentColor; }
.button--primary { color: #fff; background: linear-gradient(120deg, var(--navy), var(--blue)); box-shadow: 0 8px 18px rgba(3,43,83,.18); }
.button--secondary { color: var(--navy); background: #fff; }

.preview-area { min-width: 0; }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 12px; color: #5a6d80; font-size: 13px; }
.preview-head div { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.live-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #1fa36a; box-shadow: 0 0 0 4px rgba(31,163,106,.13); }
.poster-stage { overflow: hidden; border-radius: 14px; box-shadow: 0 18px 50px rgba(15,42,66,.16); background: #d9e0e7; }

.poster {
  --poster-scale: 1;
  position: relative;
  width: 1120px;
  height: 792px;
  overflow: hidden;
  transform-origin: top left;
  color: var(--navy);
  background:
    radial-gradient(circle at 45% 30%, #fff 0, #fff 54%, #f8fbfd 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.poster-stage { aspect-ratio: 1120 / 792; }
.poster { transform: scale(calc((100vw - 500px) / 1120)); }
.poster-border { position: absolute; z-index: 20; inset: 14px; border: 3px solid var(--navy); pointer-events: none; }
.corner-ribbons { position: absolute; z-index: 1; pointer-events: none; }
.corner-ribbons--top { top: 14px; left: 14px; width: 430px; height: 118px; }
.corner-ribbons--bottom { bottom: 14px; left: 14px; width: 1092px; height: 90px; }
.map-watermark { position: absolute; z-index: 0; right: 20px; top: 24px; width: 315px; opacity: .1; filter: grayscale(1) saturate(.4); }

.poster-brand { position: absolute; z-index: 3; top: 72px; left: 78px; right: 64px; height: 128px; display: flex; align-items: center; }
.brand-map { width: 96px; height: 96px; object-fit: contain; }
.brand-rule { width: 3px; height: 78px; margin: 0 22px 0 17px; background: var(--navy); }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 64px; line-height: .95; letter-spacing: -.035em; white-space: nowrap; text-shadow: 0 2px 2px rgba(3,43,83,.09); }
.brand-copy span { display: block; margin: 9px 0 0 4px; color: var(--blue); font-size: 13px; font-weight: 900; letter-spacing: .24em; }

.poster-content { position: absolute; z-index: 2; top: 225px; left: 64px; right: 64px; height: 355px; display: grid; grid-template-columns: minmax(0, 1.42fr) 35px minmax(305px, .9fr); align-items: center; gap: 18px; }
.credentials { display: grid; gap: 28px; }
.credential-row { height: 132px; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; overflow: hidden; border: 4px solid var(--navy); border-radius: 46px; background: linear-gradient(120deg, #fff, #f5f9fc); box-shadow: 0 6px 16px rgba(3,43,83,.07); }
.credential-icon { align-self: stretch; position: relative; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #063b6c, #011f3e); clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); }
.credential-icon::after { content: ""; position: absolute; right: 18px; top: -5px; width: 5px; height: 142px; background: #fff; transform: rotate(11deg); transform-origin: top; }
.credential-icon svg { width: 70px; margin-right: 20px; fill: currentColor; }
.credential-value { min-width: 0; padding: 6px 25px 0 10px; }
.credential-label { display: block; margin-bottom: 5px; color: #7890a5; font-size: 12px; font-weight: 900; letter-spacing: .18em; }
.credential-value strong { width: 100%; height: 64px; display: flex; align-items: center; overflow: hidden; color: var(--navy); font-size: 56px; line-height: 1.02; letter-spacing: -.03em; white-space: normal; overflow-wrap: anywhere; }

.middle-divider { position: relative; height: 300px; display: grid; place-items: center; }
.middle-divider::before { content: ""; width: 3px; height: 100%; background: var(--navy); }
.middle-divider span { position: absolute; width: 18px; height: 18px; transform: rotate(45deg); background: var(--navy); border: 4px solid #fff; }

.qr-panel { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-kicker { margin-bottom: 6px; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .17em; }
.qr-shell { position: relative; width: 290px; height: 290px; overflow: hidden; border: 4px solid var(--navy); border-radius: 34px; background: #fff; box-shadow: 0 8px 22px rgba(3,43,83,.11); }
.qr-shell canvas { display: block; width: 100%; height: 100%; }
.qr-center { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; display: grid; place-items: center; transform: translate(-50%, -50%); border: 4px solid var(--navy); border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px #fff; }
.qr-center svg { width: 40px; fill: var(--navy); }
.qr-panel small { margin-top: 7px; color: #6c8194; font-size: 10px; font-weight: 700; }

.contact-strip { position: absolute; z-index: 4; left: 42px; right: 42px; bottom: 82px; height: 126px; display: grid; grid-template-columns: 110px 3px minmax(0, 1fr) 3px minmax(260px, .92fr); align-items: center; padding: 0 30px; border: 6px solid #fff; outline: 3px solid #b8d8ee; border-radius: 63px; color: #fff; background: linear-gradient(110deg, #062d55, #003b69 68%, #01264a); box-shadow: 0 8px 16px rgba(3,43,83,.16); }
.person-icon { display: grid; place-items: center; }
.person-icon svg { width: 70px; fill: none; color: #fff; stroke: currentColor; stroke-width: 6; }
.person-icon circle { fill: none; }
.contact-divider { width: 3px; height: 82px; background: rgba(255,255,255,.8); }
.contact-copy { min-width: 0; padding: 0 32px; text-align: center; }
.contact-copy strong { display: block; width: 100%; max-height: 54px; overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 44px; line-height: 1.08; white-space: nowrap; }
.contact-copy span { display: block; width: min(100%, 330px); max-height: 31px; overflow: hidden; margin: 7px auto 0; border-radius: 999px; color: var(--navy); background: linear-gradient(#fff, #deedf7); font-size: 23px; line-height: 31px; font-weight: 850; white-space: nowrap; }
.phone-block { min-width: 0; display: flex; align-items: center; gap: 18px; padding-left: 28px; }
.phone-icon { width: 60px; height: 60px; min-width: 60px; display: grid; place-items: center; border-radius: 18px; background: #fff; }
.phone-icon svg { width: 36px; fill: var(--navy); }
.phone-block strong { display: block; width: 100%; max-height: 42px; overflow: hidden; font-size: 32px; line-height: 1.15; white-space: nowrap; }
.poster-privacy { position: absolute; z-index: 4; left: 0; right: 0; bottom: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #6b8295; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.poster-privacy span { width: 6px; height: 6px; border-radius: 50%; background: #2aa56b; }

.preview-tip { margin: 12px 3px 0; color: #64778a; font-size: 12px; }
.preview-tip strong { color: var(--navy); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: calc(100% - 32px); transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 999px; color: #fff; background: #102a43; box-shadow: 0 12px 30px rgba(0,0,0,.22); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; }
.toast--visible { opacity: 1; transform: translate(-50%, 0); }
.export-cover { position: fixed; z-index: 200; inset: 0; display: none; place-items: center; align-content: center; gap: 14px; color: #fff; background: rgba(1,28,57,.76); backdrop-filter: blur(5px); }
.export-cover--visible { display: grid; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

@media (min-width: 1480px) {
  .poster { transform: scale(calc((100vw - 530px) / 1120)); }
}

@media (min-width: 1820px) {
  .poster { transform: scale(1.18); }
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .editor { position: static; max-height: none; overflow: visible; }
  .poster { transform: scale(calc((100vw - 32px) / 1120)); }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .privacy-chip { max-width: 145px; white-space: normal; font-size: 11px; }
  .workspace { padding-top: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .switch-row { padding: 4px 0 2px; }
  .actions { grid-template-columns: 1fr; }
  .poster-stage { border-radius: 8px; }
}

@page { size: A4 landscape; margin: 0; }

@media print {
  html, body { width: 297mm; height: 210mm; margin: 0; background: #fff; }
  .topbar, .editor, .preview-head, .preview-tip, .toast, .export-cover { display: none !important; }
  .workspace, .preview-area, .poster-stage { width: 297mm; height: 210mm; margin: 0; padding: 0; display: block; overflow: hidden; border-radius: 0; box-shadow: none; background: #fff; }
  .poster { width: 1120px; height: 792px; transform: scale(.9993); transform-origin: top left; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
