/**
 * NgideIn Base Styles — Neubrutalism
 * ====================================
 * Thick borders. Hard shadows. Bold colors. Raw personality.
 * No gradients. WCAG AAA. Dark mode ready.
 *
 * Requires: tokens.css
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-neutral-900);
  background-color: var(--color-neutral-50);
  min-height: 100vh;
}

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

a {
  color: var(--color-primary-600);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: var(--font-semibold);
  transition: color var(--duration-fast) var(--ease-default);
}
a:hover {
  color: var(--color-accent-500);
}
a:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* --------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------- */
.ni-display {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
  color: var(--color-neutral-900);
}

.ni-heading-xl {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
  color: var(--color-neutral-900);
}

.ni-heading {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-snug);
  color: var(--color-neutral-900);
}

.ni-subheading {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: var(--leading-snug);
  color: var(--color-neutral-900);
}

.ni-body {
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-body);
}

.ni-body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-neutral-600);
}

.ni-caption {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-wide);
  color: var(--color-neutral-600);
}

.ni-overline {
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary-600);
}

.ni-prose {
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
.ni-prose > * + * {
  margin-top: 1em;
}

.ni-nums {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------
   LAYOUT
   -------------------------------------------------------- */
.ni-container {
  width: 100%;
  max-width: var(--container-md);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.ni-container--sm  { max-width: var(--container-sm); }
.ni-container--lg  { max-width: var(--container-lg); }
.ni-container--xl  { max-width: var(--container-xl); }

.ni-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.ni-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--color-neutral-300) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.ni-page > * {
  position: relative;
  z-index: 1;
}
.ni-page__main { flex: 1; }

/* --------------------------------------------------------
   BACKGROUND SHAPES
   --------------------------------------------------------
   Floating geometric shapes for visual interest.
   Place .bg-shape divs as direct children of .ni-page.
   -------------------------------------------------------- */
.bg-shape {
  position: fixed;
  border: var(--border-thick) solid var(--color-black);
  z-index: 0;
  pointer-events: none;
}
.bg-shape--1 {
  width: 80px; height: 80px;
  background: var(--color-yellow-300);
  border-radius: var(--radius-md);
  top: 10%; left: 5%;
  transform: rotate(12deg);
  box-shadow: var(--shadow-md);
}
.bg-shape--2 {
  width: 50px; height: 50px;
  background: var(--color-accent-200);
  border-radius: var(--radius-full);
  top: 18%; right: 8%;
  box-shadow: var(--shadow-sm);
}
.bg-shape--3 {
  width: 60px; height: 60px;
  background: var(--color-primary-200);
  border-radius: var(--radius-md);
  bottom: 20%; left: 8%;
  transform: rotate(-8deg);
  box-shadow: var(--shadow-sm);
}
.bg-shape--4 {
  width: 40px; height: 40px;
  background: var(--color-primary-400);
  top: 55%; right: 5%;
  transform: rotate(45deg);
  box-shadow: var(--shadow-sm);
}
.bg-shape--5 {
  width: 100px; height: 100px;
  background: var(--color-accent-100);
  border-radius: var(--radius-full);
  bottom: 10%; right: 6%;
  box-shadow: var(--shadow-md);
  opacity: 0.6;
}
@media (max-width: 640px) {
  .bg-shape--1 { width: 50px; height: 50px; left: 2%; }
  .bg-shape--2 { width: 35px; height: 35px; }
  .bg-shape--3 { width: 40px; height: 40px; left: 3%; }
  .bg-shape--4 { width: 28px; height: 28px; right: 2%; }
  .bg-shape--5 { width: 60px; height: 60px; right: 2%; }
}

/* --------------------------------------------------------
   HERO
   --------------------------------------------------------
   Bold color block with thick bottom border.
   -------------------------------------------------------- */
.ni-hero {
  background: var(--color-primary-400);
  color: var(--color-black);
  text-align: center;
  padding: var(--space-12) var(--page-gutter) var(--space-10);
  border-bottom: var(--border-thick) solid var(--color-black);
}

.ni-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--color-neutral-0);
  border: var(--border-width) solid var(--color-black);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}
