/* hub/ui/css/components.css — Buttons, cards, form controls,
   overlays, loaders. All reference base.css tokens — no hardcoded
   brand values. */

/* ── BUTTONS ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
  text-decoration: none;
}
.btn:disabled,
.btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn-primary:hover:not(:disabled) { background: var(--gold-2); border-color: var(--gold-2); }

.btn-ghost {
  border-color: var(--border-2);
  color: var(--w80);
}
.btn-ghost:hover:not(:disabled) { color: var(--white); border-color: var(--w50); }

.btn-danger {
  background: transparent;
  border-color: rgba(220,38,38, .5);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: rgba(220,38,38, .12); border-color: var(--red); }

.btn-link {
  padding: 4px 0;
  border: none;
  color: var(--gold);
  font-weight: 500;
}
.btn-link:hover:not(:disabled) { color: var(--gold-2); }

/* DM-Mono uppercase variant for queue-style action buttons. */
.btn-mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.btn-sm   { padding: 7px 12px; font-size: 12px; }
.btn-lg   { padding: 14px 24px; font-size: 14px; }
.btn-block{ width: 100%; }

/* ── CARDS ───────────────────────────────────────────────────────────── */
.card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: border-color .15s var(--ease);
}
.card:hover { border-color: var(--w30); }
.card-gold {
  border-color: var(--border);
  background: rgba(200,160,74, .04);
}
.card-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.card-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  margin: 0 0 4px;
}
.card-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--w50);
}
.card-body {
  font-size: 13px;
  color: var(--w80);
  line-height: 1.6;
}

/* ── FORM CONTROLS ──────────────────────────────────────────────────── */
.field {
  display: block;
  margin-bottom: 16px;
}
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.field-hint {
  font-size: 11px;
  color: var(--w50);
  margin-top: 4px;
  line-height: 1.5;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ink-2);
}
.textarea { resize: vertical; min-height: 80px; }
.select   { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--w50) 50%), linear-gradient(135deg, var(--w50) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

/* ── BADGES ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius: var(--radius-xs);
  background: var(--w06);
  color: var(--w80);
  border: 1px solid var(--border-2);
}
.badge-gold  { background: rgba(200,160,74, .12); color: var(--gold);  border-color: var(--border); }
.badge-green { background: rgba(5,150,105, .12);  color: var(--green); border-color: rgba(5,150,105, .35); }
.badge-amber { background: rgba(217,119,6, .12);  color: var(--amber); border-color: rgba(217,119,6, .35); }
.badge-red   { background: rgba(220,38,38, .12);  color: var(--red);   border-color: rgba(220,38,38, .35); }

/* ── OVERLAY / MODAL ────────────────────────────────────────────────── */
.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6,6,12, .82);
  backdrop-filter: blur(6px);
}
.gs-overlay-card {
  width: 100%;
  max-width: 920px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.gs-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.gs-overlay-close {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--w50);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.gs-overlay-close:hover { color: var(--white); border-color: var(--w50); }

/* ── LOADER (gold arc spinner) ───────────────────────────────────────── */
.gs-loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--w12);
  border-top-color: var(--gold);
  animation: gs-spin .9s linear infinite;
}
@keyframes gs-spin { to { transform: rotate(360deg); } }
.gs-loader-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--w50);
  font-size: 13px;
}

/* ── EMPTY STATES ───────────────────────────────────────────────────── */
.gs-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--w50);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}
.gs-empty-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  margin-bottom: 8px;
}

/* ── TOAST ──────────────────────────────────────────────────────────── */
.gs-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0,0,0, .4);
  animation: gs-toast-in .25s var(--ease);
}
.gs-toast-err { border-left-color: var(--red);   color: var(--red); }
.gs-toast-ok  { border-left-color: var(--green); color: var(--green); }
.gs-toast-info{ border-left-color: var(--gold);  color: var(--gold); }
@keyframes gs-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ERROR BOX ───────────────────────────────────────────────────────── */
.gs-error {
  padding: 11px 14px;
  background: rgba(220,38,38, .08);
  border: 1px solid rgba(220,38,38, .4);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--white);
  margin-bottom: 14px;
}

/* ── PAGE HEADER ────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--t-h2);
  margin: 0;
}
.page-sub {
  font-size: 13px;
  color: var(--w50);
  margin-top: 4px;
}
