/* ============================================
   STACKD — SHARED STYLES v3
   Dark theme — used across all pages
   ============================================ */

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

:root {
  --bg:            #080808;
  --surface:       #111111;
  --surface-2:     #181818;
  --surface-3:     #1E1E1E;
  --border:        rgba(255,255,255,0.06);
  --border-bright: rgba(255,255,255,0.12);
  --border-green:  rgba(29,158,117,0.3);
  --green:         #1D9E75;
  --green-bright:  #22C55E;
  --green-glow:    rgba(29,158,117,0.12);
  --green-dark:    #0F6E56;
  --red:           #EF4444;
  --red-glow:      rgba(239,68,68,0.12);
  --amber:         #F59E0B;
  --amber-glow:    rgba(245,158,11,0.12);
  --text:          #F0F0F0;
  --text-2:        #888888;
  --text-3:        #444444;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --radius-2xl:    24px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);
  --transition:    0.2s cubic-bezier(0.4,0,0.2,1);
  --spring:        0.4s cubic-bezier(0.34,1.56,0.64,1);
  --font-display:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- LOGO ---- */
.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--text);
}
.logo span { color: var(--green); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--green); color: #000; font-weight: 600; }
.btn-primary:hover { background: var(--green-bright); box-shadow: 0 0 20px rgba(29,158,117,0.35); }

.btn-outline {
  background: transparent;
  color: var(--text-2);
  border: 0.5px solid var(--border-bright);
}
.btn-outline:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }

.btn-ghost { background: transparent; color: var(--text-2); border: none; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.btn-danger { background: transparent; color: var(--red); border: 0.5px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red-glow); }

.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ---- NAV ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--transition);
}

.nav.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 1rem; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---- INPUTS ---- */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 0.5px solid var(--border-bright);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.1);
}

input:disabled, select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input::placeholder { color: var(--text-3); }

select option { background: var(--surface-2); color: var(--text); }

/* ---- BADGES ---- */
.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.badge-closed { background: rgba(29,158,117,0.15); color: var(--green); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--amber); }
.badge-disputed { background: rgba(239,68,68,0.15); color: var(--red); }

/* ---- COLORS ---- */
.positive { color: var(--green); }
.warning { color: var(--amber); }
.negative { color: var(--red); }
.gap-ok { color: var(--green); }
.gap-neg { color: var(--red); font-weight: 600; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface-2);
  border: 0.5px solid var(--border-bright);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239,68,68,0.4); color: var(--red); }
.toast.success { border-color: var(--border-green); color: var(--green); }

/* ---- SPINNER ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-bright);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3rem;
  color: var(--text-2);
  font-size: 14px;
}

/* ---- FOOTER ---- */
.footer {
  border-top: 0.5px solid var(--border);
  padding: 3rem 2rem 0;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  padding-bottom: 3rem;
  flex-wrap: wrap;
}

.footer-brand { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-tagline { font-size: 13px; color: var(--text-3); }
.footer-links-group { display: flex; gap: 4rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-col-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  margin-bottom: 0.25rem;
}

.footer-link {
  font-size: 14px;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover { color: var(--text); }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 0;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- COOKIE ---- */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 0.5px solid var(--border-bright);
  color: var(--text-2);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  align-items: center;
  gap: 16px;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.cookie-banner a { color: var(--green); text-decoration: none; }

.cookie-banner button {
  background: var(--green);
  color: #000;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav { padding: 0 1.25rem; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: rgba(8,8,8,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    gap: 4px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 12px; }
  .nav-actions {
    margin-left: 0;
    margin-top: 0.5rem;
    flex-direction: column;
    gap: 8px;
  }
  .nav-actions .btn { width: 100%; justify-content: center; }
  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-links-group { gap: 2rem; }
  .cookie-banner { width: calc(100% - 2rem); white-space: normal; flex-wrap: wrap; }
}

/* ============================================
   CUSTOM CURSOR — all pages
============================================ */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none !important; }
  a, button { cursor: none !important; }
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #00D87F;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: width 0.15s, height 0.15s, background 0.15s;
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(0, 216, 127, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.34,1.56,0.64,1),
              height 0.25s cubic-bezier(0.34,1.56,0.64,1),
              border-color 0.2s;
  will-change: transform;
}

.cursor-dot.dot-hover { width: 10px; height: 10px; background: #FF6B35; }
.cursor-ring.ring-hover { width: 50px; height: 50px; border-color: rgba(0,216,127,0.18); }

@media (max-width: 768px), (hover: none), (pointer: coarse) {
  body { cursor: auto !important; }
  a, button { cursor: pointer !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none !important; }
  body { cursor: auto !important; }
}