.ni-hero__icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.ni-hero__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-heading);
}

.ni-hero__subtitle {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-neutral-800);
  margin-top: var(--space-2);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--leading-body);
}

.ni-hero--accent {
  background: var(--color-accent-300);
}
.ni-hero--yellow {
  background: #fde047;
  color: #1c1917;
  border-color: #1c1917;
}
.ni-hero--yellow,
.ni-hero--yellow * {
  color: #1c1917;
}
.ni-hero--light {
  background: var(--color-neutral-0);
}

/* --------------------------------------------------------
   CARD
   --------------------------------------------------------
   Thick border + hard shadow. The Neubrutalism core.
   -------------------------------------------------------- */
.ni-card {
  background: var(--color-neutral-0);
  border: var(--border-width) solid var(--color-black);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-normal) var(--ease-default),
              box-shadow var(--duration-normal) var(--ease-default);
}

.ni-card--hoverable:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}
.ni-card--hoverable:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-active);
}

.ni-card--flat {
  box-shadow: none;
}

.ni-card--primary {
  background: var(--color-primary-50);
}
.ni-card--accent {
  background: var(--color-accent-50);
}
.ni-card--yellow {
  background: #fef08a;
  color: #1c1917;
  border-color: #1c1917;
  box-shadow: 4px 4px 0 #1c1917;
}
.ni-card--yellow,
.ni-card--yellow * {
  color: #1c1917;
}

/* --------------------------------------------------------
   BUTTONS
   --------------------------------------------------------
   Chunky, bordered, hard shadow.
   Hover: shadow shifts. Active: shadow collapses.
   -------------------------------------------------------- */
.ni-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-family-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border: var(--border-width) solid var(--color-black);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
  user-select: none;
  -webkit-user-select: none;
}

.ni-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}
.ni-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-active);
}

.ni-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Primary */
.ni-btn--primary {
  background: var(--color-primary-400);
  color: var(--color-black);
}

/* Accent */
.ni-btn--accent {
  background: var(--color-accent-400);
  color: var(--color-neutral-0);
}

/* Yellow — force dark border/shadow in all themes */
.ni-btn--yellow {
  background: #fde047;
  color: #1c1917;
  border-color: #1c1917;
  box-shadow: 2px 2px 0 #1c1917;
}
.ni-btn.ni-btn--yellow:hover:not(:disabled) {
  box-shadow: 4px 4px 0 #1c1917;
}
.ni-btn.ni-btn--yellow:active:not(:disabled) {
  box-shadow: 1px 1px 0 #1c1917;
}

/* Secondary — white/outlined */
.ni-btn--secondary {
  background: var(--color-neutral-0);
  color: var(--color-neutral-900);
}

/* Ghost — no shadow, no bg */
.ni-btn--ghost {
  background: transparent;
  color: var(--color-neutral-900);
  box-shadow: none;
  border-color: transparent;
}
.ni-btn--ghost:hover:not(:disabled) {
  background: var(--color-neutral-100);
  border-color: var(--color-black);
  box-shadow: var(--shadow-sm);
}

/* Danger */
.ni-btn--danger {
  background: var(--color-danger-500);
  color: var(--color-neutral-0);
}

/* Sizes */
.ni-btn--sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}
.ni-btn--lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}
.ni-btn--full { width: 100%; }

/* Disabled */
.ni-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------
   FORM INPUTS
   --------------------------------------------------------
   Thick borders, no soft shadows.
   -------------------------------------------------------- */
.ni-input,
.ni-select,
.ni-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-neutral-900);
  background: var(--color-neutral-0);
  border: var(--border-width) solid var(--color-black);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  outline: none;
  transition: box-shadow var(--duration-fast) var(--ease-default);
}

