/* ============================================================================
   REX.digital — huisstijl
   ----------------------------------------------------------------------------
   Kant-en-klare stylesheet, identiek aan rexdigital.nl.
   Geen bouwstap nodig: inladen met één <link> en klaar.

       <link rel="stylesheet" href="/rex-brand.css">

   Deze regel moet ALS LAATSTE stylesheet staan, zodat hij oude stijlen
   overschrijft.

   Alle kleuren staan als RGB-kanalen in :root. Wil je later één kleur
   aanpassen, dan doe je dat hier en verandert het overal mee.
   ========================================================================== */

/* ---------------------------------------------------------------- TOKENS -- */
:root {
  /* Merkkleuren */
  --brand-purple: 139 92 246;        /* #8B5CF6 — primair, knoppen, accenten */
  --brand-purple-deep: 124 58 237;   /* #7C3AED — donkere kant van de gradient */
  --brand-blue: 96 165 250;          /* #60A5FA — secundair, statuslabels */

  /* Vlakken */
  --surface-base: 10 10 10;          /* #0A0A0A — paginaachtergrond */
  --surface-card: 26 26 26;          /* #1A1A1A — kaarten, panelen, velden */
  --surface-line: 42 42 42;          /* #2A2A2A — randen en scheidingslijnen */

  /* Tekst */
  --ink: 255 255 255;                /* #FFFFFF — koppen en nadruk */
  --ink-muted: 156 163 175;          /* #9CA3AF — lopende tekst, labels */

  /* Statuskleuren */
  --state-ok: 74 222 128;
  --state-warn: 251 191 36;
  --state-error: 248 113 113;

  /* Typografie */
  --rex-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Vormtaal */
  --rex-radius-card: 16px;
  --rex-radius-field: 12px;
  --rex-radius-pill: 50px;

  /* Schaduwen */
  --rex-shadow-cta: 0 4px 20px rgb(var(--brand-purple) / 0.30);
  --rex-shadow-cta-hover: 0 8px 30px rgb(var(--brand-purple) / 0.50);
  --rex-shadow-card: 0 20px 60px rgb(0 0 0 / 0.45);
}

/* ------------------------------------------------------------------ BASIS -- */
body {
  background: rgb(var(--surface-base));
  color: rgb(var(--ink));
  font-family: var(--rex-font);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* Zachte paarse gloed bovenaan de pagina — de handtekening van de huisstijl.
   Niet nodig op elk scherm; zet de class op je hoofdcontainer waar je hem wilt. */
.rex-glow {
  position: relative;
}
.rex-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgb(var(--brand-purple) / 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgb(var(--brand-blue) / 0.10) 0%, transparent 50%);
}

h1, h2, h3, h4 {
  color: rgb(var(--ink));
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p, li, label, td {
  color: rgb(var(--ink-muted));
  line-height: 1.6;
}

a { color: rgb(var(--brand-purple)); text-decoration: none; }
a:hover { color: rgb(var(--brand-blue)); }

::selection { background: rgb(var(--brand-purple) / 0.3); }

:focus-visible {
  outline: 2px solid rgb(var(--brand-purple));
  outline-offset: 2px;
}

/* Tekst met kleurverloop — voor één belangrijk woord in een kop. Niet vaker. */
.rex-gradient-text {
  background: linear-gradient(90deg, rgb(var(--brand-purple)) 0%, rgb(var(--brand-blue)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Klein hoofdletterlabel boven een kop */
.rex-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgb(var(--brand-purple));
}

/* ---------------------------------------------------------------- LAYOUT -- */
.rex-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- HEADER -- */
.rex-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 24px;
  background: rgb(var(--surface-base) / 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgb(var(--surface-line) / 0.5);
}
.rex-header img { height: 40px; width: auto; object-fit: contain; }

/* --------------------------------------------------------------- KNOPPEN -- */
.rex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--rex-radius-pill);
  font-family: var(--rex-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.rex-btn-primary {
  background: linear-gradient(135deg, rgb(var(--brand-purple)), rgb(var(--brand-purple-deep)));
  color: rgb(var(--ink));
  box-shadow: var(--rex-shadow-cta);
}
.rex-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--rex-shadow-cta-hover);
  color: rgb(var(--ink));
}

.rex-btn-secondary {
  background: transparent;
  color: rgb(var(--ink));
  border: 2px solid transparent;
}
.rex-btn-secondary:hover { border-color: rgb(var(--ink-muted)); }

.rex-btn-outline {
  background: transparent;
  color: rgb(var(--ink));
  border: 1px solid rgb(var(--surface-line));
}
.rex-btn-outline:hover { border-color: rgb(var(--ink-muted)); }

.rex-btn-sm { padding: 10px 20px; font-size: 0.875rem; }

.rex-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------- KAARTEN -- */
.rex-card {
  background: rgb(var(--surface-card));
  border: 1px solid rgb(var(--surface-line));
  border-radius: var(--rex-radius-card);
  padding: 32px;
}

/* Alleen gebruiken als de kaart klikbaar is */
.rex-card-hover { transition: all 0.3s ease; }
.rex-card-hover:hover {
  transform: translateY(-4px);
  border-color: rgb(var(--brand-purple) / 0.5);
  box-shadow: 0 16px 40px rgb(var(--brand-purple) / 0.15);
}

/* Icoonvlak linksboven in een kaart */
.rex-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--rex-radius-field);
  background: rgb(var(--brand-purple) / 0.15);
  color: rgb(var(--brand-purple));
}

