/* ========================================
   Nexum - Design System
   Following Intelliquinte brand guidelines
   © 2026 Intelliquinte L.L.C.
   ======================================== */

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

:root {
  /* Colors - Intelliquinte Palette */
  --color-primary: #000000;
  --color-primary-soft: #2C2C2C;
  --color-white: #FFFFFF;
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #E5E5E5;
  --color-gray-300: #C4C4C4;
  --color-gray-400: #A0A0A0;
  --color-gray-500: #757575;
  --color-gray-600: #666666;
  --color-gray-700: #404040;
  --color-gray-800: #2C2C2C;
  --color-gray-900: #1A1A1A;
  
  /* Semantic Colors */
  --color-error: #D32F2F;
  --color-success: #2E7D32;
  --color-warning: #F59E0B;
  --color-info: #2563EB;
  
  /* Typography */
  --font-heading: 'Raleway', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-numbers: 'Poppins', system-ui, sans-serif;
  
  /* Legacy variables for compatibility */
  --black: var(--color-primary);
  --white: var(--color-gray-50);
  --gray: var(--color-gray-500);
  --gray-light: var(--color-gray-200);
  --gray-subtle: var(--color-gray-100);
  --font-display: var(--font-heading);
  
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--black);
  color: var(--white);
}

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

img { max-width: 100%; display: block; }
button, input { font: inherit; }

/* Typography */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.125rem;
  font-family: var(--font-body);
  font-weight: 500;
}

p { max-width: 42ch; }

.text-gray { color: var(--gray); }
.text-sm { font-size: 0.8125rem; }

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.container-narrow {
  max-width: 640px;
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (max-width: 640px) {
  .nav {
    background: #FAFAFA;
  }
}

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

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

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

.nav-link {
  font-size: 0.8125rem;
  color: var(--gray);
  transition: color 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--black);
}

.nav-toggle {
  display: none;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--black);
  transition: 0.3s var(--ease);
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 0; }

.nav-toggle.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: #FAFAFA;
  padding: 6rem 2rem 2rem;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.5rem;
}

.nav-mobile.active {
  display: flex;
}

.nav-mobile a {
  color: var(--black);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-light);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

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

.btn-primary:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--black);
  border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
  border-color: var(--black);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 0.875rem;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   Hero
   ======================================== */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0 4rem;
}

.hero-content {
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 2rem;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero h1 {
  margin-bottom: 1.5rem;
  animation: fadeUp 0.8s var(--ease) 0.1s both;
}

.hero h1 em {
  font-style: italic;
}

.hero-text {
  font-size: 1.125rem;
  color: var(--gray);
  margin-bottom: 3rem;
  max-width: 480px;
  animation: fadeUp 0.8s var(--ease) 0.2s both;
}

.hero-cta {
  animation: fadeUp 0.8s var(--ease) 0.3s both;
}

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

/* ========================================
   Sections
   ======================================== */

.section {
  padding: clamp(5rem, 12vw, 8rem) 0;
}

.section-dark {
  background: var(--black);
  color: var(--white);
}

.section-alt {
  background: var(--gray-subtle);
}

.section-header {
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--gray);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--gray-light);
  border: 1px solid var(--gray-light);
}

.feature {
  background: var(--white);
  padding: clamp(2rem, 5vw, 3rem);
}

