/* audajo Design System
 * Version: 2.0 (Redesign October 2026)
 * Font: Plus Jakarta Sans (SIL OFL)
 * Icons: Lucide (ISC)
 */

/* ===== Font Face ===== */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/plus-jakarta-sans/PlusJakartaSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/plus-jakarta-sans/PlusJakartaSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/plus-jakarta-sans/PlusJakartaSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/plus-jakarta-sans/PlusJakartaSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Design Tokens ===== */
:root {
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Brand Colors */
  --color-orange: #FF6B35;
  --color-orange-hover: #e55a2b;
  --color-blue: #004E89;
  --color-blue-hover: #003d6b;

  /* Light Mode (default) */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-subtle: #f5f5f5;
  --color-border: #e5e5e5;
  --color-text: #1a1a1a;
  --color-text-secondary: #525252;
  --color-text-muted: #737373;

  /* Semantic Colors */
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow: 0 1px 3px rgba(26, 26, 26, 0.08), 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(26, 26, 26, 0.08), 0 2px 4px -2px rgba(26, 26, 26, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(26, 26, 26, 0.08), 0 8px 10px -6px rgba(26, 26, 26, 0.04);
  --shadow-xl: 0 20px 40px -10px rgba(26, 26, 26, 0.12);

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(255, 107, 53, 0.25);
  --focus-ring-dark: 0 0 0 3px rgba(255, 107, 53, 0.4);
}

/* ===== Dark Mode ===== */
.dark {
  --color-bg: #0a0a0a;
  --color-surface: #171717;
  --color-subtle: #262626;
  --color-border: #404040;
  --color-text: #fafafa;
  --color-text-secondary: #a3a3a3;
  --color-text-muted: #737373;

  --color-success-bg: #052e16;
  --color-success-border: #166534;
  --color-error-bg: #450a0a;
  --color-error-border: #991b1b;
  --color-warning-bg: #451a03;
  --color-warning-border: #92400e;

  --color-blue: #60a5fa;
  --color-blue-hover: #93c5fd;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* System preference detection */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --color-bg: #0a0a0a;
    --color-surface: #171717;
    --color-subtle: #262626;
    --color-border: #404040;
    --color-text: #fafafa;
    --color-text-secondary: #a3a3a3;
    --color-text-muted: #737373;

    --color-success-bg: #052e16;
    --color-success-border: #166534;
    --color-error-bg: #450a0a;
    --color-error-border: #991b1b;
    --color-warning-bg: #451a03;
    --color-warning-border: #92400e;

    --color-blue: #60a5fa;
    --color-blue-hover: #93c5fd;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  }
}

/* ===== Base Styles ===== */
html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ===== Typography ===== */
.text-display {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-h1 {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.text-h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.text-h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-size: 1rem;
  line-height: 1.6;
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.text-caption {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

.btn-primary {
  background-color: var(--color-orange);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-orange-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-blue);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--color-blue-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background-color: var(--color-subtle);
  border-color: var(--color-text-muted);
}

/* ===== Cards ===== */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-interactive:hover {
  transform: translateY(-2px);
}

/* ===== Forms ===== */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.input:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: var(--focus-ring);
}

.input-error {
  border-color: var(--color-error);
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* ===== Icons ===== */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background-color: var(--color-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--color-border);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.dark .theme-toggle .icon-sun {
  opacity: 1;
}

.dark .theme-toggle .icon-moon {
  opacity: 0;
  position: absolute;
}

:root:not(.dark) .theme-toggle .icon-sun {
  opacity: 0;
  position: absolute;
}

:root:not(.dark) .theme-toggle .icon-moon {
  opacity: 1;
}

/* Mobile Theme Toggle Labels */
.dark-mode-label-light {
  display: inline;
}

.dark-mode-label-dark {
  display: none;
}

.dark .dark-mode-label-light {
  display: none;
}

.dark .dark-mode-label-dark {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .dark-mode-label-light {
    display: none;
  }

  :root:not(.light) .dark-mode-label-dark {
    display: inline;
  }
}

/* ===== Links ===== */
.link {
  color: var(--color-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.link:hover {
  color: var(--color-orange-hover);
  text-decoration: underline;
}

.link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 2px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background-color: var(--color-subtle);
  color: var(--color-text-secondary);
}

.badge-orange {
  background-color: rgba(255, 107, 53, 0.15);
  color: var(--color-orange);
}

.badge-blue {
  background-color: rgba(0, 78, 137, 0.15);
  color: var(--color-blue);
}

/* ===== Utilities ===== */
.surface {
  background-color: var(--color-surface);
}

.bg-subtle {
  background-color: var(--color-subtle);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-orange {
  color: var(--color-orange);
}

.text-blue {
  color: var(--color-blue);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn var(--transition-slow) ease-out;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}
