/* ==========================================================================
   CoTrackPro Brand System
   Shared design tokens for the CoTrackPro ecosystem
   https://cotrackpro.com
   ========================================================================== */

/* ── Color Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Brand — Sky Blue */
  --ctp-brand-50:  #f0f9ff;
  --ctp-brand-100: #e0f2fe;
  --ctp-brand-200: #bae6fd;
  --ctp-brand-300: #7dd3fc;
  --ctp-brand-400: #38bdf8;
  --ctp-brand-500: #0ea5e9;
  --ctp-brand-600: #0284c7;
  --ctp-brand-700: #0369a1;
  --ctp-brand-800: #075985;
  --ctp-brand-900: #0c4a6e;

  /* Navy — Background */
  --ctp-navy-800: #1e293b;
  --ctp-navy-850: #151f2e;
  --ctp-navy-900: #0f172a;
  --ctp-navy-950: #0a0f1e;

  /* Gold — Accent */
  --ctp-gold-300: #fde68a;
  --ctp-gold-400: #fbbf24;
  --ctp-gold-500: #f59e0b;

  /* Slate — Text */
  --ctp-text-primary:   #f9fafb;
  --ctp-text-secondary: #e2e8f0;
  --ctp-text-muted:     #94a3b8;

  /* Semantic */
  --ctp-success: #22c55e;
  --ctp-warning: #f59e0b;
  --ctp-danger:  #ef4444;
  --ctp-info:    #0ea5e9;

  /* Surface */
  --ctp-surface-0: #0a0f1e;
  --ctp-surface-1: #0f172a;
  --ctp-surface-2: #1e293b;
  --ctp-surface-3: #334155;

  /* Border */
  --ctp-border:       rgba(148, 163, 184, 0.15);
  --ctp-border-hover: rgba(148, 163, 184, 0.3);
}

/* ── Base Styles ────────────────────────────────────────────────────────── */
/* All rules live in the `base` cascade layer so component utility classes
   (Tailwind's layered utilities included) always win over these defaults. */
@layer base {
body {
  margin: 0;
  background-color: var(--ctp-surface-0);
  color: var(--ctp-text-secondary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Subtle noise texture (brand signature) ─────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--ctp-text-primary);
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--ctp-brand-400);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ctp-brand-300);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--ctp-surface-3);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--ctp-text-muted);
}

/* ── Focus ring (accessibility) ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ctp-brand-400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Selection ──────────────────────────────────────────────────────────── */
::selection {
  background-color: var(--ctp-brand-500);
  color: white;
}

/* ── Transitions ────────────────────────────────────────────────────────── */
button, a, input, textarea, select {
  transition: all 0.15s ease;
}

/* ── Brand gradient backgrounds ─────────────────────────────────────────── */
.ctp-gradient-hero {
  background: linear-gradient(135deg, var(--ctp-navy-950) 0%, var(--ctp-navy-900) 50%, #0c2d4a 100%);
}

.ctp-gradient-card {
  background: linear-gradient(180deg, var(--ctp-surface-2) 0%, var(--ctp-surface-1) 100%);
  border: 1px solid var(--ctp-border);
  border-radius: 12px;
}

.ctp-gradient-brand {
  background: linear-gradient(135deg, var(--ctp-brand-600) 0%, var(--ctp-brand-500) 50%, var(--ctp-brand-400) 100%);
}

/* ── Brand button ───────────────────────────────────────────────────────── */
.ctp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--ctp-brand-600);
  color: white;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
}

.ctp-btn-primary:hover {
  background: var(--ctp-brand-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ── CoTrackPro badge (for powered-by footer) ───────────────────────────── */
.ctp-powered-by {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--ctp-surface-2);
  border: 1px solid var(--ctp-border);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--ctp-text-muted);
}

.ctp-powered-by::before {
  content: "\2022";
  color: var(--ctp-brand-400);
}

} /* end @layer base */
