/* ============================================
   ToolTool SaaS - Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ToolTool design system — warm parchment neutrals + terracotta accent (OKLCH).
   Imported from the ToolTool Design project (ToolTool.dc.html). */
:root {
  --th-primary: oklch(0.55 0.17 32);
  --th-primary-hover: oklch(0.5 0.17 32);
  --th-primary-light: oklch(0.95 0.025 45);
  --th-bg: oklch(0.965 0.006 85);
  --th-card: oklch(0.992 0.003 85);
  --th-panel2: oklch(0.945 0.006 84);
  --th-text: oklch(0.24 0.012 60);
  --th-text-secondary: oklch(0.46 0.012 65);
  --th-ink3: oklch(0.6 0.012 70);
  --th-border: oklch(0.9 0.008 80);
  --th-border-light: oklch(0.94 0.006 82);
  --th-placeholder: oklch(0.6 0.012 70);
  --th-on-accent: oklch(0.99 0.005 85);
  --th-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --th-shadow-sm: 0 1px 3px oklch(0.3 0.01 70 / 0.08), 0 1px 2px oklch(0.3 0.01 70 / 0.05);
  --th-shadow-lg: 0 12px 30px -18px oklch(0.3 0.01 70 / 0.6);
  --th-shadow-modal: 0 40px 80px -40px oklch(0 0 0 / 0.5);
  --th-shadow: 0 18px 44px -30px oklch(0.3 0.01 70 / 0.75);
  --th-focus: 0 0 0 3px oklch(0.55 0.17 32 / 0.16);
  --th-success: oklch(0.5 0.12 150);
  --th-warning: oklch(0.62 0.13 70);
  --th-danger: oklch(0.55 0.19 25);
  --th-gradient: linear-gradient(135deg, oklch(0.55 0.17 32), oklch(0.6 0.15 45));
  /* Categorie-tints: zachte achtergrond (--t-*) + verzadigde inkt (--i-*) */
  --t-marketing: oklch(0.93 0.05 32); --i-marketing: oklch(0.44 0.16 32);
  --t-sales: oklch(0.93 0.05 148); --i-sales: oklch(0.42 0.11 152);
  --t-service: oklch(0.93 0.04 205); --i-service: oklch(0.43 0.1 212);
  --t-intern: oklch(0.93 0.035 258); --i-intern: oklch(0.45 0.13 262);
  --t-finance: oklch(0.94 0.05 85); --i-finance: oklch(0.45 0.11 80);
  --t-data: oklch(0.93 0.04 305); --i-data: oklch(0.45 0.13 305);
  --t-neutral: oklch(0.92 0.012 70); --i-neutral: oklch(0.36 0.012 65);
  --t-inkoop: oklch(0.93 0.04 175); --i-inkoop: oklch(0.42 0.1 178);
}

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

