/* ============================================================
   ravingCRM — Shared Design System v1.0
   Extracted from index.html (canonical source)
   ============================================================ */

/* ==================== CSS RESET ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==================== CSS VARIABLES ==================== */
:root {
  /* Colors */
  --primary: #1a1a2e;
  --accent: #e94560;
  --accent-dark: #c73a52;
  --secondary: #16213e;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6c757d;
  --text-muted: #9ca3af;
  --success: #28a745;
  --warning: #ffc107;

  /* Borders */
  --border: rgba(26, 26, 46, 0.08);
  --border-md: rgba(26, 26, 46, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
}

/* ==================== BASE STYLES ==================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== TYPOGRAPHY ==================== */
h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -2px;
  color: var(--text);
}

h2 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text);
}

h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--text);
}

h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

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

.body-large {
  font-size: 18px;
  line-height: 1.7;
}

.small {
  font-size: 14px;
  line-height: 1.65;
}

.caption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Italic in headlines = accent color */
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==================== LAYOUT ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
}

/* ==================== COMPONENTS ==================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  font-size: 15px;
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
}

.btn-nav {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.btn-nav:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

.btn-cta {
  background: var(--accent);
  color: white;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
}
.btn-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s ease;
}
.card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: all 0.3s ease;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.feature-card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.feature-card:hover::before {
  transform: scaleX(1);
}

/* Badges */
.badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-accent {
  background: var(--accent);
}

/* Section Label (Eyebrow) */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ==================== NAVIGATION ==================== */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}
.logo svg {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.nav-link:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-login {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.nav-login:hover {
  color: var(--text);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ========================================
   FOOTER - STANDARDIZED COMPONENT
   ravingCRM Design System v1.0
   ======================================== */

.footer {
  background: var(--primary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 56px 24px 32px;
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer__main {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__brand {
  max-width: 280px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  margin-bottom: 16px;
}

.footer__logo span {
  color: var(--accent);
}

.footer__tagline {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.footer__social-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  transform: translateY(-2px);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
}

.footer__column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__link {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer__link:hover {
  color: white;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  gap: 16px;
}

.footer__copyright {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

.footer__location {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer__location svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.footer__link:focus-visible,
.footer__social-link:focus-visible,
.footer__logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==================== SHARED RESPONSIVE ==================== */

@media (max-width: 768px) {
  section {
    padding: 64px 0;
  }

  .container {
    padding: 0 20px;
  }

  h1 {
    font-size: clamp(32px, 8vw, 48px);
  }

  h2 {
    font-size: clamp(28px, 6vw, 36px);
  }

  /* Navigation — hide links, show hamburger */
  .nav-links {
    display: none;
  }

  .nav-login {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  /* Footer */
  .footer {
    padding: 48px 20px 24px;
  }
  .footer__main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 32px;
  }
  .footer__brand {
    text-align: center;
    align-items: center;
    display: flex;
    flex-direction: column;
  }
  .footer__tagline {
    text-align: center;
  }
  .footer__column {
    align-items: center;
    text-align: center;
  }
  .footer__links {
    align-items: center;
  }
  .footer__bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

@media (max-width: 1024px) {
  .footer__main {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .footer__brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }
  .footer__tagline {
    max-width: 400px;
  }
}

/* ── Mobile nav open state ── */
@media (max-width: 768px) {
  .nav-actions { margin-left: auto; }
  .nav.open { height: auto; }
  .nav.open .nav-inner {
    flex-wrap: wrap;
    align-items: flex-start;
    height: auto;
    padding-bottom: 16px;
  }
  .nav.open .logo  { order: 1; flex: 1 1 auto; align-self: center; }
  .nav.open .nav-toggle { order: 2; align-self: center; }
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 3;
    gap: 0;
    border-top: 1px solid var(--border, #e5e7eb);
    padding-top: 4px;
    margin-top: 4px;
  }
  .nav.open .nav-links li {
    border-bottom: 1px solid var(--border, #f3f4f6);
  }
  .nav.open .nav-links li:last-child { border-bottom: none; }
  .nav.open .nav-links a {
    display: block;
    padding: 13px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text, #1a1a2e);
  }
  .nav.open .nav-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 4;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #e5e7eb);
  }
  .nav.open .nav-login {
    display: block;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
  }
  .nav.open .nav-actions .btn-nav {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  /* Hamburger → X */
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .footer__social-link,
  .footer__link {
    transition: none;
  }
  .footer__social-link:hover {
    transform: none;
  }
}