.ni-input:focus,
.ni-select:focus,
.ni-textarea:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-200);
}
.ni-input:focus-visible,
.ni-select:focus-visible,
.ni-textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-200);
}

.ni-input::placeholder,
.ni-textarea::placeholder {
  color: var(--color-neutral-400);
  font-weight: var(--font-regular);
}

.ni-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-2);
}

.ni-field {
  margin-bottom: var(--space-5);
}

.ni-checkbox {
  accent-color: var(--color-primary-500);
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}
.ni-checkbox:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* --------------------------------------------------------
   RANGE SLIDER
   -------------------------------------------------------- */
.ni-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-200);
  border: 1px solid var(--color-black);
  outline: none;
}
.ni-slider:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 4px;
}
.ni-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary-400);
  border: 2px solid var(--color-black);
  cursor: pointer;
}
.ni-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary-400);
  border: 2px solid var(--color-black);
  cursor: pointer;
}

/* --------------------------------------------------------
   BADGES
   --------------------------------------------------------
   Bordered pill, bold colors.
   -------------------------------------------------------- */
.ni-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: var(--border-width) solid var(--color-black);
}

.ni-badge--primary {
  background: var(--color-primary-200);
  color: var(--color-primary-900);
}
.ni-badge--accent {
  background: var(--color-accent-200);
  color: var(--color-accent-900);
}
.ni-badge--yellow {
  background: #fde047;
  color: #1c1917;
  border-color: #1c1917;
}
.ni-badge--success {
  background: var(--color-success-100);
  color: var(--color-on-success);
}
.ni-badge--warning {
  background: var(--color-warning-100);
  color: var(--color-on-warning);
}
.ni-badge--danger {
  background: var(--color-danger-100);
  color: var(--color-on-danger);
}
.ni-badge--neutral {
  background: var(--color-neutral-200);
  color: var(--color-neutral-900);
}

/* --------------------------------------------------------
   ALERTS
   --------------------------------------------------------
   Thick border, hard shadow, bold color.
   -------------------------------------------------------- */
.ni-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-body);
  padding: var(--space-4) var(--space-5);
  border: var(--border-width) solid var(--color-black);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.ni-alert--success {
  background: var(--color-success-50);
  color: var(--color-on-success);
}
.ni-alert--warning {
  background: var(--color-warning-50);
  color: var(--color-on-warning);
}
.ni-alert--danger {
  background: var(--color-danger-50);
  color: var(--color-on-danger);
}
.ni-alert--info {
  background: var(--color-info-50);
  color: var(--color-on-info);
}

/* --------------------------------------------------------
   STEP INDICATOR
   -------------------------------------------------------- */
.ni-step-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-extrabold);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
  border: var(--border-width) solid var(--color-black);
  background: var(--color-neutral-0);
  color: var(--color-neutral-600);
}

.ni-step-badge--active {
  background: var(--color-primary-400);
  color: var(--color-black);
  box-shadow: var(--shadow-sm);
}

.ni-step-badge--done {
  background: var(--color-success-500);
  color: var(--color-neutral-0);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------
   DROPZONE
   -------------------------------------------------------- */
.ni-dropzone {
  border: 3px dashed var(--color-black);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  cursor: pointer;
  background: var(--color-neutral-100);
  transition: all var(--duration-normal) var(--ease-default);
}
.ni-dropzone:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}
.ni-dropzone:hover,
.ni-dropzone--hover {
  background: var(--color-primary-50);
  border-style: solid;
}
.ni-dropzone--done {
  background: var(--color-success-50);
  border-style: solid;
  border-color: var(--color-success-500);
}

/* --------------------------------------------------------
   CHIP / TAG
   -------------------------------------------------------- */