body {
  font-family: 'Instrument Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--th-bg);
  color: var(--th-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: var(--th-primary); text-decoration: none; }
/* Alleen kale tekstlinks onderstrepen bij hover; component-links (kaarten, knoppen)
   hebben hun eigen hover-animatie en moeten geen onderstreping erven */
a:not([class]):hover { text-decoration: underline; }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn--primary {
  background: var(--th-primary);
  color: var(--th-on-accent, #fff);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(181,80,47,0.18);
}
.btn--primary:hover {
  background: var(--th-primary-hover);
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(181,80,47,0.26);
}
.btn--primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(181,80,47,0.25);
}

.btn--secondary {
  background: var(--th-card);
  color: var(--th-text);
  border-color: var(--th-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.btn--secondary:hover {
  background: var(--th-bg);
  text-decoration: none;
  border-color: var(--th-primary);
  color: var(--th-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(181,80,47,0.08);
}
.btn--secondary:active {
  transform: scale(0.98);
}

.btn--large {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
}

.btn--ghost {
  background: transparent;
  color: var(--th-text);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--th-bg);
  text-decoration: none;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg { width: 16px; height: 16px; }

/* ============================================
   Form Elements
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--th-text);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--th-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--th-card);
  color: var(--th-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--th-placeholder);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--th-primary);
  box-shadow: 0 0 0 3px rgba(181,80,47,0.12), 0 1px 3px rgba(0,0,0,0.05);
  background: color-mix(in srgb, var(--th-primary-light) 25%, var(--th-card));
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  font-size: 12px;
  color: var(--th-danger);
  margin-top: 4px;
}

/* ============================================
   Trial Banner
   ============================================ */

.trial-banner {
  background: color-mix(in srgb, var(--th-card) 92%, var(--th-bg));
  border-bottom: 1px solid color-mix(in srgb, var(--th-border) 90%, transparent);
  padding: 6px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--th-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trial-progress {
  width: 68px; height: 4px; background: color-mix(in srgb, var(--th-border) 86%, transparent);
  border-radius: 999px; overflow: hidden; display: inline-block;
}
.trial-progress-fill {
  height: 100%; background: var(--th-primary); border-radius: 3px;
  transition: width 0.3s ease;
  opacity: 0.9;
}

.trial-banner a {
  font-weight: 600;
  color: var(--th-primary);
  text-decoration: none;
}
.trial-banner a:hover { text-decoration: underline; }

/* ============================================
   Toast / Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  font-size: 13px;
  max-width: 380px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.toast--success { border-left: 3px solid var(--th-success); }
.toast--error { border-left: 3px solid var(--th-danger); }
.toast--warning { border-left: 3px solid var(--th-warning); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--th-primary);
  border-radius: 0 0 0 10px;
  animation: toastProgress 3s linear forwards;
}
.toast--success .toast-progress { background: var(--th-success); }
.toast--error .toast-progress { background: var(--th-danger); }
.toast--warning .toast-progress { background: var(--th-warning); }

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================
   Auth Pages
   ============================================ */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--th-bg);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(181,80,47,0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(181,80,47,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-card {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: 16px;
  padding: 44px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
  position: relative;
  z-index: 1;
  animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
}

.auth-logo-mark {
  width: 44px;
  height: 44px;
  background: var(--th-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(181,80,47,0.25);
}

.auth-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--th-text);
  letter-spacing: -0.3px;
}

.auth-logo-text span {
  color: var(--th-primary);
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--th-text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--th-text-secondary);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--th-text-secondary);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--th-border);
}

/* ============================================
   Mobile
   ============================================ */

@media (max-width: 768px) {
  .auth-card {
    padding: 28px 20px;
  }
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus-visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--th-primary);
  outline-offset: 2px;
}

/* Screen reader only utility */
.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;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--th-primary);
  color: #fff;
  z-index: 9999;
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 8px 0;
  transition: left 0.2s;
}
.skip-link:focus {
  left: 0;
}

/* ============================================
   Reduced motion
   ============================================ */

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

/* ============================================
   Dark mode support
   ============================================ */

/* Dark mode — premium dark-first palette */

[data-theme="dark"] {
  --th-bg: oklch(0.19 0.008 70);
  --th-card: oklch(0.225 0.008 70);
  --th-panel2: oklch(0.26 0.008 70);
  --th-text: oklch(0.95 0.006 85);
  --th-text-secondary: oklch(0.78 0.008 80);
  --th-ink3: oklch(0.63 0.008 75);
  --th-border: oklch(0.31 0.008 70);
  --th-border-light: oklch(0.28 0.008 70);
  --th-placeholder: oklch(0.63 0.008 75);
  --th-primary: oklch(0.7 0.15 38);
  --th-primary-hover: oklch(0.76 0.15 38);
  --th-primary-light: oklch(0.3 0.05 40);
  --th-on-accent: oklch(0.18 0.01 60);
  --th-shadow-sm: 0 1px 3px oklch(0 0 0 / 0.5);
  --th-shadow-lg: 0 12px 30px -18px oklch(0 0 0 / 0.7);
  --th-shadow-modal: 0 40px 80px -40px oklch(0 0 0 / 0.8), 0 0 0 1px oklch(1 0 0 / 0.05);
  --th-shadow: 0 18px 44px -26px oklch(0 0 0 / 0.8);
  --th-gradient: linear-gradient(135deg, oklch(0.7 0.15 38), oklch(0.72 0.13 55));
  --th-success: oklch(0.8 0.13 150);
  --th-warning: oklch(0.82 0.12 80);
  --th-danger: oklch(0.72 0.16 25);
  --th-focus: 0 0 0 3px oklch(0.7 0.15 38 / 0.25);
  --t-marketing: oklch(0.32 0.06 32); --i-marketing: oklch(0.82 0.11 38);
  --t-sales: oklch(0.3 0.05 150); --i-sales: oklch(0.82 0.1 150);
  --t-service: oklch(0.3 0.045 210); --i-service: oklch(0.82 0.09 210);
  --t-intern: oklch(0.3 0.05 262); --i-intern: oklch(0.82 0.1 265);
  --t-finance: oklch(0.31 0.05 85); --i-finance: oklch(0.85 0.1 85);
  --t-data: oklch(0.31 0.05 305); --i-data: oklch(0.83 0.1 305);
  --t-neutral: oklch(0.3 0.008 70); --i-neutral: oklch(0.82 0.008 75);
  --t-inkoop: oklch(0.3 0.045 178); --i-inkoop: oklch(0.82 0.09 178);
}

/* Global polish */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--th-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--th-text-secondary); }
*:focus-visible { outline: 2px solid var(--th-primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(181,80,47,0.2); color: inherit; }
