:root {
  --ink: #043047;
  --muted: #706F6F;
  --paper: #ffffff;
  --background: #f4f7f8;
  --line: #d8e2e5;
  --accent: #043047;
  --accent-soft: #eaf2f4;
  --error: #b42318;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--background);
}

.app-shell {
  min-width: 1180px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  padding: 28px;
}

.preview-panel {
  min-width: 720px;
  position: sticky;
  top: 28px;
  align-self: start;
}

.brand-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

h1 { font-size: 30px; }
h2 { font-size: 22px; }

.template-switch {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.template-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.template-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.preview-frame-wrap {
  background: var(--paper);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(4, 48, 71, .08);
}

.preview-label {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.preview-frame {
  min-height: 560px;
  max-width: 676px;
  border: 2px dashed #9fb2ba;
  border-radius: 18px;
  padding: 28px;
  background: #fff;
  overflow: auto;
}

.form-panel {
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(4, 48, 71, .08);
}

.form-header { margin-bottom: 24px; }
.helper { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.field { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

label span { color: var(--error); }

input, select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: 14px "Poppins", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-left: 18px;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23043047' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 12px 8px;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 48, 71, .12);
}

.field small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .12);
}

.form-message {
  display: none;
  margin: 10px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.form-message.is-error { display: block; color: var(--error); background: #fef3f2; }
.form-message.is-success { display: block; color: #05603a; background: #ecfdf3; }

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

button {
  font: 700 14px "Poppins", Arial, Helvetica, sans-serif;
}

.primary-btn,
.secondary-btn,
.download-btn,
.copy-btn {
  height: 46px;
  border-radius: 12px;
  cursor: pointer;
}

/* Dark buttons */
.primary-btn,
.copy-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Light buttons */
.secondary-btn,
.download-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.primary-btn:hover,
.copy-btn:hover {
  opacity: .94;
}

.secondary-btn:hover,
.download-btn:hover {
  background: var(--accent-soft);
}

.export-row {
  padding-bottom: 12px;
}

.template-btn sup {
  font-size: 1em;
  line-height: 1;
  vertical-align: top;
  position: relative;
  top: -0.25px;
}

/* Keep the generated email signature isolated from the app UI as much as possible. */
.preview-frame table { font-family: Arial, Helvetica, sans-serif; }