:root {
  --accent: #ff6b35;
  --accent-dark: #e25522;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #1a1a1a;
  --muted: #6b7280;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

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

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.submitter {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.submitter:empty {
  display: none;
}

.brand-mark {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.brand h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s ease;
}

.status-dot.ok {
  background: var(--success);
}

.status-dot.error {
  background: var(--danger);
}

/* Main */
.app-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Stepper */
.stepper ol {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.step.active {
  opacity: 1;
  border-color: var(--accent);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.step.active .step-num {
  background: var(--accent);
  color: #fff;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  margin: 0 0 20px;
}

.placeholder-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

/* Form fields */
.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.control {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.control:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

select.control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

#partner-other {
  margin-top: 10px;
}

.field-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1em;
}

/* Inline status / messages */
.inline-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.inline-success {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 10px;
}

.inline-error {
  font-size: 0.9rem;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Actions */
.actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  background: #d4d4d8;
  color: #fff;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg);
}

.actions-split {
  justify-content: space-between;
}

/* Toggle group (Yes/No) */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.toggle-btn {
  background: var(--surface);
  border: none;
  padding: 9px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.toggle-btn + .toggle-btn {
  border-left: 1px solid var(--border);
}

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

textarea.control {
  resize: vertical;
  min-height: 64px;
}

/* Review sections */
.review-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 4px;
  margin: 0 0 22px;
}

.review-section legend {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 0 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Slack preview */
.slack-preview {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #4a154b;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.slack-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #4a154b;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slack-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.slack-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.slack-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.slack-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* Step 4 · Processing results */
.processing-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.result-banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.result-banner.success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #15803d;
}

.result-banner.warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #a16207;
}

.result-summary {
  font-weight: 600;
  margin: 0 0 16px;
}

.result-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.result-item .result-icon {
  font-size: 1.1rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.result-item .result-label {
  font-weight: 600;
}

.result-item .result-error {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 2px;
  word-break: break-word;
}

.result-item .result-note {
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin-top: 4px;
  word-break: break-word;
}

.result-item.ok {
  border-color: rgba(22, 163, 74, 0.3);
}

.result-item.fail {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.03);
}

/* Email prompt modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.55);
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 28px;
}

.modal h2 {
  margin: 0 0 8px;
}

.modal .muted {
  margin: 0 0 18px;
}

.modal .actions {
  margin-top: 8px;
}

.submitter-change {
  margin-left: 8px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
