* { box-sizing: border-box; }

:root {
  --bg: #f7f5fb;
  --card: #ffffff;
  --text: #27232d;
  --muted: #746e7d;
  --border: #e5deed;
  --accent: #7041d4;
  --accent-dark: #5930b2;
  --soft: #f0eafd;
  --success: #4e9b70;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }

.app-shell {
  width: min(100% - 28px, 520px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(229, 222, 237, .9);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 12px 40px rgba(39, 35, 45, .07);
}

.hidden { display: none !important; }

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

h1, h2 { margin: 0; line-height: 1.18; }
h1 { font-size: clamp(30px, 8vw, 42px); }
h2 { font-size: clamp(25px, 7vw, 34px); }

.intro, .muted {
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin: 28px 0 9px;
  font-weight: 750;
}

textarea {
  display: block;
  width: 100%;
  min-height: 145px;
  padding: 15px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: #fff;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(112, 65, 212, .1);
}

.character-count {
  text-align: right;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border-radius: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  transition: transform .12s ease, background .12s ease;
}

button:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: not-allowed; }

.primary {
  color: #fff;
  background: var(--accent);
}
.primary:hover { background: var(--accent-dark); }

.secondary {
  color: var(--accent);
  background: #fff;
  border-color: var(--border);
}

.link-button {
  width: auto;
  min-height: auto;
  padding: 5px 0;
  margin-top: 18px;
  color: var(--accent);
  background: transparent;
  font-size: 14px;
}

.full-task {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--soft);
  color: #4c3b6d;
  line-height: 1.5;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feedback-button {
  margin-top: 0;
  color: var(--accent);
  background: #fff;
  border-color: var(--border);
}

.feedback-button.selected {
  background: var(--soft);
  border-color: var(--accent);
}

.success-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 26px;
}

.error {
  margin: 12px 0 0;
  color: #a52c2c;
  line-height: 1.4;
}

.loader {
  width: 38px;
  height: 38px;
  margin: 2px auto 20px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

@media (min-width: 700px) {
  .app-shell { padding-top: 70px; }
  .card { padding: 34px; }
}
