/* -------------------------------------------------------
   gh-follow-sync — design tokens
   Paleta e tipografia inspiradas em terminal / git diff,
   sem reaproveitar o dark theme padrão do próprio GitHub.
------------------------------------------------------- */

:root {
  --bg: #16181d;
  --surface: #1c1f26;
  --surface-raised: #22262e;
  --border: #2c3038;
  --border-soft: #23262d;

  --text: #e7e6e2;
  --muted: #8d919b;
  --muted-dim: #5c606a;

  --add: #6fbf73;
  --add-dim: #3c4a3d;
  --remove: #cf6a5c;
  --remove-dim: #4a3634;
  --gap: #d9a955;

  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 4px;
  --content-width: 640px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px);
  background-size: 100% 32px;
  background-position: 0 90px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--add-dim);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--add);
  outline-offset: 2px;
}

/* -------------------------------------------------------
   Shell
------------------------------------------------------- */

.shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.shell__bar {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 10px;
}

.shell__name {
  color: var(--text);
  font-weight: 500;
}

.shell__cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--add);
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.lede {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 40px;
}

/* -------------------------------------------------------
   Prompt labels — usados como divisores de seção
------------------------------------------------------- */

.prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-dim);
  margin: 0 0 16px;
}

.prompt::before {
  content: "$ ";
  color: var(--add);
}

/* -------------------------------------------------------
   Panel (conexão)
------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.field {
  margin-bottom: 18px;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
}

.field input::placeholder {
  color: var(--muted-dim);
}

.field__hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.field__hint:hover {
  color: var(--text);
  border-color: var(--muted);
}

.panel__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  accent-color: var(--add);
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn--primary {
  background: var(--add);
  color: #10130f;
  font-weight: 600;
}

.btn--primary:hover {
  background: #80cb83;
}

.btn--primary:disabled {
  background: var(--add-dim);
  color: var(--muted);
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn--ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

.status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 0;
  min-height: 18px;
}

.status[data-tone="error"] { color: var(--remove); }
.status[data-tone="ok"] { color: var(--add); }

/* -------------------------------------------------------
   Stats
------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.stat {
  background: var(--surface);
  padding: 16px 14px;
  text-align: left;
}

.stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.stat--gap .stat__value {
  color: var(--gap);
}

.stat__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* -------------------------------------------------------
   Results / tabs
------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tab {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  border-color: var(--muted);
}

.tab.is-active {
  color: var(--text);
  border-color: var(--add);
  background: var(--add-dim);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 460px;
  overflow-y: auto;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.row:last-child {
  border-bottom: none;
}

.row__mark {
  font-family: var(--font-mono);
  font-weight: 600;
  width: 14px;
  flex-shrink: 0;
}

.row__mark--add { color: var(--add); }
.row__mark--remove { color: var(--remove); }

.row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__name a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.row__name a:hover {
  color: var(--add);
}

.row .btn {
  padding: 6px 12px;
  font-size: 12px;
  flex-shrink: 0;
}

.row .btn--remove {
  border-color: var(--remove-dim);
  color: var(--remove);
}

.row .btn--remove:hover {
  background: var(--remove-dim);
}

.row .btn--add {
  border-color: var(--add-dim);
  color: var(--add);
}

.row .btn--add:hover {
  background: var(--add-dim);
}

.empty {
  padding: 32px 14px;
  text-align: center;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
}

/* -------------------------------------------------------
   Responsive
------------------------------------------------------- */

@media (max-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn--primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell__cursor {
    animation: none;
    opacity: 1;
  }
}