.feature-num {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.feature h3 {
  margin-bottom: 0.75rem;
}

.feature p {
  color: var(--gray);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1.5rem;
  opacity: 0.15;
}

.section-dark .step::before {
  color: var(--white);
  opacity: 0.2;
}

.step h3 {
  margin-bottom: 0.75rem;
  color: var(--black);
}

.section-dark .step h3 {
  color: var(--white);
}

.step p {
  color: var(--gray);
  font-size: 0.875rem;
  max-width: none;
}

.section-dark .step p {
  color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ========================================
   Pricing
   ======================================== */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.pricing-card {
  position: relative;
  padding: 2.5rem;
  border: 1px solid var(--gray-light);
  transition: border-color 0.3s var(--ease);
}

.pricing-card:hover {
  border-color: var(--black);
}

.pricing-featured {
  border-color: var(--black);
  border-width: 2px;
}

.pricing-badge {
  position: absolute;
  top: -0.75rem;
  right: 2rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
}

.pricing-name {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.pricing-amount {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
}

.pricing-period {
  font-size: 0.875rem;
  color: var(--gray);
}

.pricing-card > p {
  font-size: 0.8125rem;
  color: var(--gray);
  margin: 1.5rem 0;
}

.pricing-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 3rem;
}

@media (max-width: 540px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   CTA Section
   ======================================== */

.cta-section {
  text-align: center;
  padding: clamp(5rem, 15vw, 10rem) 0;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section > .container > p {
  color: var(--gray);
  margin: 0 auto 2.5rem;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 5rem 0 3rem;
  background: var(--black);
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 1rem;
  max-width: 240px;
}

.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 1.25rem;
}

.footer-col a {
  display: block;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.75rem;
  color: var(--gray);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-brand {
    grid-column: span 1;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
  }
}

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

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header .nav-logo {
  display: block;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--gray);
  font-size: 0.875rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.form-group input {
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--gray-light);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--black);
}

.form-group input::placeholder {
  color: var(--gray);
}

.auth-links {
  display: flex;
  justify-content: flex-end;
}

.auth-links a {
  font-size: 0.8125rem;
  color: var(--gray);
  transition: color 0.2s;
}

.auth-links a:hover {
  color: var(--black);
}

.auth-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray);
}

.auth-footer a {
  color: var(--black);
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Messages */
.message {
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}

.message-error {
  background: #fef2f2;
  color: #b91c1c;
  border-left: 2px solid #b91c1c;
}

.message-success {
  background: #f0fdf4;
  color: #15803d;
  border-left: 2px solid #15803d;
}

.message:empty {
  display: none;
}

/* Success View */
.success-view {
  text-align: center;
}

.success-view h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.success-view p {
  color: var(--gray);
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

/* ========================================
   Dashboard
   ======================================== */

.dashboard {
  padding-top: 5rem;
}

.dashboard-header {
  padding: 3rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.dashboard-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--gray);
}

.dashboard-content {
  padding: 3rem 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.dash-card {
  padding: 2rem;
  border: 1px solid var(--gray-light);
}

.dash-card h3 {
  margin-bottom: 0.5rem;
}

.dash-card > p {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--gray-subtle);
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

.download-item:hover {
  background: var(--gray-light);
}

.download-item span {
  font-weight: 500;
  font-size: 0.875rem;
}

.download-item small {
  font-size: 0.75rem;
  color: var(--gray);
}

/* ========================================
   Docs & Legal Pages
   ======================================== */

.page-header {
  padding: 8rem 0 4rem;
  border-bottom: 1px solid var(--gray-light);
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--gray);
}

.page-content {
  padding: 4rem 0;
  max-width: 680px;
}

.page-content h2 {
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content h3 {
  margin: 2rem 0 0.75rem;
}

.page-content p {
  color: var(--gray);
  margin-bottom: 1rem;
  max-width: none;
}

.page-content ul, .page-content ol {
  margin: 0 0 1rem 1.5rem;
  color: var(--gray);
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-content code {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.85em;
  padding: 0.125rem 0.375rem;
  background: var(--gray-subtle);
}

/* ========================================
   Modal
   ======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--white);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--gray-light);
}

.modal-header h2 {
  font-size: 1.25rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--black);
}

.modal-body {
  padding: 2rem;
}

/* ========================================
   Plan Selection
   ======================================== */

.plan-modal {
  max-width: 640px;
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 540px) {
  .plan-options {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  position: relative;
  padding: 2rem;
  border: 1px solid var(--gray-light);
  transition: border-color 0.2s;
}

.plan-card:hover {
  border-color: var(--gray);
}

.plan-card.featured {
  border-color: var(--black);
  border-width: 2px;
}

.plan-badge {
  position: absolute;
  top: -0.75rem;
  right: 1.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
}

.plan-header {
  margin-bottom: 0.5rem;
}

.plan-name {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
}

.plan-price {
  margin-bottom: 0.25rem;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
}

.price-period {
  font-size: 0.875rem;
  color: var(--gray);
}

.plan-savings {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.plan-features {
  list-style: none;
  margin: 1.5rem 0;
}

.plan-features li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--black);
}

/* ========================================
   Utilities
   ======================================== */

.spinner {
  width: 16px;
  height: 16px;
  border: 1.5px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Smooth page transitions */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
