/* Roekoe Games Bug Tracker — shares the Dev Hub design system
   (Fraunces + Archivo, ink/paper/muted/line tokens, flat-line layout) */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --line: #d8d8d8;
  --critical-bg: #0a0a0a;
  --critical-fg: #ffffff;
  --header-h: 4.5rem;
  --tone-green: #3f7d4a;
  --tone-amber: #b8860b;
  --tone-orange: #c1580c;
  --tone-red: #b3261e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  min-height: 100vh;
  font-family: 'Archivo', sans-serif;
  color: var(--ink);
}

a {
  color: inherit;
}

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: 30rem;
  margin: 0 auto;
  padding: 0 6vw;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 900px) {
  .site-header-inner {
    max-width: 64rem;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand span.sub {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.btn:hover {
  opacity: 0.85;
}

.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- Content shell ---------- */
.content-wrap {
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 5vh, 3rem) 6vw 8vh;
}

.page {
  width: 100%;
  max-width: 30rem;
}

@media (min-width: 900px) {
  .page {
    max-width: 46rem;
  }
  .page.wide {
    max-width: 64rem;
  }
}

.section-title {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.9rem;
}

.section-title--first {
  margin-top: 0;
}

.section-hint {
  margin: -0.6rem 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Forms ---------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 700px) {
  .field-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

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

.field label {
  font-size: 0.82rem;
  font-weight: 600;
}

.field .hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: -0.15rem;
}

.field input,
.field select,
.field textarea {
  font-family: 'Archivo', sans-serif;
  font-size: 0.92rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.field textarea {
  min-height: 5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.form-error {
  font-size: 0.85rem;
  color: var(--ink);
  background: #f4f4f4;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  margin-top: 1rem;
}

/* ---------- Attachments ---------- */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- Reporter identity ---------- */
.who-bar {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

.required-legend {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.req {
  color: var(--ink);
  font-weight: 700;
}

.page.locked {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

/* ---------- Access key modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 6vw;
}

.modal-card {
  background: var(--paper);
  border-radius: 10px;
  padding: 2rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modal-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  from { transform: scale(0.9) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-card input {
  width: 100%;
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.modal-card input.shake {
  animation: shake 0.35s;
  border-color: var(--ink);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.modal-error {
  font-size: 0.8rem;
  color: var(--ink);
  background: #f4f4f4;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  margin-top: 0.9rem;
}

/* ---------- Segmented control ---------- */
.segmented {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.25rem;
  gap: 0.15rem;
  background: var(--paper);
  max-width: 100%;
  overflow-x: auto;
}

.segmented-highlight {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  border-radius: 100px;
  background: var(--ink);
  transition: left 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

.segmented-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 100px;
  cursor: pointer;
  color: var(--ink);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.segmented-btn.active {
  color: var(--paper);
}

/* Tone scale for Reproduction Rate / Severity / Priority — a visual cue
   from "fine" to "urgent" that Input Device/Screen Mode don't use. The
   :not(.active) guard keeps the active pill's text white regardless of
   tone, since the highlight behind it already carries the tone color. */
.segmented-btn[data-tone="green"]:not(.active) { color: var(--tone-green); }
.segmented-btn[data-tone="amber"]:not(.active) { color: var(--tone-amber); }
.segmented-btn[data-tone="orange"]:not(.active) { color: var(--tone-orange); }
.segmented-btn[data-tone="red"]:not(.active) { color: var(--tone-red); }

/* ---------- Configurations ---------- */
.config-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.config-pill {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.config-pill.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.config-pill.add {
  border-style: dashed;
  color: var(--muted);
}

.config-pill.ghost {
  color: var(--muted);
  border-style: dotted;
}

.config-summary {
  padding: 1rem 0 0.25rem;
}

.config-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 0.5rem;
  animation: modal-pop 0.2s ease;
}

.config-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.25rem 0;
}

@media (min-width: 700px) {
  .kv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kv-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.kv-value {
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Success state ---------- */
.success-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.75rem 2rem;
  text-align: center;
  max-width: 26rem;
  margin: 2.5rem auto 0;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 1.25rem;
}

.success-title {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.success-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1.85rem;
}

.success-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}