:root {
  --ink: #151719;
  --muted: #667085;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #e7e2d8;
  --tomato: #d92832;
  --tomato-dark: #aa1625;
  --basil: #16835f;
  --gold: #d89b2b;
  --blue: #2f6fc9;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(28, 22, 15, .13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(217, 40, 50, .10), transparent 34%),
    linear-gradient(225deg, rgba(22, 131, 95, .10), transparent 32%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.install-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 36px;
}

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

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--tomato), var(--gold));
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(217, 40, 50, .24);
}

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

.brand strong {
  font-size: 18px;
}

.brand small,
.header-status {
  color: var(--muted);
  font-size: 13px;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .68);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--basil);
  box-shadow: 0 0 0 5px rgba(22, 131, 95, .12);
}

.wizard {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.steps-panel,
.wizard-card,
.locked-panel {
  border: 1px solid rgba(120, 105, 86, .24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.steps-panel {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.progress-orbit {
  display: grid;
  place-items: center;
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 22px;
}

.progress-orbit svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.progress-bg,
.progress-line {
  fill: none;
  stroke-width: 9;
}

.progress-bg {
  stroke: #eee6da;
}

.progress-line {
  stroke: var(--tomato);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .35s ease;
}

.progress-orbit strong,
.progress-orbit span {
  display: block;
  text-align: center;
}

.progress-orbit strong {
  font-size: 28px;
}

.progress-orbit span {
  color: var(--muted);
  font-size: 12px;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px;
  color: var(--muted);
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.step-tab span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
  font-size: 13px;
}

.step-tab.is-active,
.step-tab.is-done {
  color: var(--ink);
  border-color: rgba(217, 40, 50, .18);
  background: rgba(217, 40, 50, .08);
}

.step-tab.is-done span {
  color: #fff;
  border-color: var(--basil);
  background: var(--basil);
}

.step-tab.is-active span {
  color: #fff;
  border-color: var(--tomato);
  background: var(--tomato);
}

.step-tab:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.wizard-card {
  position: relative;
  min-height: 690px;
  overflow: hidden;
}

.card-accent {
  height: 7px;
  background: linear-gradient(90deg, var(--tomato), var(--gold), var(--basil), var(--blue));
}

.step-screen {
  display: none;
  padding: 30px;
  animation: liftIn .35s ease both;
}

.step-screen.is-active {
  display: block;
}

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

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.screen-kicker {
  margin: 0 0 6px;
  color: var(--tomato);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1.08;
}

h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.summary-strip,
.global-message,
.finish-box,
.import-console {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--muted);
}

.summary-strip strong {
  color: var(--ink);
}

.loader-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tomato);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: .4;
    transform: scale(.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

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

.check-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.check-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.check-item.success .check-icon {
  color: #fff;
  background: var(--basil);
}

.check-item.warning .check-icon {
  color: #3f2700;
  background: #ffd888;
}

.check-item.error .check-icon {
  color: #fff;
  background: var(--danger);
}

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

.check-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.check-item small {
  margin-top: 8px;
  color: #806b4e;
  line-height: 1.35;
}

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

.form-grid.compact {
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #34302b;
  font-weight: 700;
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid #d8d0c3;
  border-radius: var(--radius);
  background: #fff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
select:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(217, 40, 50, .12);
}

label small {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

.span-all {
  grid-column: 1 / -1;
}

.fieldset {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.switch {
  display: inline-flex;
  width: 54px;
  height: 30px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #d8d0c3;
  transition: background .2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .2s ease;
}

.switch input:checked + span {
  background: var(--basil);
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: var(--radius);
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  color: #fff;
  border: 1px solid var(--tomato-dark);
  background: linear-gradient(135deg, var(--tomato), var(--tomato-dark));
  box-shadow: 0 12px 24px rgba(217, 40, 50, .20);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

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

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

.import-console {
  padding: 22px;
}

.import-meter {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee6da;
}

.import-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tomato), var(--gold), var(--basil));
  transition: width .25s ease;
}

.import-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.import-meta strong {
  font-size: 30px;
}

.import-meta span {
  color: var(--muted);
}

.error-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--danger);
}

.global-message {
  display: grid;
  gap: 4px;
  margin: 22px 30px 0;
  padding: 13px 15px;
  color: #4a3320;
  background: #fff7e6;
}

.global-message.error {
  color: var(--danger);
  background: #fff1f0;
  border-color: #ffccc7;
}

.global-message.success {
  color: #05603a;
  background: #ecfdf3;
  border-color: #abefc6;
}

.finish-box,
.locked-panel {
  padding: 32px;
  text-align: center;
}

.locked-panel {
  max-width: 760px;
  margin: 72px auto 0;
}

.success-ring {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin: 0 auto 18px;
  color: #fff;
  border-radius: 50%;
  background: var(--basil);
  font-size: 36px;
  font-weight: 900;
}

.finish-box p,
.locked-panel p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.link-grid a {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  background: var(--ink);
  font-weight: 850;
}

.busy-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 16px;
  z-index: 20;
  background: rgba(251, 250, 247, .72);
  backdrop-filter: blur(12px);
}

.spinner {
  width: 58px;
  height: 58px;
  border: 5px solid rgba(217, 40, 50, .16);
  border-top-color: var(--tomato);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

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

  .steps-panel {
    position: static;
  }

  .progress-orbit {
    width: 118px;
    height: 118px;
  }

  .step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checks-grid,
  .form-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .install-shell {
    width: min(100vw - 18px, 1180px);
    padding-top: 12px;
  }

  .install-header,
  .screen-head,
  .action-row,
  .import-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .step-screen {
    padding: 20px;
  }

  .global-message {
    margin: 18px 20px 0;
  }

  .step-list {
    grid-template-columns: 1fr;
  }
}

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