.ni-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: var(--border-width) solid var(--color-black);
  background: var(--color-neutral-0);
  color: var(--color-neutral-900);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-default);
}
.ni-chip:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}
.ni-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}
.ni-chip:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-active);
}
.ni-chip--active {
  background: var(--color-primary-400);
  color: var(--color-black);
}

/* --------------------------------------------------------
   SECTION
   -------------------------------------------------------- */
.ni-section {
  padding: var(--space-12) var(--page-gutter);
}
.ni-section--muted {
  background: var(--color-neutral-100);
}
.ni-section--primary {
  background: var(--color-primary-50);
}
.ni-section--yellow {
  background: #fef08a;
  color: #1c1917;
}
.ni-section--yellow,
.ni-section--yellow * {
  color: #1c1917;
}
.ni-section--dark {
  background: var(--color-neutral-900);
  color: var(--color-neutral-100);
}

/* --------------------------------------------------------
   FOOTER
   -------------------------------------------------------- */
.ni-footer {
  text-align: center;
  padding: var(--space-10) var(--page-gutter);
  border-top: var(--border-width) solid var(--color-black);
  color: var(--color-neutral-600);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}
.ni-footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--font-extrabold);
  color: var(--color-neutral-900);
}

/* --------------------------------------------------------
   DIVIDER
   -------------------------------------------------------- */
.ni-divider {
  border: none;
  border-top: var(--border-width) solid var(--color-black);
  margin: var(--space-6) 0;
}

/* --------------------------------------------------------
   ANIMATIONS
   -------------------------------------------------------- */
.ni-fade-in {
  animation: ni-fadeIn var(--duration-slow) var(--ease-out);
}
@keyframes ni-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ni-fade-in { animation: none; }
  .ni-card--hoverable:hover,
  .ni-btn:hover:not(:disabled),
  .ni-btn:active:not(:disabled),
  .ni-chip:hover,
  .ni-chip:active {
    transform: none;
  }
}

/* --------------------------------------------------------
   SCREEN READER
   -------------------------------------------------------- */
.ni-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;
}

/* --------------------------------------------------------
   UTILITIES
   -------------------------------------------------------- */
.ni-text-center { text-align: center; }
.ni-text-left   { text-align: left; }
.ni-text-right  { text-align: right; }

.ni-text-primary { color: var(--color-primary-600); }
.ni-text-accent  { color: var(--color-accent-500); }
.ni-text-success { color: var(--color-on-success); }
.ni-text-warning { color: var(--color-on-warning); }
.ni-text-danger  { color: var(--color-on-danger); }
.ni-text-muted   { color: var(--color-neutral-600); }

.ni-icon-primary { color: var(--color-primary-500); }
.ni-icon-accent  { color: var(--color-accent-400); }
.ni-icon-success { color: var(--color-success-500); }
.ni-icon-warning { color: var(--color-warning-500); }
.ni-icon-danger  { color: var(--color-danger-500); }
.ni-icon-muted   { color: var(--color-neutral-400); }

.ni-highlight {
  background: #fde047;
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  color: #1c1917;
  font-weight: var(--font-semibold);
}

.ni-stat {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-heading);
  color: var(--color-neutral-900);
}

.ni-card--border-left {
  border-left: 6px solid var(--color-black);
}
.ni-card--border-primary {
  border-left: 6px solid var(--color-primary-400);
}
.ni-card--border-accent {
  border-left: 6px solid var(--color-accent-400);
}
.ni-card--border-yellow {
  border-left: 6px solid #facc15;
}

.ni-focus-ring:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* --------------------------------------------------------
   THEME TOGGLE
   -------------------------------------------------------- */
.ni-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--color-black);
  background: var(--color-neutral-0);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-default);
}
.ni-theme-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}
.ni-theme-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-active);
}
.ni-theme-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

:root:not([data-theme="dark"]) .ni-theme-toggle__dark { display: none; }
:root[data-theme="dark"] .ni-theme-toggle__light { display: none; }
