:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --accent: #38bdf8;
  --accent-dark: #0284c7;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --border: rgba(148, 163, 184, 0.25);
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.55);

  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(circle at bottom, rgba(2, 132, 199, 0.3), transparent 60%),
    var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 20px 20px;
}

.app-shell {
  width: min(100%, 960px);
}

.panel {
  background-color: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
  display: grid;
  gap: 32px;
  width: 100%;
}

.panel__header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 600;
}

.panel__subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stepper {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  padding-bottom: 8px;
  overflow: hidden;
}

.stepper__item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 70px;
  padding: clamp(8px, 2vw, 12px);
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.4);
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.stepper__item span {
  display: inline-flex;
  width: clamp(24px, 3vw, 32px);
  height: clamp(24px, 3vw, 32px);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background-color: rgba(148, 163, 184, 0.2);
  margin-bottom: 6px;
  font-weight: 600;
}

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

.stepper__item--active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

.stepper__item--active span {
  background-color: var(--accent);
  color: var(--bg);
}

.stepper__item--active p {
  color: var(--text);
}

.stepper__item--complete {
  border-color: var(--accent-dark);
  background: rgba(2, 132, 199, 0.15);
}

.steps {
  display: grid;
  margin-top: 3rem;
}

.process-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.plan-summary {
  text-align: center;
  margin-bottom: 16px;
}

.plan-summary__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.plan-summary__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.process-toggle__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.process-toggle__option input {
  accent-color: var(--accent);
}

.process-toggle__option span {
  font-weight: 600;
}

.process-toggle__option:hover,
.process-toggle__option input:focus-visible + span,
.process-toggle__option input:checked + span {
  border-color: var(--accent);
  color: var(--text);
}

.process-toggle__option:is([disabled], .is-disabled) {
  cursor: default;
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.35);
}

.process-toggle__option:is([disabled], .is-disabled):hover,
.process-toggle__option.is-disabled input:focus-visible + span {
  border-color: var(--border);
  color: var(--muted);
}

.step {
  display: none;
  animation: fade-in 0.4s ease;
}

.step--active {
  display: grid;
  gap: 24px;
}

.step h2 {
  margin: 0;
  font-size: 1.4rem;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label,
.form-field legend {
  font-weight: 500;
}

.form-field input[type="password"],
.form-field input[type="text"],
.form-field select,
.form-field textarea {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-field input[type="password"]:focus,
.form-field input[type="text"]:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-with-toggle {
  position: relative;
  display: block;
  width: 100%;
}

.input-with-toggle input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 48px;
}

.input-with-toggle .input-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.input-with-toggle .input-toggle:hover {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

.input-with-toggle .input-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
}

.input-with-toggle .input-toggle__icon--hide[hidden],
.input-with-toggle .input-toggle__icon--show[hidden] {
  display: none !important;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.button {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

.button--primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.button--secondary {
  background-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.button--ghost {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.plans {
  display: grid;
  gap: 12px;
}

.plan-card {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
  align-items: center;
}

.plan-card:hover {
  border-color: var(--accent);
}

.plan-card input {
  accent-color: var(--accent);
  width: 1.2rem;
  height: 1.2rem;
}

.plan-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.plan-card__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.hint--danger {
  color: var(--danger);
}

.status-log {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.log {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.log--muted {
  color: var(--muted);
}

.log--success {
  color: var(--success);
}

.log--warning {
  color: var(--warning);
}

.log--danger {
  color: var(--danger);
}

.loader {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.loader__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent);
  animation: bounce 0.6s infinite alternate;
}

.loader__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader__dot:nth-child(3) {
  animation-delay: 0.4s;
}

.results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  overflow-x: auto;
}

.results__header,
.results__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 0.8fr;
  gap: 12px;
  padding: 14px 18px;
}

.results__header {
  background: rgba(56, 189, 248, 0.12);
  font-weight: 600;
}

.results__body {
  display: grid;
  gap: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.results__row {
  background: rgba(15, 23, 42, 0.7);
}

.results__status[data-state="success"] {
  color: var(--success);
}

.results__status[data-state="danger"] {
  color: var(--danger);
}

.results__status[data-state="warning"] {
  color: var(--warning);
}

.results__empty {
  padding: 18px;
}

.muted {
  color: var(--muted);
}

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

@keyframes bounce {
  to {
    transform: translateY(-6px);
  }
}

@media (max-width: 760px) {
  body {
    padding: 32px 16px 16px;
  }

  .panel {
    gap: 28px;
  }

  .plan-summary__title {
    font-size: 1.1rem;
  }

  .plan-summary__meta {
    font-size: 0.8rem;
  }

  .steps {
    margin-top: 2rem;
  }

  .step {
    gap: 16px;
  }

  .process-toggle {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }

  .stepper__item {
    min-width: 70px;
    padding: 5px;
  }

  .stepper__item span {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .stepper {
    flex-wrap: wrap;
    justify-content: center;
  }


  .form-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 24px 12px 12px;
  }

  .panel {
    padding: 20px;
    gap: 24px;
  }

  .process-toggle {
    margin-bottom: 16px;
  }

  .plan-summary__title {
    font-size: 1rem;
  }

  .plan-summary__meta {
    font-size: 0.75rem;
  }

  .steps {
    margin-top: 2rem;
  }

  .step {
    gap: 15px;
  }

  .stepper__item {
    min-width: 60px;
    padding: 4px;
  }

  .stepper__item span {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .stepper {
    flex-wrap: wrap;
    justify-content: center;
  }

  .results__header,
  .results__row {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .results__row {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 12px 14px;
  }

  .results__row span {
    font-size: 0.9rem;
  }

  .results__status {
    font-weight: 600;
  }
}

@media (max-width: 460px) {
  body {
    padding: 20px 10px 10px;
  }

  .panel {
    padding: 18px;
  }

  .process-toggle__option {
    flex: 1 1 100%;
    justify-content: center;
  }

  .plan-summary__title {
    font-size: 0.95rem;
  }

  .plan-summary__meta {
    font-size: 0.72rem;
  }

  .button {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

