:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #ecfeff;
  --text: #12343b;
  --muted: #5c7378;
  --border: #cbdfe2;
  --primary: #0f766e;
  --primary-strong: #0b5d55;
  --accent: #0891b2;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(15, 118, 110, 0.14);
  --radius: 8px;
  font-family: Figtree, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(236, 254, 255, 0.96), rgba(248, 250, 252, 0.8) 42%),
    var(--bg);
}

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

button,
label,
select,
input[type="date"],
input[type="time"],
input[type="file"],
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(8, 145, 178, 0.32);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 0 calc(32px + env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  padding: 28px 0 18px;
}

.product-name,
.section-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  color: #0b3f46;
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.hero-lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.status-panel,
.install-strip,
.form-card,
.summary-card {
  border: 1px solid rgba(203, 223, 226, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.status-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.status-item {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.status-dot.is-good {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}

.status-dot.is-warn {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.install-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 22px;
  padding: 18px;
}

.install-strip p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.install-checks {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  list-style: none;
}

.install-checks li {
  position: relative;
  padding-left: 20px;
}

.install-checks li::before {
  position: absolute;
  left: 0;
  content: "!";
  color: var(--warning);
  font-weight: 900;
}

.install-checks li.is-ok::before {
  content: "✓";
  color: var(--success);
}

.install-checks li.is-blocked::before {
  content: "×";
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.form-card,
.summary-card {
  padding: 22px;
}

.summary-card {
  position: sticky;
  top: 18px;
}

.form-heading,
.summary-header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.draft-state {
  min-width: max-content;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label,
legend {
  color: #214950;
  font-weight: 750;
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
}

textarea {
  min-height: 124px;
  resize: vertical;
  line-height: 1.55;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
}

input[type="file"] {
  padding-top: 11px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.segmented-control input:checked + span {
  border-color: var(--primary);
  background: var(--panel-soft);
  color: var(--primary-strong);
}

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

.checkbox-grid label,
.consent-line {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  color: var(--text);
  font-weight: 650;
}

.checkbox-grid input,
.consent-line input {
  width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  accent-color: var(--primary);
}

.consent-line {
  margin: 6px 0 6px;
}

.field-note,
.field-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-error {
  min-height: 1.25em;
  color: var(--danger);
}

.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  margin: 24px -22px -22px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  padding: 16px 22px calc(16px + env(safe-area-inset-bottom));
  backdrop-filter: blur(14px);
}

.primary-action,
.secondary-action,
.ghost-action {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 850;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-action {
  flex: 1;
  background: var(--primary);
  color: #fff;
}

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

.secondary-action:disabled {
  cursor: not-allowed;
  border-color: var(--border);
  background: #e2e8f0;
  color: #64748b;
}

.ghost-action {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-strong);
}

.primary-action:hover,
.secondary-action:not(:disabled):hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.primary-action:active,
.secondary-action:not(:disabled):active,
.ghost-action:active {
  transform: translateY(0);
}

#summary-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

#summary-list div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

#summary-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

#summary-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.success-box {
  margin-top: 18px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  background: #ecfdf5;
  padding: 14px;
  color: #065f46;
}

.success-box p {
  margin: 6px 0 0;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
    padding-top: 16px;
  }

  .install-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-action {
    width: 100%;
  }

  .summary-card {
    position: static;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(2.2rem, 13vw, 3.65rem);
  }

  .form-card,
  .summary-card {
    padding: 18px;
  }

  .form-heading {
    flex-direction: column;
    gap: 12px;
  }

  .field-row,
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .segmented-control {
    gap: 6px;
  }

  .form-actions {
    margin: 22px -18px -18px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  }

  .ghost-action {
    flex: 0 0 112px;
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
