/* ============================================================
   TADWERA DESIGN SYSTEM — components.css
   Layer 2: Atom Components
   Rule: All values from Component Tokens → Semantic Tokens
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    border-color     var(--duration-fast) var(--ease-default),
    color            var(--duration-fast) var(--ease-default),
    box-shadow       var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

/* Sizes */
.btn-xs  { height: 24px; padding: 0 var(--space-2); font-size: var(--text-xs); border-radius: var(--radius-sm); gap: var(--space-1); }
.btn-sm  { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-md  { height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn-lg  { height: 40px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-xl  { height: 48px; padding: 0 var(--space-6); font-size: var(--text-base); }

/* Default size */
.btn:not(.btn-xs):not(.btn-sm):not(.btn-lg):not(.btn-xl) {
  height: 36px;
  padding: 0 var(--space-4);
}

/* Primary */
.btn-primary {
  background: hsl(var(--btn-primary-bg));
  color: hsl(var(--btn-primary-text));
  border-color: hsl(var(--btn-primary-border));
}
.btn-primary:hover:not(:disabled) {
  background: hsl(var(--btn-primary-bg-hover));
  border-color: hsl(var(--btn-primary-bg-hover));
  color: hsl(var(--btn-primary-text));
  text-decoration: none;
}

/* Landing pages: primary CTA links must not inherit typography.css `a:hover` (brand-colored text on brand fill). */
.lp-btn-primary:hover {
  color: hsl(var(--btn-primary-text));
  text-decoration: none;
}

/* Secondary */
.btn-secondary {
  background: hsl(var(--btn-secondary-bg));
  color: hsl(var(--btn-secondary-text));
  border-color: hsl(var(--btn-secondary-border));
}
.btn-secondary:hover:not(:disabled) {
  background: hsl(var(--btn-secondary-bg-hover));
  border-color: hsl(var(--btn-secondary-border-hover));
}

/* Outline */
.btn-outline {
  background: hsl(var(--btn-outline-bg));
  color: hsl(var(--btn-outline-text));
  border-color: hsl(var(--btn-outline-border));
}
.btn-outline:hover:not(:disabled) {
  background: hsl(var(--btn-outline-bg-hover));
}

/* Ghost */
.btn-ghost {
  background: hsl(var(--btn-ghost-bg));
  color: hsl(var(--btn-ghost-text));
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: hsl(var(--btn-ghost-bg-hover));
  color: hsl(var(--foreground));
}

/* Destructive */
.btn-destructive {
  background: hsl(var(--btn-destructive-bg));
  color: hsl(var(--btn-destructive-text));
  border-color: hsl(var(--btn-destructive-border));
}
.btn-destructive:hover:not(:disabled) {
  background: hsl(var(--btn-destructive-bg-hover));
}

/* Icon button */
.btn-icon { padding: 0; width: 36px; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-lg { width: 40px; }

/* Block */
.btn-block { width: 100%; }

/* ============================================================
   INPUTS
   ============================================================ */
.input-wrapper { display: flex; flex-direction: column; gap: var(--space-2); }

/* ============================================================
   ICONS
   ============================================================ */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  background: hsl(var(--bg-surface-200));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box svg {
  width: 24px;
  height: 24px;
  stroke: hsl(var(--brand));
  stroke-width: 1.5;
  fill: none;
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: hsl(var(--foreground-light));
}

.input-label .required { color: hsl(var(--destructive)); margin-inline-start: 2px; }

.input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: hsl(var(--input-text));
  background: hsl(var(--input-bg));
  border: var(--border-width) solid hsl(var(--input-border));
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow   var(--duration-fast) var(--ease-default);
}
.input::placeholder { color: hsl(var(--input-placeholder)); }
.input:hover:not(:disabled):not(:focus) {
  border-color: hsl(var(--border-strong));
}
.input:focus {
  border-color: hsl(var(--input-focus-border));
  box-shadow: 0 0 0 3px hsl(var(--input-focus-ring) / 0.15);
}
.input:disabled {
  background: hsl(var(--input-disabled-bg));
  color: hsl(var(--input-disabled-text));
  cursor: not-allowed;
}
.input.input-error {
  border-color: hsl(var(--destructive));
}
.input.input-error:focus {
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.15);
}

/* Sizes */
.input-sm { height: 30px; font-size: var(--text-xs); padding: 0 var(--space-2); }
.input-lg { height: 42px; font-size: var(--text-base); }

/* With icon */
.input-with-icon { position: relative; }
.input-with-icon .input { padding-inline-start: 36px; }
.input-with-icon .input-icon {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: var(--space-3);
  transform: translateY(-50%);
  color: hsl(var(--foreground-muted));
  pointer-events: none;
  width: 16px; height: 16px;
}

/* Search Input */
.input-search { padding-inline-start: 36px; }

/* Hint / Error text */
.input-hint  { font-size: var(--text-xs); color: hsl(var(--foreground-muted)); }
.input-error-text { font-size: var(--text-xs); color: hsl(var(--destructive)); }

/* ── Textarea ────────────────────────────────────────────── */
.textarea {
  width: 100%;
  min-height: 96px;
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: hsl(var(--input-text));
  background: hsl(var(--input-bg));
  border: var(--border-width) solid hsl(var(--input-border));
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow   var(--duration-fast) var(--ease-default);
}
.textarea::placeholder { color: hsl(var(--input-placeholder)); }
.textarea:focus {
  border-color: hsl(var(--input-focus-border));
  box-shadow: 0 0 0 3px hsl(var(--input-focus-ring) / 0.15);
}

/* ── Select ──────────────────────────────────────────────── */
.select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 36px;
  padding: 0 var(--space-8) 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: hsl(var(--input-text));
  background: hsl(var(--input-bg));
  border: var(--border-width) solid hsl(var(--input-border));
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  transition: border-color var(--duration-fast) var(--ease-default);
}
.select:focus {
  border-color: hsl(var(--input-focus-border));
  box-shadow: 0 0 0 3px hsl(var(--input-focus-ring) / 0.15);
}
[dir="rtl"] .select {
  background-position: left var(--space-3) center;
  padding: 0 var(--space-3) 0 var(--space-8);
}

/* ── Checkbox ────────────────────────────────────────────── */
.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}
.checkbox {
  width: 16px; height: 16px;
  border: var(--border-width) solid hsl(var(--border-control));
  border-radius: var(--radius-sm);
  background: hsl(var(--input-bg));
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: all var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}
.checkbox:checked {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
}
.checkbox:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8l3 3 6-6' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.checkbox:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}
.checkbox-label { font-size: var(--text-sm); color: hsl(var(--foreground-light)); }

