@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Playfair+Display:wght@500;600&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --brand: #ee0b00;
  --brand-dark: #a90800;
  --canvas: #f9f9fb;
  --surface: #ffffff;
  --ink: #020019;
  --muted: #75758d;
  --border: #e8e8ef;
  --paper: #f4f1e8;
  --paper-ink: #292a29;
  --danger: #d9264d;
  --radius-control: 4px;
  --radius-button: 8px;
  --radius-card: 8px;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button, input, textarea { font: inherit; }

.site-header {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  width: min(1160px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 25px;
}

.form-heading span, .paper-label {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.intro { max-width: 600px; margin-bottom: 28px; }
.intro h1, .preview-heading h2, .form-heading h2 { margin: 0; }
.intro h1 { font-size: 34px; font-weight: 700; line-height: 1.12; }

.studio {
  display: grid;
  grid-template-columns: minmax(300px, 408px) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.form-panel, .preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.form-panel { padding: 24px; }
.form-heading, .preview-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.form-heading { margin-bottom: 22px; }
.form-heading h2, .preview-heading h2 { font-size: 18px; line-height: 1.2; }
.form-heading span { color: var(--muted); }

.form-panel > label { display: grid; gap: 6px; margin-top: 15px; }
.form-panel > label > span, legend { font-size: 14px; font-weight: 600; }
input, textarea {
  width: 100%;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #d8d8e2;
  border-radius: var(--radius-control);
  color: var(--ink);
  outline: none;
  transition: border-color 150ms ease;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--brand); }

fieldset { margin: 23px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; }
.template-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template-option { position: relative; display: flex; min-height: 35px; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-control); color: #3d3d4c; cursor: pointer; font-family: "DM Mono", monospace; font-size: 11px; }
.template-option:has(input:checked) { border-color: var(--brand); background: rgb(238 11 0 / 5%); color: var(--brand-dark); }
.template-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); }

.submit-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  margin-top: 22px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-button);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.submit-button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.submit-button:active { transform: translateY(1px); }
.submit-button:focus-visible { outline: 3px solid rgb(238 11 0 / 25%); outline-offset: 2px; }
.form-error { margin: 12px 0 0; color: var(--danger); font-size: 14px; }

.preview-panel { display: flex; min-height: 588px; padding: 24px; flex-direction: column; }
.paper-label { padding: 4px 7px; background: #f4f4f7; border-radius: 3px; color: var(--muted); }
.card-stage { display: grid; min-height: 0; margin: 25px 0 18px; flex: 1; place-items: center; }

.business-card {
  position: relative;
  width: min(100%, 590px);
  min-height: 325px;
  overflow: hidden;
  background:
    radial-gradient(rgb(69 65 55 / 9%) 0.55px, transparent 0.7px) 0 0 / 5px 5px,
    var(--paper);
  border: 1px solid #d9d4c8;
  box-shadow: 0 14px 30px rgb(29 29 23 / 12%);
  color: var(--paper-ink);
  animation: card-in 280ms ease-out;
}
.card-rule { height: 5px; background: #242522; }
.card-body { display: flex; min-height: 320px; padding: 39px 42px 31px; flex-direction: column; text-align: center; }
.card-name { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 27px; font-weight: 600; letter-spacing: 0; line-height: 1.2; text-transform: uppercase; }
.card-position, .card-company { margin: 8px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 15px; line-height: 1.25; }
.card-company { margin-top: 3px; }
.card-spacer { flex: 1; }
.card-contacts { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; }
.card-signature { min-height: 20px; margin: 31px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 15px; line-height: 1.3; }
.quiet-line { margin: 10px 0 0; color: #aaaab8; font-family: "Playfair Display", Georgia, serif; font-size: 14px; font-style: italic; text-align: right; }

@keyframes card-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .site-header { height: 52px; }
  .page-shell { width: min(100% - 24px, 1160px); padding: 32px 0 42px; }
  .intro h1 { font-size: 28px; }
  .studio { grid-template-columns: 1fr; }
  .preview-panel { min-height: 470px; padding: 16px; }
  .form-panel { padding: 18px; }
  .business-card { min-height: 275px; }
  .card-body { min-height: 270px; padding: 31px 22px 23px; }
  .card-name { font-size: 23px; }
  .card-contacts { flex-direction: column; gap: 2px; }
  .card-signature { margin-top: 20px; }
}

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