*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

body {
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 3rem 1.5rem;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

/* ── View 1: selection ── */

#view-select h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

#repo-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.repo-card {
  border: 1px solid #fff;
  margin-top: -1px; /* collapse borders */
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}

.repo-card:first-child {
  margin-top: 0;
}

.repo-card:hover {
  background: #111;
}

.repo-card img {
  width: 40px;
  height: 40px;
  border-radius: 0;
  flex-shrink: 0;
}

.repo-card-label {
  font-size: 1rem;
  font-weight: 600;
}

.repo-grid-error {
  color: #555;
  font-size: 0.9rem;
}

/* ── View 2: form ── */

#view-form {
  animation: fadeIn 0.18s ease;
}

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

#back-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  margin-bottom: 2rem;
  letter-spacing: 0.03em;
  transition: color 0.1s;
}

#back-btn:hover {
  color: #fff;
}

.form-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.form-heading img {
  width: 40px;
  height: 40px;
  border-radius: 0;
  flex-shrink: 0;
}

.form-heading h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Form fields ── */

#bug-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}

input[type="text"],
textarea {
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  resize: vertical;
  transition: border-color 0.1s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #888;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #333;
}

#turnstile-widget {
  margin-top: 0.25rem;
}

#form-status {
  font-size: 0.9rem;
  min-height: 1.4rem;
}

#form-status.error   { color: #ff4444; }
#form-status.success { color: #44cc77; }
#form-status a { color: inherit; font-weight: 600; }

button[type="submit"] {
  background: #fff;
  color: #000;
  border: none;
  padding: 0.875rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.1s;
}

button[type="submit"]:hover:not(:disabled) {
  background: #ccc;
}

button[type="submit"]:disabled {
  background: #222;
  color: #555;
  cursor: not-allowed;
}
