:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-alt: #fbfaff;
  --text: #17151f;
  --muted: #6d6879;
  --line: #e8e4ef;
  --primary: #7842f1;
  --primary-2: #ab4af2;
  --primary-soft: #f0eaff;
  --success: #0d9f6e;
  --danger: #d6455d;
  --shadow: 0 24px 70px rgba(53, 35, 95, 0.12);
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(120, 66, 241, 0.12), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(171, 74, 242, 0.10), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  min-height: 100vh;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(120, 66, 241, 0.28);
}

.brand-mark svg {
  width: 31px;
  fill: currentColor;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(13, 159, 110, 0.12);
}

.main-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 60px;
}

.hero {
  max-width: 820px;
  margin: 70px auto 52px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.99;
  letter-spacing: -0.06em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(110deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.workspace {
  border: 1px solid rgba(229, 224, 239, 0.95);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.workspace-top {
  padding: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fdfcff);
}

.workspace-top h2 {
  margin: 7px 0 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.tab-list {
  padding: 5px;
  display: inline-flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f5fb;
}

.tab-button {
  min-height: 44px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: 180ms ease;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 20px rgba(42, 28, 77, 0.09);
}

.tab-icon {
  width: 19px;
  height: 19px;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-wrap {
  padding: 28px;
}

.tab-panel {
  animation: fadeIn 220ms ease;
}

.panel-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading > div {
  position: relative;
  padding-left: 56px;
}

.panel-number {
  position: absolute;
  left: 0;
  top: 1px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.panel-heading h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel-badge {
  padding: 8px 11px;
  border: 1px solid #e7ddff;
  border-radius: 999px;
  color: var(--primary);
  background: #faf7ff;
  font-size: 11px;
  font-weight: 700;
}

.lead-form {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-alt);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field {
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  margin-bottom: 8px;
  display: block;
  color: #373240;
  font-size: 12px;
  font-weight: 700;
}

.field label span {
  color: var(--primary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #ddd8e6;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field textarea {
  min-height: 110px;
  padding-top: 13px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #aaa4b5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(120, 66, 241, 0.10);
}

.field input.invalid,
.field select.invalid,
.field textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 69, 93, 0.09);
}

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

.options-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-card {
  min-height: 78px;
  padding: 15px;
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #ded9e8;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.check-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-ui {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid #c9c2d6;
  border-radius: 6px;
  background: #fff;
  position: relative;
  transition: 160ms ease;
}

.check-card input:checked + .check-ui {
  border-color: var(--primary);
  background: var(--primary);
}

.check-card input:checked + .check-ui::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card strong {
  color: var(--text);
  font-size: 12px;
}

.check-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.notice {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid #e5d9ff;
  border-radius: 12px;
  color: #5b3e9b;
  background: #f7f2ff;
  font-size: 12px;
  line-height: 1.5;
}

.form-footer {
  margin-top: 26px;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.submit-button {
  min-width: 170px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 25px rgba(120, 66, 241, 0.25);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 170ms ease, box-shadow 170ms ease, opacity 170ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(120, 66, 241, 0.31);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.submit-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-spinner {
  width: 17px;
  height: 17px;
  display: none;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.submit-button.loading .button-spinner {
  display: inline-block;
}

.submit-button.loading svg {
  display: none;
}

.response-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  animation: fadeIn 220ms ease;
}

.response-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.response-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.response-header strong,
.response-header p {
  display: block;
}

.response-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.response-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(13, 159, 110, 0.11);
}

.response-panel.error .response-icon {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(214, 69, 93, 0.10);
}

.response-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.secondary-button {
  height: 34px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
}

.icon-button {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

#response-output {
  max-height: 360px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #40374c;
  background: #fbfaff;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: 12px;
  color: #fff;
  background: #282330;
  box-shadow: 0 15px 40px rgba(0,0,0,.18);
  font-size: 12px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 200ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

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

@media (max-width: 840px) {
  .site-header,
  .main-content,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    margin-top: 40px;
  }

  .workspace-top,
  .panel-heading,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .tab-list {
    width: 100%;
  }

  .tab-button {
    flex: 1;
    justify-content: center;
  }

  .form-grid,
  .options-row {
    grid-template-columns: 1fr;
  }

  .form-footer .submit-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
  }

  .status-pill {
    display: none;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero p {
    font-size: 14px;
  }

  .workspace-top,
  .panel-wrap {
    padding: 20px;
  }

  .lead-form {
    padding: 18px;
  }

  .tab-list {
    flex-direction: column;
  }

  .panel-heading > div {
    padding-left: 0;
  }

  .panel-number {
    position: static;
    margin-bottom: 12px;
  }

  .panel-badge {
    align-self: flex-start;
  }

  .response-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
