/* ============================================================
   Base — reset, typography, primitives (AGENTiX)
   ============================================================ */

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: hsl(var(--foreground));
  background: var(--gray-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--black);
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img { max-width: 100%; display: block; }

code, kbd, pre, samp { font-family: var(--font-mono); }

::selection { background: hsl(190 100% 50% / 0.25); }

/* Native form controls ------------------------------------------ */
/* Kilken markup uses bare inputs inside <label>; give them the
   AGENTiX .input treatment by default. Wrapped in :where() so the
   defaults carry zero specificity and any page/component rule wins. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"])),
:where(select),
:where(textarea) {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

:where(select:not([multiple])) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

:where(textarea) {
  min-height: 96px;
  resize: vertical;
}

:where(input, textarea)::placeholder {
  color: #a3a3a3;
}

:where(input, select, textarea):focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(190 100% 50% / 0.15);
}

:where(input, select, textarea):disabled {
  background-color: var(--gray-soft);
  color: var(--gray-muted-text);
  cursor: not-allowed;
}

:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--black);
  width: 16px;
  height: 16px;
}

:where(input[type="range"]) { accent-color: var(--cyan); }

/* Accent helpers ------------------------------------------------ */
.text-gradient-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-muted { color: hsl(var(--muted-foreground)); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-cyan { color: var(--cyan); }

.mono { font-family: var(--font-mono); }

/* Cyan glow used sparingly (login, headers, empty states) -------- */
.cyan-glow {
  position: absolute;
  border-radius: 50%;
  background: hsl(190 100% 50% / 0.10);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

/* Motion primitives --------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes skeletonSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* fill-mode backwards (not both): a transform left behind after the entrance
   would make the element the containing block for position:fixed children and
   trap every modal/overlay rendered inside the page content. */
.fade-up { animation: fadeUp var(--dur-slow) var(--ease) backwards; }
.fade-in { animation: fadeIn var(--dur-slow) var(--ease) backwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Utility spacing ------------------------------------------------ */
.stack > * + * { margin-top: var(--space-md); }
.row { display: flex; align-items: center; gap: var(--space-sm); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.grow { flex: 1; }
.hidden,
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
