/* Freebuff Token Console — dark, crisp 1px borders, zero ornament */

:root {
  --bg: #09090b;
  --surface: #101013;
  --surface-2: #16161a;
  --border: #232329;
  --border-strong: #2e2e36;
  --text: #ededf0;
  --muted: #86868f;
  --dim: #5c5c66;
  --accent: #4f8cff;
  --accent-dim: #1e3a6e;
  --ok: #34d17a;
  --warn: #e3b341;
  --err: #f0506e;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 520px; }

/* ---------------------------------------------------------------- header */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 34px; height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.brand-text h1 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ------------------------------------------------------------------ card */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card + .card { margin-top: 12px; }

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------- inputs */

.field { margin-bottom: 14px; }

label.lbl {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type="password"], input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .13s, box-shadow .13s;
  font-family: inherit;
}

input[type="password"]:focus, input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,.13);
}

/* --------------------------------------------------------------- buttons */

button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 15px;
  cursor: pointer;
  transition: background .13s, border-color .13s, opacity .13s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  line-height: 1.2;
}

button:hover:not(:disabled), .btn:hover { background: #1d1d22; border-color: #3a3a44; }
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
  padding: 12px 15px;
  font-size: 14.5px;
}
.btn-primary:hover:not(:disabled) { background: #3f7cef; border-color: #3f7cef; }

.btn-ghost { background: transparent; }

.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* ----------------------------------------------------------- mode toggle */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}

.segmented button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
}

.segmented button:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; color: var(--text); }
.segmented button.active {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ----------------------------------------------------------------- state */

.state { display: none; }
.state.on { display: block; }

.status {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
  animation: pulse 1.35s ease-in-out infinite;
}

.dot.ok { background: var(--ok); animation: none; }
.dot.err { background: var(--err); animation: none; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .28; } }

.status-text { flex: 1; min-width: 0; }
.status-text strong { display: block; font-size: 13.5px; font-weight: 550; }
.status-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- notice */

.notice {
  border: 1px solid var(--border);
  border-left: 2px solid var(--warn);
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.notice b { color: var(--text); font-weight: 550; }
.notice ol { margin: 7px 0 0 16px; }
.notice li { margin-bottom: 3px; }

/* ----------------------------------------------------------------- token */

.user-meta {
  display: grid;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 14px;
}

.user-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 13px;
  background: var(--bg);
  font-size: 13px;
}

.user-meta dt { color: var(--muted); flex-shrink: 0; }
.user-meta dd {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.token-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.token-box code {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
  line-height: 1.45;
  display: flex;
  align-items: center;
}

.token-box button { flex-shrink: 0; padding: 0 14px; }

.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; min-height: 17px; }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.mt { margin-top: 14px; }

.foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 18px;
}

a.link { color: var(--accent); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.err-banner {
  border: 1px solid #4a1d28;
  background: #1a0e12;
  color: #ff97ad;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 14px;
}

@media (max-width: 420px) {
  body { padding: 16px 13px; }
  .card { padding: 17px; }
  .btn-row { flex-direction: column; }
}
