:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1b2636;
  --muted: #5b6777;
  --primary: #1c6ed6;
  --primary-dark: #1556ac;
  --border: #d9e1ec;
  --success: #147a4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.card {
  width: 100%;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 20px rgba(16, 33, 58, 0.08);
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.25;
}

p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.progress {
  margin-bottom: 1rem;
}

.progress-bar {
  height: 8px;
  background: #e6edf7;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.question {
  margin: 1rem 0;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.72rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
}


.feedback-label {
  display: block;
  margin-top: 1rem;
  color: var(--text);
  font-weight: 500;
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

.options {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.option-btn,
.primary-btn,
.secondary-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  text-align: left;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-btn:hover,
.secondary-btn:hover {
  border-color: var(--primary);
}

.option-btn.active {
  border-color: var(--primary);
  background: #eef5ff;
  color: #114182;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1rem;
}

.primary-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-align: center;
  font-weight: 600;
}

.primary-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.65rem;
}

.result-item {
  background: #fafcff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.result-item h3 {
  margin-bottom: 0.25rem;
  font-size: 0.98rem;
}

.badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--success);
  border: 1px solid #bde5d3;
  background: #eefaf4;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.88rem;
}

.download-count {
  display: inline-block;
  margin-left: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (min-width: 700px) {
  .card {
    padding: 1.5rem 1.7rem;
  }
}

.badge-preview {
  display: block;
  margin-top: 0.6rem;
  width: min(100%, 220px);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.download-btn {
  display: inline-block;
  text-decoration: none;
  margin-top: 0.6rem;
  text-align: center;
}

.signature-image {
  display: block;
  width: min(100%, 460px);
  margin: 1rem auto 0;
}

.tool-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem;
}

.tool-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.tool-card p {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.admin-error {
  color: #9f1d1d;
  margin-top: 0.7rem;
}