/* ── Radio ───────────────────────────────────────────────── */
.radio {
  width: 16px; height: 16px;
  border: var(--border-width) solid hsl(var(--border-control));
  border-radius: var(--radius-full);
  background: hsl(var(--input-bg));
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: all var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}
.radio:checked {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
}
.radio:checked::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: white;
  border-radius: var(--radius-full);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.radio:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

/* ── Switch ──────────────────────────────────────────────── */
.switch {
  position: relative;
  width: 36px; height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute;
  inset: 0;
  background: hsl(var(--border-strong));
  border-radius: var(--radius-full);
  transition: background var(--duration-normal) var(--ease-default);
}
.switch input:checked ~ .switch-track { background: hsl(var(--brand)); }
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal) var(--ease-spring);
  box-shadow: var(--shadow-xs);
}
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible ~ .switch-track {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  border: var(--border-width) solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-default {
  background: hsl(var(--badge-default-bg));
  color: hsl(var(--badge-default-text));
  border-color: hsl(var(--border-muted));
}
.badge-brand {
  background: hsl(var(--badge-brand-bg));
  color: hsl(var(--badge-brand-text));
}
.badge-destructive {
  background: hsl(var(--badge-destructive-bg));
  color: hsl(var(--badge-destructive-text));
}
.badge-warning {
  background: hsl(var(--badge-warning-bg));
  color: hsl(var(--badge-warning-text));
}
.badge-outline {
  background: transparent;
  color: hsl(var(--foreground-light));
  border-color: hsl(var(--border));
}
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: var(--border-width) solid;
  font-size: var(--text-sm);
}
.alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: var(--weight-medium); margin-bottom: 2px; }
.alert-description { opacity: 0.85; line-height: var(--leading-relaxed); }

