:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --card: #ffffff;
  --text: #1e2a1f;
  --muted: #5d665d;
  --line: #d9d4c7;
  --accent: #2c5d3f;
  --accent-dark: #21462f;
  --danger: #8b1e1e;
  --danger-bg: #fbe9e9;
  --success: #1d5f34;
  --success-bg: #eaf7ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #ede7da 0%, var(--bg) 100%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
}

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.15;
}

.intro,
.questions-header p {
  color: var(--muted);
}

/* File-folder tabs */
.tabs-bar {
  display: flex;
  gap: 0;
  width: 100%;
  padding: 0;
}

.tab {
  flex: 1;
  background: #ede7da;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 14px 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-right: -1px;
  position: relative;
}

.tab:last-child {
  margin-right: 0;
}

.tab:hover {
  color: var(--text);
  background: #f5f1e8;
}

.tab.active {
  color: var(--accent);
  background: var(--card);
  border-bottom: 1px solid var(--card);
  z-index: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.field,
.question-card {
  display: grid;
  gap: 8px;
}

.field span,
.question-label,
.questions-header h2 {
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(44, 93, 63, 0.15);
  border-color: var(--accent);
}

.questions-header,
.question-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.questions {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfbf7;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

button.primary:hover {
  background: var(--accent-dark);
}

button.secondary,
button.remove-question {
  background: #eef2ed;
  color: var(--text);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message {
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.message.error {
  color: var(--danger);
  background: var(--danger-bg);
}

.message.success {
  color: var(--success);
  background: var(--success-bg);
}

.limit-note {
  color: var(--muted);
  font-size: 0.95rem;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235d665d' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

@media (max-width: 640px) {
  .page {
    padding: 16px 8px;
  }

  .card {
    padding: 22px;
  }

  .tabs-bar {
    gap: 0;
  }

  .tab {
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  .questions-header,
  .question-top-row {
    align-items: flex-start;
    flex-direction: column;
  }

  button.secondary,
  button.remove-question,
  button.primary {
    width: 100%;
  }
}
