/* ============================================================
   Witivio Design System 2026 v3 — Components
   Only includes the components used by Agent Control Pro.
   ============================================================ */

/* ── Typography helpers ── */
.w-heading-hero {
  font-size: var(--w-font-5xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.w-heading-1 {
  font-size: var(--w-font-4xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}
.w-heading-2 {
  font-size: var(--w-font-3xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.w-heading-3 {
  font-size: var(--w-font-2xl);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.w-heading-4 {
  font-size: var(--w-font-xl);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.w-body-large {
  font-size: var(--w-font-lg);
  font-weight: 400;
  line-height: 1.5;
}
.w-body-default {
  font-size: var(--w-font-base);
  font-weight: 400;
  line-height: 1.6;
  max-width: 65ch;
}
.w-body-small {
  font-size: var(--w-font-sm);
  font-weight: 400;
  line-height: 1.5;
}
.w-text-muted { color: var(--w-text-muted); }
.w-text-secondary { color: var(--w-text-secondary); }

.w-text-gradient {
  background: linear-gradient(135deg, var(--w-primary), var(--w-mauve));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Eyebrow / micro-label (uppercase metadata) */
.w-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-primary);
  margin: 0 0 var(--w-space-3);
}
.w-eyebrow--teal { color: var(--w-teal); }

/* ── Brand mark ── */
.w-brand {
  font-family: var(--w-font-primary);
  font-weight: 800;
  font-size: var(--w-font-xl);
  letter-spacing: -0.01em;
  color: var(--w-text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.w-brand__io { color: var(--w-primary); }
.w-brand--inverse { color: var(--w-white); }
.w-brand__sub {
  display: inline-block;
  margin-left: var(--w-space-3);
  padding-left: var(--w-space-3);
  border-left: 1px solid var(--w-border-light);
  font-weight: 600;
  font-size: var(--w-font-sm);
  color: var(--w-text-secondary);
  letter-spacing: 0;
}
.w-brand--inverse + .w-brand__sub,
.w-brand--inverse .w-brand__sub {
  color: rgba(255, 255, 255, 0.7);
  border-left-color: rgba(255, 255, 255, 0.15);
}

/* ── Buttons ── */
.w-btn-primary,
.w-btn-secondary,
.w-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--w-space-2);
  font-family: var(--w-font-primary);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--w-radius-md);
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.15s ease;
}

.w-btn-primary {
  background: linear-gradient(135deg, var(--w-primary), var(--w-spacecadet));
  color: var(--w-white);
  border: 2px solid transparent;
  padding: 14px 28px;
}
.w-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--w-shadow-glow);
}
.w-btn-primary:focus-visible {
  outline: 2px solid var(--w-primary);
  outline-offset: 2px;
}

.w-btn-primary--dark {
  background: var(--w-white);
  color: var(--w-primary);
}
.w-btn-primary--dark:hover {
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.25);
}

.w-btn-secondary {
  background: transparent;
  color: var(--w-primary);
  border: 2px solid var(--w-primary);
  padding: 12px 26px;
}
.w-btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: var(--w-shadow-brand);
}
.w-btn-secondary--dark {
  color: var(--w-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.w-btn-ghost {
  background: none;
  color: var(--w-primary);
  border: none;
  padding: 8px 4px;
  font-size: 14px;
  min-height: auto;
}
.w-btn-ghost:hover { transform: translateX(4px); }
.w-btn-ghost--inverse { color: rgba(255, 255, 255, 0.85); }
.w-btn-ghost--inverse:hover { color: var(--w-white); }

.w-btn--sm { font-size: 13px; padding: 8px 16px; min-height: 36px; }
.w-btn--md { font-size: 15px; padding: 12px 24px; }
.w-btn--lg { font-size: 17px; padding: 16px 32px; min-height: 52px; }

/* ── Cards ── */
.w-card {
  background: var(--w-bg-primary);
  border: 1px solid var(--w-border-light);
  border-radius: var(--w-radius-2xl);
  padding: var(--w-space-8);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.w-card--secondary {
  background: var(--w-bg-secondary);
  border-color: transparent;
}
.w-card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--w-shadow-brand);
}
.w-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-primary);
  margin: 0 0 var(--w-space-3);
}
.w-card__title {
  font-size: var(--w-font-xl);
  font-weight: 700;
  color: var(--w-text-primary);
  margin: 0 0 var(--w-space-2);
}
.w-card__body {
  font-size: var(--w-font-sm);
  color: var(--w-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Forms ── */
.w-input,
.w-input[type="file"] {
  width: 100%;
  font-family: var(--w-font-primary);
  font-size: 15px;
  padding: 12px 16px;
  border: 1px solid var(--w-border-default);
  border-radius: var(--w-radius-md);
  background: var(--w-bg-primary);
  color: var(--w-text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.w-input:focus,
.w-input:focus-visible {
  border-color: var(--w-primary);
  box-shadow: 0 0 0 3px rgba(144, 49, 99, 0.1);
}
.w-input--success { border: 2px solid var(--w-success); }
.w-input--error   { border: 2px solid var(--w-error); }
.w-input:disabled,
.w-input--disabled {
  background: var(--w-bg-secondary);
  color: var(--w-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.w-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--w-text-primary);
  margin-bottom: 6px;
}
.w-helper      { font-size: 12px; color: var(--w-text-muted); margin-top: 4px; }
.w-error-text  { font-size: 12px; color: var(--w-error);      margin-top: 4px; }
.w-success-text{ font-size: 12px; color: var(--w-success);    margin-top: 4px; }

input[type="checkbox"],
input[type="radio"] { accent-color: var(--w-primary); }

.w-form {
  display: flex;
  flex-direction: column;
  gap: var(--w-space-3);
  max-width: 560px;
}

/* ── Badges ── */
.w-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--w-radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.w-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.w-badge--primary { background: var(--w-primary-50);                    color: var(--w-primary); }
.w-badge--teal    { background: rgba(0, 128, 128, 0.12);                color: var(--w-teal); }
.w-badge--muted   { background: rgba(113, 105, 136, 0.12);              color: var(--w-text-muted); }
.w-badge--dark    { background: var(--w-bg-dark);                       color: var(--w-white); }

/* ── Toasts / Alerts ── */
.w-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--w-radius-lg);
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  border-left: 3px solid;
  margin: var(--w-space-4) 0;
  line-height: 1.5;
}
.w-toast a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}
.w-toast--success { background: rgba(0, 128, 128, 0.08);   color: #006666; border-color: var(--w-success); }
.w-toast--error   { background: rgba(212, 64, 64, 0.06);   color: #B33030; border-color: var(--w-error); }
.w-toast--warning { background: rgba(232, 168, 56, 0.08);  color: #8B6520; border-color: var(--w-warning); }
.w-toast--info    { background: rgba(56, 179, 194, 0.08);  color: #2A8A96; border-color: var(--w-info); }

/* ── Avatar ── */
.w-avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--w-white);
  background: linear-gradient(135deg, var(--w-primary), var(--w-spacecadet));
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
}
.w-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.w-avatar--md { width: 40px; height: 40px; font-size: 14px; }
.w-avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.w-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Header / Nav (light variant for in-app pages) ── */
.w-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--w-header-height);
  display: flex;
  align-items: center;
  gap: var(--w-space-6);
  padding: 0 var(--w-space-6);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--w-border-light);
}
.w-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-3);
  text-decoration: none;
}
.w-nav {
  display: flex;
  flex: 1;
  gap: var(--w-space-2);
  flex-wrap: wrap;
}
.w-nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--w-text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--w-radius-md);
  transition: color 0.15s ease, background 0.15s ease;
}
.w-nav__link:hover { color: var(--w-primary); background: var(--w-primary-50); }
.w-nav__link.is-active { color: var(--w-primary); background: var(--w-primary-50); }
.w-nav__link:focus-visible { outline: 2px solid var(--w-primary); outline-offset: 2px; }