/* ------------------------------------------------------------ FORMULIER -- */
.rex-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--ink));
}

.rex-input,
.rex-select,
.rex-textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgb(var(--surface-card));
  border: 1px solid rgb(var(--surface-line));
  border-radius: var(--rex-radius-field);
  color: rgb(var(--ink));
  font-family: var(--rex-font);
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}
.rex-input::placeholder,
.rex-textarea::placeholder { color: rgb(var(--ink-muted) / 0.7); }

.rex-input:focus,
.rex-select:focus,
.rex-textarea:focus {
  border-color: rgb(var(--brand-purple));
  outline: none;
}

.rex-textarea { resize: vertical; min-height: 120px; }

.rex-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* ---------------------------------------------------------------- LABELS -- */
.rex-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--rex-radius-pill);
  font-size: 0.6875rem;
  font-weight: 500;
  background: rgb(var(--brand-purple) / 0.15);
  color: rgb(var(--brand-purple));
}
.rex-badge-blue  { background: rgb(var(--brand-blue) / 0.15);  color: rgb(var(--brand-blue)); }
.rex-badge-ok    { background: rgb(var(--state-ok) / 0.15);    color: rgb(var(--state-ok)); }
.rex-badge-warn  { background: rgb(var(--state-warn) / 0.15);  color: rgb(var(--state-warn)); }
.rex-badge-error { background: rgb(var(--state-error) / 0.15); color: rgb(var(--state-error)); }

/* ---------------------------------------------------------------- TABEL -- */
.rex-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgb(var(--surface-line));
  border-radius: var(--rex-radius-card);
  overflow: hidden;
}
.rex-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--ink));
  background: rgb(var(--surface-card));
  border-bottom: 1px solid rgb(var(--surface-line));
}
.rex-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgb(var(--surface-line) / 0.6);
}
.rex-table tr:last-child td { border-bottom: none; }
.rex-table tbody tr:nth-child(even) { background: rgb(var(--surface-card) / 0.4); }

/* ------------------------------------------------------------- VOORTGANG -- */
.rex-progress {
  width: 100%;
  height: 4px;
  border-radius: var(--rex-radius-pill);
  background: rgb(var(--surface-line));
  overflow: hidden;
}
.rex-progress-bar {
  height: 100%;
  border-radius: var(--rex-radius-pill);
  background: linear-gradient(90deg, rgb(var(--brand-purple)), rgb(var(--brand-blue)));
  transition: width 0.4s ease;
}

/* ------------------------------------------------------------ MELDINGEN -- */
.rex-alert {
  padding: 16px 20px;
  border-radius: var(--rex-radius-field);
  border: 1px solid rgb(var(--surface-line));
  background: rgb(var(--surface-card));
  color: rgb(var(--ink-muted));
}
.rex-alert-error {
  border-color: rgb(var(--state-error) / 0.4);
  background: rgb(var(--state-error) / 0.1);
  color: rgb(var(--state-error));
}
.rex-alert-ok {
  border-color: rgb(var(--state-ok) / 0.4);
  background: rgb(var(--state-ok) / 0.1);
  color: rgb(var(--state-ok));
}

/* ---------------------------------------------------------------- DIVERS -- */
.rex-divider { height: 1px; background: rgb(var(--surface-line)); border: none; margin: 32px 0; }

.rex-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgb(var(--surface-line));
  border-top-color: rgb(var(--brand-purple));
  border-radius: 50%;
  animation: rex-spin 0.7s linear infinite;
}
@keyframes rex-spin { to { transform: rotate(360deg); } }

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