.alert-info {
  background: hsl(var(--bg-surface-100));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground-light));
}
.alert-success {
  background: hsl(var(--brand-200));
  border-color: hsl(var(--brand-400));
  color: hsl(var(--brand-600));
}
.alert-warning {
  background: hsl(var(--warning-200));
  border-color: hsl(var(--warning-400));
  color: hsl(var(--warning-600));
}
.alert-destructive {
  background: hsl(var(--destructive-200));
  border-color: hsl(var(--destructive-400));
  color: hsl(var(--destructive-600));
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: hsl(var(--card-bg));
  border: var(--border-width) solid hsl(var(--card-border));
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: var(--border-width) solid hsl(var(--border-muted));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: hsl(var(--foreground));
}
.card-description {
  font-size: var(--text-sm);
  color: hsl(var(--foreground-muted));
  margin-top: var(--space-1);
}
.card-body  { padding: var(--space-5) var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: var(--border-width) solid hsl(var(--border-muted));
  background: hsl(var(--bg-surface-200));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.card-hover {
  transition: border-color var(--duration-normal) var(--ease-default),
              box-shadow   var(--duration-normal) var(--ease-default);
  cursor: pointer;
}
.card-hover:hover {
  border-color: hsl(var(--border-strong));
  box-shadow: var(--shadow-md);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; flex-direction: column; }
.tabs-list {
  display: flex;
  border-bottom: var(--border-width) solid hsl(var(--border-muted));
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-list::-webkit-scrollbar { display: none; }
.tab-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: hsl(var(--tab-inactive-text));
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
  margin-bottom: -1px;
  font-family: var(--font-sans);
}
.tab-trigger:hover { color: hsl(var(--foreground-light)); }
.tab-trigger.active {
  color: hsl(var(--tab-active-text));
  border-bottom-color: hsl(var(--tab-active-border));
}
.tab-content { padding: var(--space-6) 0; display: none; }
.tab-content.active { display: block; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: var(--border-width) solid hsl(var(--border)); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table thead { background: hsl(var(--table-header-bg)); }
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  font-weight: var(--weight-medium);
  color: hsl(var(--foreground-muted));
  border-bottom: var(--border-width) solid hsl(var(--table-border));
  white-space: nowrap;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.table td {
  padding: var(--space-3) var(--space-4);
  color: hsl(var(--foreground-light));
  border-bottom: var(--border-width) solid hsl(var(--table-border));
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { background: hsl(var(--table-row-bg)); }
.table tbody tr:hover { background: hsl(var(--table-row-hover-bg)); }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  flex-wrap: wrap;
}
.breadcrumb-item { display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb-link { color: hsl(var(--foreground-muted)); text-decoration: none; transition: color var(--duration-fast); }
.breadcrumb-link:hover { color: hsl(var(--foreground)); }
.breadcrumb-separator { color: hsl(var(--foreground-muted)); }
.breadcrumb-current { color: hsl(var(--foreground)); font-weight: var(--weight-medium); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; gap: var(--space-1); }
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: var(--border-width) solid hsl(var(--border));
  background: hsl(var(--bg-button));
  color: hsl(var(--foreground-light));
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: var(--font-sans);
}
.pagination-btn:hover { border-color: hsl(var(--border-strong)); color: hsl(var(--foreground)); }
.pagination-btn.active {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
  color: white;
}
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-ellipsis {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--foreground-muted));
  font-size: var(--text-sm);
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  inset-inline-start: 0;
  min-width: 180px;
  background: hsl(var(--bg-dialog));
  border: var(--border-width) solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: var(--z-dropdown);
  display: none;
  animation: dropdownIn var(--duration-normal) var(--ease-out);
}
.dropdown-menu.open { display: block; }
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: hsl(var(--foreground-light));
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: start;
  font-family: var(--font-sans);
  transition: background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}
.dropdown-item:hover {
  background: hsl(var(--bg-surface-200));
  color: hsl(var(--foreground));
}
.dropdown-item.destructive { color: hsl(var(--destructive)); }
.dropdown-item.destructive:hover { background: hsl(var(--destructive-200)); }
.dropdown-separator {
  height: 1px;
  background: hsl(var(--border-muted));
  margin: var(--space-1) 0;
}
.dropdown-label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: hsl(var(--foreground-muted));
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: var(--weight-semibold);
  overflow: hidden;
  flex-shrink: 0;
  background: hsl(var(--brand-200));
  color: hsl(var(--brand-600));
}
.avatar-sm  { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-md  { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-lg  { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-xl  { width: 48px; height: 48px; font-size: var(--text-lg); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    hsl(var(--bg-surface-200)) 25%,
    hsl(var(--bg-surface-300)) 50%,
    hsl(var(--bg-surface-200)) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   SEPARATOR
   ============================================================ */
.separator {
  height: 1px;
  background: hsl(var(--border-muted));
  border: none;
  margin: 0;
}
.separator-vertical {
  width: 1px;
  height: 100%;
  background: hsl(var(--border-muted));
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip-wrapper { position: relative; display: inline-flex; }
.tooltip {
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--scale-1100));
  color: hsl(var(--scale-100));
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-md);
}
.tooltip-wrapper:hover .tooltip { opacity: 1; }

/* ============================================================
   DOCS — Component preview blocks
   ============================================================ */
.component-preview {
  border: var(--border-width) solid hsl(var(--border));
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.preview-area {
  padding: var(--space-10) var(--space-8);
  background: hsl(var(--bg-alternative));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  min-height: 120px;
}
.preview-code {
  background: hsl(var(--code-block-1));
  border-top: var(--border-width) solid hsl(var(--border-muted));
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: hsl(var(--foreground-light));
  overflow-x: auto;
}
.preview-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: hsl(var(--foreground-muted));
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-2) var(--space-5);
  background: hsl(var(--bg-surface-200));
  border-top: var(--border-width) solid hsl(var(--border-muted));
}

/* Component group header */
.component-group { margin-bottom: var(--space-12); }
.component-group-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
}
.component-group-desc {
  font-size: var(--text-sm);
  color: hsl(var(--foreground-muted));
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}

