:root {
  --bg-start: #eff6ff;
  --bg-mid: #f0f9ff;
  --bg-end: #e0e7ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.24);
  --white: rgba(255, 255, 255, 0.8);
  --dark: #0f172a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 32%),
    linear-gradient(135deg, var(--bg-start), var(--bg-mid) 48%, var(--bg-end));
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.58);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  display: block;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.brand__text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.locale-switch {
  display: inline-flex;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.locale-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.locale-btn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.tabs {
  display: flex;
  gap: 1.25rem;
}

.tab {
  border: none;
  background: transparent;
  padding: 0.25rem 0 0.4rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.glass-card {
  width: min(100%, 48rem);
  padding: 2rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  width: min(90%, 40rem);
  margin: 0 auto 2rem;
}

.stepper__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 1rem;
  height: 2px;
  background: rgba(148, 163, 184, 0.28);
  transform: translateY(-50%);
}

.step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 4.5rem;
}

.step__dot {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 800;
  transition: all 0.2s ease;
}

.step.is-active .step__dot,
.step.is-complete .step__dot {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 0.35rem rgba(59, 130, 246, 0.12);
}

.step__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.step.is-active .step__label,
.step.is-complete .step__label {
  color: var(--text);
}

.panel-view,
.wizard-step,
.final-panel {
  display: none;
}

.panel-view.is-visible,
.wizard-step.is-visible,
.final-panel.is-visible {
  display: block;
}

.form-stack {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field span,
.toggle-row span {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 1rem 1.1rem;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 9rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
}

.primary-btn,
.secondary-btn,
.dark-btn {
  border: none;
  border-radius: 1rem;
  padding: 0.95rem 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

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

.primary-btn:disabled,
.secondary-btn:disabled,
.dark-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.dark-btn {
  background: var(--dark);
  color: #fff;
}

.button-row {
  display: flex;
  gap: 0.75rem;
}

.button-row > * {
  flex: 1;
}

.hint-box,
.account-card,
.feedback,
.progress-panel,
.final-panel {
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.48);
}

.hint-box {
  padding: 1.1rem 1.15rem;
  margin-bottom: 1.15rem;
  background: rgba(14, 165, 233, 0.08);
}

.hint-box h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.hint-box ol {
  margin: 0;
  padding-left: 1.1rem;
  color: #075985;
  font-size: 0.85rem;
  line-height: 1.7;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--danger);
}

.toggle-row input {
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.account-card {
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.account-card__avatar {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 0 0 0.35rem rgba(255, 255, 255, 0.8);
}

.account-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}

.account-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.account-card__divider {
  height: 1px;
  margin: 1rem 0;
  background: rgba(148, 163, 184, 0.22);
}

.account-card__warning {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warning);
}

.progress-panel,
.final-panel {
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.progress-panel h3,
.final-panel h3 {
  margin: 1rem 0 0.45rem;
  font-size: 1.2rem;
}

.progress-panel p,
.final-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.spinner {
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  border-radius: 999px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.result-badge--success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
}

.result-badge--warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.14);
}

.result-badge--danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.result-grid {
  margin: 1.35rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.result-item {
  margin: 0;
  padding: 0.9rem;
  text-align: left;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.result-item dt {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.result-item dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  word-break: break-word;
}

.response-box {
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--dark);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.response-box__title {
  padding: 0.85rem 1rem;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  font-weight: 800;
}

.response-box pre,
.feedback__body {
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.response-box pre {
  min-height: 12rem;
  color: #dbeafe;
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.6;
}

.feedback {
  margin-top: 1.5rem;
  padding: 1rem;
}

.feedback h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.feedback__body {
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 640px) {
  .topbar,
  .button-row {
    flex-direction: column;
  }

  .topbar__actions {
    width: 100%;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
    justify-content: center;
  }

  .locale-switch {
    align-self: center;
  }

  .glass-card {
    padding: 1.35rem;
    border-radius: 1.5rem;
  }

  .step__label {
    font-size: 0.68rem;
  }
}