.w-header__user {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-3);
  font-size: 13px;
  color: var(--w-text-secondary);
}
.w-header__user-name { font-weight: 600; color: var(--w-text-primary); }

/* ── Footer ── */
.w-footer {
  padding: var(--w-space-6) var(--w-space-6);
  text-align: center;
  font-size: 12px;
  color: var(--w-text-muted);
  border-top: 1px solid var(--w-border-light);
  margin-top: var(--w-space-12);
}
.w-footer code {
  font-family: var(--w-font-mono);
  background: var(--w-bg-secondary);
  padding: 2px 6px;
  border-radius: var(--w-radius-sm);
  font-size: 11px;
  color: var(--w-text-secondary);
}

/* ── Page container ── */
.w-page {
  display: flex;
  flex-direction: column;
  gap: var(--w-space-6);
}
.w-page-header {
  display: flex;
  flex-direction: column;
  gap: var(--w-space-2);
  margin-bottom: var(--w-space-2);
}
.w-page-header__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-primary);
  margin: 0;
}

/* ── Table ── */
.w-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: var(--w-bg-primary);
  border: 1px solid var(--w-border-light);
  border-radius: var(--w-radius-lg);
  overflow: hidden;
}
.w-table th,
.w-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--w-border-light);
  text-align: left;
  vertical-align: top;
}
.w-table thead th {
  background: var(--w-bg-secondary);
  font-weight: 700;
  color: var(--w-text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.w-table tbody tr:last-child td { border-bottom: none; }
.w-table tbody tr:hover { background: var(--w-primary-50); }
.w-table .w-table__sub {
  display: block;
  font-family: var(--w-font-mono);
  font-size: 11px;
  color: var(--w-text-muted);
  margin-top: 2px;
}

/* ── Login splash ── */
.w-login-body {
  margin: 0;
  font-family: var(--w-font-primary);
  background: var(--w-bg-hero);
  color: var(--w-text-inverse);
  min-height: 100vh;
}
.w-login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--w-space-10) var(--w-space-6);
  background:
    radial-gradient(circle at 20% 20%, rgba(144, 49, 99, 0.25), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(46, 41, 81, 0.4), transparent 55%),
    var(--w-bg-hero);
}
.w-login-card {
  width: 100%;
  max-width: 540px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--w-space-6);
}
.w-login-card__brand {
  font-size: var(--w-font-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--w-white);
}
.w-login-card__brand .w-brand__io { color: var(--w-primary); }
.w-login-card__brand-sub {
  display: block;
  margin-top: var(--w-space-2);
  font-size: var(--w-font-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.w-login-card__title {
  font-size: var(--w-font-4xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--w-white);
}
.w-login-card__lead {
  font-size: var(--w-font-base);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin: 0;
  max-width: 44ch;
}
.w-login-card__footnote {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  max-width: 44ch;
}
.w-login-card__footnote code {
  font-family: var(--w-font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: var(--w-radius-sm);
  color: rgba(255, 255, 255, 0.75);
}
.w-login-card .w-toast {
  width: 100%;
  text-align: left;
}

/* ── Utilities ── */
.w-row { display: flex; gap: var(--w-space-4); }
.w-col { display: flex; flex-direction: column; gap: var(--w-space-4); }
.w-mt-2 { margin-top: var(--w-space-2); }
.w-mt-4 { margin-top: var(--w-space-4); }
.w-mt-6 { margin-top: var(--w-space-6); }
.w-mt-8 { margin-top: var(--w-space-8); }
