:root {
  --bg-0: #0d1117;
  --bg-1: #161b22;
  --bg-2: #21262d;
  --bg-3: #30363d;
  --border: #30363d;
  --text-0: #f0f6fc;
  --text-1: #c9d1d9;
  --text-2: #8b949e;
  --blue: #58a6ff;
  --blue-dim: #1f6feb;
  --green: #3fb950;
  --green-dim: #238636;
  --yellow: #d29922;
  --red: #f85149;
  --red-dim: #da3633;
  --purple: #bc8cff;
  --radius: 6px;
  --radius-lg: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Noto Sans, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.5;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

.loading-screen {
  display: none;
  height: 100vh;
  align-items: center;
  justify-content: center;
}
.loading-screen.active { display: flex; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

input[type="text"],
input[type="email"],
textarea {
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 12px;
  background: var(--bg-0);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-0);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-0) inset;
  box-shadow: 0 0 0 1000px var(--bg-0) inset;
  transition: background-color 5000s ease-out 0s;
}
input:focus, textarea:focus {
  border-color: var(--blue);
}
input::placeholder, textarea::placeholder { color: var(--text-2); }
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }

.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--green-dim);
  color: var(--text-0);
  border-color: rgba(63, 185, 80, .4);
}
.btn-primary:hover:not(:disabled) { background: var(--green); }

.btn-blue {
  background: var(--blue-dim);
  color: var(--text-0);
  border-color: rgba(88, 166, 255, .4);
}
.btn-blue:hover:not(:disabled) { background: var(--blue); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--border);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-dim);
  color: var(--text-0);
  border-color: var(--red-dim);
}

.btn-warning {
  background: transparent;
  color: var(--yellow);
  border-color: var(--border);
}
.btn-warning:hover:not(:disabled) {
  background: rgba(210, 153, 34, .2);
  border-color: var(--yellow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
  padding: 4px 10px;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-0);
  border-color: var(--text-2);
}

.btn-sm { font-size: 12px; padding: 4px 10px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  transform: translateY(120%);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  max-width: 400px;
}
.toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.toast-success { background: var(--green-dim); color: var(--text-0); }
.toast-error   { background: var(--red-dim);   color: var(--text-0); }

kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--text-1);
}
