:root {
  --teal: #7d9fa8;
  --teal-dark: #5f838d;
  --teal-tint: #eaf1f2;
  --text: #2b2f31;
  --text-muted: #7a7f82;
  --border: #d8dde0;
  --border-light: #e7eaec;
  --error: #c0554a;
  --max-width: 760px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.55;
}

/* Progress bar above the step navigation */
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-light);
  overflow: hidden;
  margin-top: 24px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 4px;
  transition: width 0.35s ease;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-logo-partner {
  height: 38px;
}

form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#stepContainer {
  flex: 1;
}

/* Step heading block */
.step-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.3;
}

.step-title em {
  font-style: italic;
}

.step-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 16px;
}

.step-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 28px;
  white-space: pre-line;
}

.step-intro-body {
  color: var(--text);
  font-size: 1rem;
  margin: 0 0 24px;
}

.step-intro-body p {
  margin: 0 0 14px;
}

/* Fields */
textarea.field-textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  background: #fff;
}

textarea.field-textarea:focus,
input.field-text:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(125, 159, 168, 0.18);
}

input.field-text {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

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

.conditional-field {
  margin-top: 20px;
}

/* Radio / choice options */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-option:hover {
  border-color: var(--teal);
}

.choice-option.selected {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.choice-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.choice-option label {
  cursor: pointer;
  flex: 1;
}

.choice-inline-input {
  margin-top: 8px;
  margin-left: 30px;
}

/* Consent checkbox on intro step */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
}

.consent-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.consent-row label {
  font-size: 0.92rem;
  color: var(--text);
}

.consent-row a {
  color: var(--teal-dark);
}

.field-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* Bottom navigation */
.step-nav {
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-percent {
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.btn {
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 26px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 4px;
}

.btn-text:hover {
  color: var(--teal-dark);
}

.btn-text:disabled {
  visibility: hidden;
}

/* Confirmation / send step */
.send-panel {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin-top: 8px;
}

.send-panel p {
  margin: 0 0 14px;
  color: var(--text);
}

.send-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

textarea.email-preview {
  width: 100%;
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: #fafbfb;
}

.copy-status {
  font-size: 0.85rem;
  color: var(--teal-dark);
  margin-left: 4px;
}

.privacy-note {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.privacy-note a {
  color: var(--teal-dark);
}

@media (max-width: 520px) {
  .page {
    padding: 32px 18px 24px;
  }
  .brand {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .brand-logo {
    height: 40px;
  }
  .brand-logo-partner {
    height: 30px;
  }
  .step-nav {
    flex-wrap: wrap;
    gap: 12px;
  }
  .send-actions {
    flex-direction: column;
  }
}
