:root {
  --bg: #2b2b2b;          /* charcoal surface */
  --fg: #f2f2f2;          /* near-white text */
  --muted: #a8a8a8;       /* secondary text, readable on charcoal */
  --line: #3d3d3d;        /* subtle borders / dividers */
  --accent: #D9A441;      /* brand gold — links, highlights, focus */
  --accent-hover: #E6B85C; /* slightly lighter gold on hover */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

/* Links use the gold accent (nav links keep their muted treatment below). */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Keyboard-visible focus uses the gold accent. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

nav .brand { font-weight: 600; letter-spacing: 0.02em; }

nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }

main { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.5rem; }

h1 { font-weight: 600; margin: 0 0 0.5rem; }

.muted { color: var(--muted); }

code {
  background: #353535;
  border: 1px solid var(--line);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* --- Forms ------------------------------------------------------------------ */
.form-section { margin: 0 0 1.75rem; }
.form-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.field { margin: 0 0 0.85rem; }
.field > label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0 0 0.3rem; }

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field textarea,
.field select,
.override-row input,
.override-row select {
  width: 100%;
  background: #353535;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}

.field textarea { min-height: 4rem; resize: vertical; }

.checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-size: 0.9rem;
  margin: 0 0 0.4rem;
}
.checks input { width: auto; }

.hint { font-size: 0.78rem; color: var(--muted); margin: 0.25rem 0 0; }

#advanced-area { display: none; margin-top: 0.5rem; }

.override-row {
  display: none; /* JS reveals (as flex) only for checked marketplaces */
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.5rem;
}
.override-row .mk-name { min-width: 6rem; color: var(--muted); font-size: 0.85rem; }
.override-row input { flex: 1; }
.override-row select { width: auto; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }

/* --- Brand ----------------------------------------------------------------- */
.kyk-mark {
  display: inline-block;
  vertical-align: middle;
  height: 28px;
  width: auto;
  color: var(--fg); /* currentColor kappa inherits this */
}

.kyk-mark--lg { height: 96px; }

/* Brand lockup in the nav: mark + KYKLOS wordmark. */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
}

.brand-lockup .wordmark {
  letter-spacing: 3px;
  font-weight: 500;
}

/* One-shot directional spin: clockwise = login, counter-clockwise = logout. */
@keyframes kyk-cw {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

@keyframes kyk-ccw {
  from { transform: rotate(0); }
  to   { transform: rotate(-360deg); }
}

.kyk-spin-cw  { animation: kyk-cw  0.8s ease-out 1 forwards; }
.kyk-spin-ccw { animation: kyk-ccw 0.8s ease-out 1 forwards; }

@media (prefers-reduced-motion: reduce) {
  .kyk-spin-cw,
  .kyk-spin-ccw { animation: none; }
}
