:root {
  --accent: #00bf3f;
  --accent-dark: #009b35;
  --text: #171717;
  --muted: #686868;
  --border: #dedede;
  --surface: #ffffff;
  --background: #f3f5f3;
  --danger: #b42318;
  --radius: 16px;
  color-scheme: light;
  font-family: Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
input,
textarea {
  font: inherit;
}

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

.page-header {
  max-width: 760px;
  margin-bottom: 32px;
}

.header-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.environment-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.environment-status.is-connected {
  border-color: #9eeab7;
  color: #076326;
  background: #effff4;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(430px, 1.15fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 45px rgb(23 23 23 / 6%);
}

.panel-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.panel-heading h2 {
  margin-bottom: 5px;
  font-size: 21px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.step-number {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #062b12;
  background: #d9ffe5;
  font-size: 14px;
  font-weight: 700;
  place-items: center;
}

.field-group {
  margin-bottom: 20px;
}

.field-group label,
.html-panel label,
.contact-options legend {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  border: 1px solid #bdbdbd;
  border-radius: 9px;
  color: var(--text);
  background: #fff;
}

input[type="text"],
input[type="tel"] {
  min-height: 46px;
  padding: 10px 12px;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgb(0 191 63 / 24%);
  outline-offset: 2px;
  border-color: var(--accent-dark);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.contact-options {
  display: grid;
  gap: 10px;
  margin: 4px 0 22px;
  padding: 0;
  border: 0;
}

.radio-option {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: #f1fff5;
}

.radio-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent-dark);
}

.outlook-options {
  margin: 4px 0 22px;
  padding: 14px;
  border: 1px solid #9eeab7;
  border-radius: 10px;
  background: #f3fff6;
}

.checkbox-option {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
}

.checkbox-option input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent-dark);
}

.checkbox-option span,
.checkbox-option small {
  display: block;
}

.checkbox-option strong {
  font-size: 14px;
}

.checkbox-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.button-primary {
  color: #062b12;
  background: var(--accent);
}

.button-primary:hover {
  background: #05d64a;
}

.button-secondary,
.button-tertiary {
  border-color: var(--border);
  color: var(--text);
  background: #fff;
}

.button-secondary:hover,
.button-tertiary:hover {
  background: #f5f5f5;
}

.preview-canvas {
  min-height: 370px;
  padding: 32px;
  overflow-x: auto;
  border: 1px solid #e2e2e2;
  background-color: #fff;
  background-image: linear-gradient(45deg, #fafafa 25%, transparent 25%),
    linear-gradient(-45deg, #fafafa 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fafafa 75%),
    linear-gradient(-45deg, transparent 75%, #fafafa 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

#signature-preview {
  min-width: 360px;
  padding: 24px;
  background: #fff;
}

.logo-notice {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  color: #4f4f4f;
  background: #f7f8f7;
  font-size: 13px;
  line-height: 1.5;
}

.logo-notice code {
  font-size: 12px;
}

.html-panel {
  margin-top: 16px;
}

.html-panel textarea {
  display: block;
  min-height: 220px;
  margin-bottom: 10px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.status-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.status-message.is-error {
  color: var(--danger);
}

@media (max-width: 880px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: auto;
    margin: 0 10px;
    padding: 32px 0 48px;
  }

  .panel {
    padding: 20px;
    border-radius: 12px;
  }

  .preview-canvas {
    margin-inline: -8px;
    padding: 12px;
  }

  #signature-preview {
    width: 100%;
    min-width: 0;
    padding: 18px;
  }

  .form-actions .button {
    flex: 1 1 100%;
  }
}

body.outlook-addin .page-shell {
  width: auto;
  max-width: 1180px;
  margin: 0 8px;
  padding: 20px 0 32px;
}

body.outlook-addin .page-header {
  margin-bottom: 20px;
}

body.outlook-addin h1 {
  font-size: 30px;
}

body.outlook-addin .intro {
  font-size: 15px;
}

body.outlook-addin .logo-notice {
  display: none;
}
