/**
 * TrustPass Base Styles
 * ======================
 * CSS reset + sensible html/body defaults built on top of tokens.css.
 * Import AFTER tokens.css, BEFORE components.css.
 *
 * Does NOT touch component-level classes — those live in components.css.
 */

/* ── Font loading ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-variable.woff2') format('woff2');
}

/* ── Modern CSS reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
}

body {
  font-family: var(--tp-font-sans);
  font-size: var(--tp-text-base);
  font-weight: 400;
  line-height: var(--tp-leading-normal);
  color: var(--tp-text-primary);
  background-color: var(--tp-bg-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

/* ── Typography resets ───────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--tp-leading-tight);
  letter-spacing: var(--tp-tracking-tight);
  color: var(--tp-text-primary);
}

h1 { font-size: var(--tp-text-3xl); }
h2 { font-size: var(--tp-text-2xl); }
h3 { font-size: var(--tp-text-xl);  }
h4 { font-size: var(--tp-text-lg);  }
h5 { font-size: var(--tp-text-base); font-weight: 500; }
h6 { font-size: var(--tp-text-sm);   font-weight: 500; }

p {
  line-height: var(--tp-leading-relaxed);
  color: var(--tp-text-primary);
}

a {
  color: var(--tp-text-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--tp-border-focus);
  outline-offset: 2px;
  border-radius: var(--tp-radius-xs);
}

/* ── Lists ───────────────────────────────────────────────────────────────── */
ul, ol {
  list-style: none;
}

/* ── Media ───────────────────────────────────────────────────────────────── */
img, svg, video {
  display: block;
  max-width: 100%;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Focus styles (global fallback — components add their own rings) ──────── */
:focus-visible {
  outline: 2px solid var(--tp-border-focus);
  outline-offset: 2px;
}

/* ── Selection ───────────────────────────────────────────────────────────── */
::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--tp-text-primary);
}

/* ── Scrollbar (Chromium) ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track  { background: var(--tp-bg-dark);    }
::-webkit-scrollbar-thumb  { background: var(--tp-border);     border-radius: var(--tp-radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--tp-text-muted); }

/* ── App shell layout ────────────────────────────────────────────────────── */
.tp-app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.tp-main {
  flex: 1;
  padding: var(--tp-space-6) var(--tp-space-4);
}

.tp-content-wrap {
  max-width: var(--tp-content-max-width);
  margin: 0 auto;
  width: 100%;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.tp-navbar {
  height: var(--tp-navbar-height);
  background: var(--tp-bg-surface);
  border-bottom: 1px solid var(--tp-border);
  display: flex;
  align-items: center;
  padding: 0 var(--tp-space-4);
  gap: var(--tp-space-4);
  position: sticky;
  top: 0;
  z-index: var(--tp-z-overlay);
}

.tp-navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--tp-space-3);
  text-decoration: none;
}

.tp-navbar__logo {
  height: 32px;
  width: auto;
}

.tp-navbar__app-name {
  font-size: var(--tp-text-sm);
  font-weight: 600;
  color: var(--tp-text-muted);
  letter-spacing: var(--tp-tracking-wide);
  text-transform: uppercase;
}

.tp-navbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--tp-space-2);
}

.tp-nav-link {
  font-size: var(--tp-text-sm);
  font-weight: 500;
  color: var(--tp-text-muted);
  padding: var(--tp-space-2) var(--tp-space-3);
  border-radius: var(--tp-radius-md);
  transition: color var(--tp-transition-fast), background var(--tp-transition-fast);
  text-decoration: none;
}

.tp-nav-link:hover,
.tp-nav-link.active {
  color: var(--tp-text-primary);
  background: var(--tp-bg-card);
  text-decoration: none;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ── Utility helpers ─────────────────────────────────────────────────────── */
.tp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.tp-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-text-muted   { color: var(--tp-text-muted);   }
.tp-text-accent  { color: var(--tp-text-accent);  }
.tp-text-pass    { color: var(--tp-signal-pass);   }
.tp-text-fail    { color: var(--tp-signal-fail);   }
.tp-text-pending { color: var(--tp-signal-pending);}

.tp-divider {
  border: none;
  border-top: 1px solid var(--tp-border);
  margin: var(--tp-space-6) 0;
}

.tp-section-gap { margin-bottom: var(--tp-space-12); }
