:root {
  --bg: #f6f8fb;
  --fg: #10213a;
  --muted: #5b6b82;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #e8efff;
  --card: #ffffff;
  --border: #e3e9f2;
  --ok: #16a34a;
  --ok-soft: #ecfdf5;
  --error: #b91c1c;
  --error-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 33, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

.site-header {
  text-align: center;
  padding: 3.5rem 1.25rem 2rem;
}

.brand {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.site-header h1 {
  margin: 0 auto;
  max-width: 36rem;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.25;
}

.container {
  width: min(680px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.hidden {
  display: none !important;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
}

textarea, input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
}

textarea {
  min-height: 7rem;
}

input[type="text"] {
  min-height: 2.8rem;
}

textarea:focus, input[type="text"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  background: #93b4f3;
  cursor: wait;
}

.stage-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.stage-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-list li {
  padding: 0.45rem 0;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
}

.stage-list li:last-child {
  border-bottom: none;
}

.stage-list li.active {
  color: var(--fg);
  font-weight: 600;
}

.stage-list li.active::before {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  border: 2px solid var(--brand);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.05rem;
}

.stage-list li.done {
  color: var(--ok);
}

.stage-list li.done::before {
  content: "✓";
  font-weight: 700;
  margin-right: 0.6rem;
}

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

.card-error {
  background: var(--error-soft);
  border-color: #f5c6c6;
}

.card-error p {
  margin: 0;
  color: var(--error);
  font-weight: 600;
}

.card-error .error-hint {
  margin-top: 0.25rem;
  font-weight: 400;
  color: var(--muted);
}

.card-partial {
  background: var(--brand-soft);
  border-color: #c3d5f8;
}

.card-partial .partial-title {
  margin: 0 0 0.5rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
}

.card-partial .partial-label {
  margin: 0.9rem 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.card-partial .partial-understood-text {
  margin: 0;
  color: var(--fg);
  font-style: italic;
}

.card-partial .partial-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--fg);
}

.card-partial .partial-list li + li {
  margin-top: 0.25rem;
}

.card-partial .partial-hint {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.result-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.automation-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.partial-note {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #c3d5f8;
  border-radius: 10px;
}

.detail-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.detail-value {
  font-size: 0.95rem;
  color: var(--fg);
}

.lead-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.lead-subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.form-group input, .form-group textarea {
  min-height: auto;
}

.form-group textarea {
  min-height: 4rem;
}

.success-icon {
  text-align: center;
  font-size: 2rem;
  color: var(--ok);
  margin: 0 0 0.5rem;
}

.success-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.success-text {
  text-align: center;
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 480px) {
  .container {
    padding-bottom: 1rem;
  }
}
