@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --bg: #120a2e;
  --bg-alt: #1a0d3f;
  --surface: #1b0f42;
  --surface-strong: #231157;
  --form-gradient: linear-gradient(160deg, rgba(33, 18, 82, 0.96), rgba(24, 14, 54, 0.94));
  --accent: #c6a1ff;
  --accent-soft: rgba(198, 161, 255, 0.18);
  --text: #eef2ff;
  --muted: #9aa7d4;
  --danger: #ff6b6b;
  --shadow: 0 24px 60px rgba(8, 14, 41, 0.55);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(120, 92, 210, 0.28), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(98, 64, 170, 0.22), transparent 40%),
    var(--form-gradient);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(140, 110, 230, 0.2), transparent 45%),
    radial-gradient(circle at 85% 70%, rgba(90, 60, 170, 0.2), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1200px, 92vw);
  margin: 40px auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 80px);
}

.sidebar {
  width: 280px;
  padding: 32px 24px;
  background: linear-gradient(160deg, rgba(33, 18, 82, 0.96), rgba(24, 14, 54, 0.94));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.sidebar-brand {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.brand-logo {
  width: 96px;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.sidebar-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideIn 0.4s ease both;
  animation-delay: calc(var(--i) * 40ms);
}

.sidebar-step.active {
  background: rgba(198, 161, 255, 0.18);
  border-color: rgba(198, 161, 255, 0.35);
}

.sidebar-step.done {
  background: rgba(156, 120, 235, 0.2);
  border-color: rgba(156, 120, 235, 0.35);
}

.step-index {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: var(--text);
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-label {
  font-weight: 600;
  font-size: 14px;
}

.step-status {
  font-size: 12px;
  color: var(--muted);
}

.main {
  flex: 1;
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(720px, 100%);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(155, 120, 235, 0.9), rgba(90, 60, 170, 0.9));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.step-card {
  background: var(--form-gradient);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeUp 0.5s ease both;
  width: min(720px, 100%);
}

.step-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.step-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.step-header h1 {
  font-size: 26px;
  margin: 0;
  line-height: 1.25;
}

.step-description {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.field input,
.field select {
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(155, 120, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(155, 120, 235, 0.2);
}

.option-list {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

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

.option:hover {
  border-color: rgba(155, 120, 235, 0.5);
  background: rgba(155, 120, 235, 0.12);
}

.max-points,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--form-gradient);
  color: #f3ecff;
  border: 1px solid rgba(198, 161, 255, 0.45);
  box-shadow: 0 16px 30px rgba(24, 12, 50, 0.55);
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(50, 30, 110, 0.5), rgba(18, 12, 50, 0.75));
  color: #efe6ff;
  border: 1px solid rgba(198, 161, 255, 0.28);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(8, 14, 41, 0.4);
}

.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffdada;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.review-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.premise-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.premise-block {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.premise-score {
  font-weight: 600;
  color: var(--accent);
}

.premise-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.answer-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.answer-question {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.answer-choice {
  margin: 4px 0 0;
  font-weight: 600;
}

.answer-points {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.done-card {
  text-align: center;
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
    width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 28px;
    justify-content: center;
  }

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

  .form-actions form {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .sidebar {
    padding: 24px 20px;
  }

  .main {
    padding: 24px 20px;
  }

  .step-card {
    padding: 24px;
  }

  .step-header h1 {
    font-size: 22px;
  }
}