/* Variant row */
.variant-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ============================================================
   LANDING — footer CTA + link grid (index + subpages)
   ============================================================ */
.footer-cta-inner {
  text-align: center;
  padding-bottom: clamp(64px, 8vw, 96px);
  border-bottom: var(--border-width) solid hsl(var(--border-muted));
  position: relative;
}

.footer-cta-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(
    ellipse,
    hsl(var(--brand) / 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.footer-cta-content {
  position: relative;
  z-index: 1;
}

.footer-cta-title {
  margin-bottom: var(--space-4);
}

.footer-cta-sub {
  font-size: var(--text-base);
  color: hsl(var(--foreground-muted));
  margin-bottom: var(--space-9);
}

.footer-cta-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links-section {
  padding: var(--space-12) 0 var(--space-9);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-10);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 14px;
}

.footer-logo-mark {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
  color: inherit;
}

.footer-logo-mark img {
  height: 32px;
  width: auto;
  max-height: 32px;
  display: block;
  object-fit: contain;
}

[data-theme="light"] .footer-logo-mark img {
  filter: brightness(0) saturate(100%);
}

.footer-tagline {
  font-size: 0.8rem;
  color: hsl(var(--foreground-muted));
  line-height: var(--leading-normal);
  max-width: 220px;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--foreground-light));
  margin-bottom: 14px;
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-links a {
  font-size: 0.825rem;
  color: hsl(var(--foreground-light));
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-col-links a:hover {
  color: hsl(var(--foreground));
}

.footer-bottom {
  border-top: var(--border-width) solid hsl(var(--border-muted));
  margin-top: var(--space-8);
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-copy {
  font-size: var(--text-xs);
  color: hsl(var(--foreground-muted));
}

.footer-badges {
  display: flex;
  gap: var(--space-2);
}

.footer-brand-col .footer-badges {
  margin-top: var(--space-4);
}

.footer-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: var(--weight-semibold);
  background: hsl(var(--bg-surface-200));
  color: hsl(var(--foreground-muted));
  border: var(--border-width) solid hsl(var(--border-muted));
}

.footer-badge-green {
  background: hsl(var(--brand) / 0.1);
  color: hsl(var(--brand));
  border-color: hsl(var(--brand) / 0.2);
}

.footer-lang-switch {
  display: flex;
  gap: var(--space-4);
}

.footer-lang-switch a {
  font-size: var(--text-xs);
  color: hsl(var(--foreground-muted));
  text-decoration: none;
  cursor: pointer;
}

.footer-lang-switch a:hover {
  color: hsl(var(--foreground));
}

/* ── Icon Box — Unified card/section icon container ────────── */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  background: hsl(var(--bg-surface-200));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box svg {
  width: 24px;
  height: 24px;
  stroke: hsl(var(--brand));
  stroke-width: 1.5;
  fill: none;
}

/* Light theme: slightly stronger background for contrast */
[data-theme="light"] .icon-box {
  background: hsl(var(--bg-surface-300));
}

/* Resources page — card status badges (chained for specificity over page inline .res-card-badge) */
.res-card-badge.res-card-badge-green {
  background: hsl(var(--brand-200));
  color: hsl(var(--brand-600));
  border: 1px solid hsl(var(--brand-400));
}
.res-card-badge.res-card-badge-warning {
  background: hsl(var(--warning-200));
  color: hsl(var(--warning-600));
  border: 1px solid hsl(var(--warning-400));
}
.res-card-badge.res-card-badge-destructive {
  background: hsl(var(--destructive-200));
  color: hsl(var(--destructive-600));
  border: 1px solid hsl(var(--destructive-400));
}