/* ============================================================================
 * SmartAEO — shared component layer. Token-driven primitives reused by both the
 * marketing site and the app (app.[name].com). Link AFTER design-system.css.
 * Values mirror the design handoff's components/* 1:1.
 * ========================================================================== */

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

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- icon helper (Lucide) ---------- */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.ic svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke-width: 2;
}
.ic--bold svg {
  stroke-width: 3;
}

/* ---------- logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--logo, 30px) * 0.32);
}
.logo svg {
  width: var(--logo, 30px);
  height: var(--logo, 30px);
  display: block;
  flex-shrink: 0;
}
.logo__img {
  width: var(--logo, 30px);
  height: var(--logo, 30px);
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.logo__word {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: calc(var(--logo, 30px) * 0.62);
  letter-spacing: -0.03em;
  color: #0a2540;
}
.logo--light .logo__word {
  color: #fff;
}
/* "AEO" highlight inside the SmartAEO wordmark — the brand color. */
.logo__brand {
  color: var(--primary-500);
}
.logo--light .logo__brand {
  color: var(--accent-500);
}
.logo__dot {
  color: var(--secondary-500);
}

/* ---------- button ---------- */
.btn {
  --_bg: var(--primary-500);
  --_bgh: var(--primary-600);
  --_fg: #fff;
  --_bd: transparent;
  --_sh: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--_bd);
  border-radius: var(--radius-lg);
  background: var(--_bg);
  color: var(--_fg);
  box-shadow: var(--_sh);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform var(--dur-fast) var(--ease-standard),
    background var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}
.btn:hover {
  background: var(--_bgh);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn--sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
}
.btn--md {
  height: 2.5rem;
  padding: 0 1.125rem;
  font-size: 0.9375rem;
}
.btn--lg {
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 1rem;
}
.btn--primary {
  --_bg: var(--primary-500);
  --_bgh: var(--primary-600);
  --_sh: var(--shadow-brand);
}
.btn--primary:hover {
  box-shadow: 0 18px 44px -12px rgb(27 100 162 / 0.55);
}
.btn--secondary {
  --_bg: rgb(var(--surface-1));
  --_bgh: rgb(var(--surface-2));
  --_fg: var(--primary-700);
  --_bd: rgb(var(--border-strong));
  --_sh: var(--shadow-sm);
}
.btn--ghost {
  --_bg: transparent;
  --_bgh: rgb(var(--surface-3));
  --_fg: rgb(var(--text-strong));
}
.btn--ghost:hover {
  transform: none;
}
.btn--bronze {
  --_bg: var(--secondary-500);
  --_bgh: var(--secondary-600);
  --_sh: 0 14px 34px -14px rgb(194 135 72 / 0.5);
}
.btn--full {
  width: 100%;
}
.btn .ic {
  width: 18px;
  height: 18px;
}
.btn--sm .ic {
  width: 16px;
  height: 16px;
}

/* ---------- badge (soft tints) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge .ic {
  width: 13px;
  height: 13px;
}
.badge--primary {
  background: var(--primary-50);
  color: var(--primary-700);
}
.badge--bronze {
  background: var(--secondary-50);
  color: var(--secondary-700);
}
.badge--accent {
  background: var(--accent-100);
  color: var(--accent-700);
}
.badge--success {
  background: var(--success-50);
  color: var(--success-700);
}
.badge--warning {
  background: var(--warning-50);
  color: var(--warning-700);
}
.badge--danger {
  background: var(--danger-50);
  color: var(--danger-700);
}
.badge--neutral {
  background: rgb(var(--surface-3));
  color: rgb(var(--text-strong));
}

/* ---------- tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 1.875rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  background: rgb(var(--surface-1));
  color: rgb(var(--text-strong));
  border: 1px solid rgb(var(--border-subtle));
  white-space: nowrap;
}
.tag--active {
  background: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-200);
}
.tag__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- engine pill ---------- */
.engine {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.75rem 0 0.375rem;
  border-radius: var(--radius-full);
  background: rgb(var(--surface-1));
  border: 1px solid rgb(var(--border-subtle));
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--text-strong));
  white-space: nowrap;
}
.engine__initial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
}
.engine__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.engine__dot--cited {
  background: var(--success-500);
}
.engine__dot--tracking {
  background: var(--accent-500);
}
.engine__dot--missing {
  background: var(--danger-500);
}

/* ---------- stat card ---------- */
.stat-card {
  background: rgb(var(--surface-1));
  border: 1px solid rgb(var(--border-subtle));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--text-muted));
}
.stat-card__icon {
  color: var(--accent-600);
  display: inline-flex;
  width: 16px;
  height: 16px;
}
.stat-card__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.stat-card__value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.875rem;
  letter-spacing: -0.02em;
  color: rgb(var(--text-strong));
  font-feature-settings: "tnum" 1;
}
.stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--success-50);
  color: var(--success-700);
}
.stat-card__delta--danger {
  background: var(--danger-50);
  color: var(--danger-700);
}
.stat-card__sub {
  font-size: 0.75rem;
  color: rgb(var(--text-muted));
}

/* ---------- input / field ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-family: var(--font-sans);
}
.field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--text-strong));
}
.field__hint {
  font-size: 0.75rem;
  color: rgb(var(--text-muted));
}
.input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  background: rgb(var(--surface-1));
  color: rgb(var(--text-strong));
  border: 1px solid rgb(var(--border-strong));
  border-radius: var(--radius-lg);
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}
.input:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgb(var(--focus-ring) / 0.55);
}
.input .ic {
  width: 18px;
  height: 18px;
  color: rgb(var(--text-muted));
}
.input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: inherit;
}
.input input::placeholder {
  color: rgb(var(--text-muted));
}

/* ---------- segmented tabs ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgb(var(--surface-3));
  border-radius: var(--radius-full);
}
.tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 2.25rem;
  padding: 0 1rem;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  color: rgb(var(--text-muted));
  transition: all var(--dur-fast) var(--ease-standard);
}
.tabs__btn--active {
  background: rgb(var(--surface-1));
  color: var(--primary-700);
  box-shadow: var(--shadow-sm);
}

/* ---------- avatar ---------- */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

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