/* SignSafe Web - Design System */

/* ============================================================================
   CSS Variables & Design Tokens
   ============================================================================ */
:root {
  /* Brand Colors - v18.0: Standardized to match design-tokens.css */
  --primary: #0066ff;
  --primary-dark: #0052cc;
  --primary-light: #3b82f6;
  --primary-subtle: #e6f0ff;

  /* Semantic Colors */
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;

  /* Neutrals - WCAG 2.2 AA compliant contrast ratios */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #6b7280; /* 5.02:1 on white - was #9ca3af (3.03:1) */
  --gray-500: #4b5563; /* 7.02:1 on white - was #6b7280 */
  --gray-600: #374151; /* 10.69:1 on white */
  --gray-700: #1f2937;
  --gray-800: #111827;
  --gray-900: #0f172a;

  /* Typography */
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-sans);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-700);
  background: white;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================================================
   Typography
   ============================================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

.text-gradient {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* ============================================================================
   Layout
   ============================================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 800px;
}

.container-lg {
  max-width: 1400px;
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}
.gap-xl {
  gap: var(--space-xl);
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  /* v18.0: Mobile touch target - WCAG 2.5.5 */
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(0, 102, 255, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(0, 102, 255, 0.5);
  color: white;
}

/* v18.0: Touch feedback for mobile */
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px 0 rgba(0, 102, 255, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
  /* v18.0: More visible hover - gray-100 instead of gray-50 */
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-900);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
  background: var(--gray-200);
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
}

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--gray-200);
}

.card-flat:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

/* ============================================================================
   Navigation
   ============================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  transition: all var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-md);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
}

.nav-logo img {
  width: 40px;
  height: 40px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--gray-600);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  display: flex;
  gap: var(--space-md);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-mobile-toggle {
    display: block;
  }

  .nav-mobile {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: var(--space-xl);
    display: none;
    flex-direction: column;
    gap: var(--space-lg);
  }

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

  .nav-mobile a {
    display: block;
    padding: var(--space-md);
    font-size: 1.125rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
  }
}

/* ============================================================================
   Hero Section
   ============================================================================ */
.hero {
  padding-top: calc(72px + var(--space-4xl));
  padding-bottom: var(--space-4xl);
  background: linear-gradient(180deg, var(--primary-subtle) 0%, white 100%);
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-text h1 {
  margin-bottom: var(--space-lg);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
  max-width: 540px;
}

@media (max-width: 968px) {
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 968px) {
  .hero-cta {
    justify-content: center;
  }
}

.hero-visual {
  position: relative;
}

.hero-phone {
  max-width: 320px;
  margin: 0 auto;
  border-radius: 40px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  background: var(--gray-900);
  padding: 12px;
}

.hero-phone-screen {
  background: white;
  border-radius: 32px;
  overflow: hidden;
  aspect-ratio: 9/19;
}

.hero-badges {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

@media (max-width: 968px) {
  .hero-badges {
    justify-content: center;
  }
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.hero-badge svg {
  width: 20px;
  height: 20px;
}

.hero-badge.success {
  color: var(--success);
}

.hero-badge.warning {
  color: var(--warning);
}

/* App Store Buttons */
.app-buttons {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 968px) {
  .app-buttons {
    justify-content: center;
  }
}

.app-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
}

.app-button:hover {
  background: var(--gray-800);
  transform: translateY(-2px);
  color: white;
}

.app-button.disabled {
  /* v18.0: Use explicit colors for WCAG 2.2 AA contrast */
  background: #e5e7eb !important;
  color: #6b7280 !important; /* 4.5:1 contrast on light gray */
  cursor: not-allowed;
}

.app-button.disabled:hover {
  transform: none;
  background: #e5e7eb !important;
}

.app-button-icon {
  width: 28px;
  height: 28px;
}

.app-button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-button-label {
  font-size: 0.75rem; /* Increased for readability */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(
    255,
    255,
    255,
    0.9
  ); /* WCAG 2.2 AA: Better contrast than opacity: 0.8 */
}

.app-button-store {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ============================================================================
   Features Section
   ============================================================================ */
.features {
  background: white;
}

.features-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}

.features-header p {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-top: var(--space-md);
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  background: var(--primary-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--gray-600);
}

/* Feature Showcase */
.feature-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-3xl) 0;
}

.feature-showcase:nth-child(even) {
  direction: rtl;
}

.feature-showcase > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .feature-showcase,
  .feature-showcase:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }
}

.feature-showcase-content h3 {
  margin-bottom: var(--space-md);
}

.feature-showcase-content p {
  color: var(--gray-600);
  margin-bottom: var(--space-lg);
}

.feature-list {
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.feature-list li svg {
  width: 20px;
  height: 20px;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-showcase-visual {
  background: var(--gray-100);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================================
   How It Works
   ============================================================================ */
.how-it-works {
  background: var(--gray-50);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  position: relative;
}

@media (max-width: 968px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.step h4 {
  margin-bottom: var(--space-sm);
}

.step p {
  color: var(--gray-600);
  font-size: 0.9375rem;
}

/* ============================================================================
   Testimonials / Social Proof
   ============================================================================ */
.testimonials {
  background: white;
}

.testimonial-card {
  padding: var(--space-xl);
}

.testimonial-stars {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-md);
}

.testimonial-stars svg {
  width: 20px;
  height: 20px;
  color: #fbbf24;
  fill: #fbbf24;
}

.testimonial-text {
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--gray-700);
  margin-bottom: var(--space-lg);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  background: var(--primary-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--primary);
}

.testimonial-info strong {
  display: block;
  color: var(--gray-900);
}

.testimonial-info span {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ============================================================================
   Pricing
   ============================================================================ */
.pricing {
  background: var(--gray-50);
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

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

.pricing-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--transition-base);
}

.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

@media (max-width: 868px) {
  .pricing-card.featured {
    transform: none;
  }
}

.pricing-card-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.pricing-card h3 {
  margin-bottom: var(--space-sm);
}

.pricing-card .price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
}

.pricing-card .price-note {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: var(--space-xs);
}

.pricing-features {
  list-style: none;
  margin: var(--space-xl) 0;
  text-align: left;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--gray-100);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features li svg {
  width: 20px;
  height: 20px;
  color: var(--success);
  flex-shrink: 0;
}

/* ============================================================================
   FAQ Section
   ============================================================================ */
.faq {
  background: white;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-900);
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question svg {
  width: 24px;
  height: 24px;
  color: var(--gray-400);
  transition: transform var(--transition-base);
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding-bottom: var(--space-lg);
  color: var(--gray-600);
}

/* ============================================================================
   CTA Section
   ============================================================================ */
.cta {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  text-align: center;
}

.cta h2 {
  color: white;
  margin-bottom: var(--space-md);
}

.cta p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn-secondary {
  background: white;
  color: var(--primary);
  border: none;
}

.cta .btn-secondary:hover {
  background: var(--gray-100);
  color: var(--primary-dark);
}

/* ============================================================================
   Footer
   ============================================================================ */
.footer {
  background: var(--gray-900);
  color: #9ca3af; /* WCAG 2.2 AA: 6.14:1 on dark bg - was var(--gray-400) */
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-xl);
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

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

.footer-brand {
  color: white;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: var(--space-md);
}

.footer-brand p {
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-800);
  border-radius: var(--radius-full);
  color: var(--gray-400);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary);
  color: white;
}

.footer-column-title,
.footer-links h4 {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-lg);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: #9ca3af; /* WCAG 2.2 AA: 6.14:1 on dark bg */
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--gray-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-bottom p {
  font-size: 0.875rem;
}

.footer-legal {
  display: flex;
  gap: var(--space-lg);
}

.footer-legal a {
  font-size: 0.875rem;
  color: #9ca3af; /* WCAG 2.2 AA: 6.14:1 on dark bg */
}

.footer-legal a:hover {
  color: white;
}

/* ============================================================================
   Legal Pages (Privacy, Terms, FAQ)
   ============================================================================ */
.legal-page {
  padding-top: calc(72px + var(--space-3xl));
}

.legal-header {
  text-align: center;
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-2xl);
}

.legal-header p {
  color: var(--gray-500);
  margin-top: var(--space-sm);
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.legal-content h3 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal-content p {
  margin-bottom: var(--space-md);
}

.legal-content ul,
.legal-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.legal-content li {
  margin-bottom: var(--space-sm);
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================================================
   Web App / Demo Section
   ============================================================================ */
.demo-section {
  background: var(--gray-50);
  min-height: 600px;
}

.demo-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (max-width: 968px) {
  .demo-container {
    grid-template-columns: 1fr;
  }
}

.demo-upload {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.demo-upload h3 {
  margin-bottom: var(--space-md);
}

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.upload-zone.dragging {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.upload-zone svg {
  width: 48px;
  height: 48px;
  color: var(--gray-400);
  margin-bottom: var(--space-md);
}

.upload-zone p {
  color: var(--gray-600);
  margin-bottom: var(--space-sm);
}

.upload-zone span {
  font-size: 0.875rem;
  color: var(--gray-400);
}

.demo-text-input {
  margin-top: var(--space-lg);
}

.demo-text-input label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.demo-text-input textarea {
  width: 100%;
  min-height: 200px;
  padding: var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.demo-text-input textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.demo-results {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.demo-results-placeholder {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--gray-500);
}

.demo-results-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--gray-300);
  margin-bottom: var(--space-md);
}

/* Analysis Results Styles */
.analysis-verdict {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.analysis-verdict.safe {
  background: var(--success-light);
}

.analysis-verdict.caution {
  background: var(--warning-light);
}

.analysis-verdict.danger {
  background: var(--danger-light);
}

.analysis-verdict h2 {
  margin-bottom: var(--space-sm);
}

.analysis-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.analysis-verdict.safe .analysis-score {
  color: var(--success);
}
.analysis-verdict.caution .analysis-score {
  color: var(--warning);
}
.analysis-verdict.danger .analysis-score {
  color: var(--danger);
}

.analysis-section {
  margin-bottom: var(--space-xl);
}

.analysis-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 1.125rem;
}

.analysis-section h3 svg {
  width: 24px;
  height: 24px;
}

.risk-item {
  padding: var(--space-md);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border-left: 4px solid;
}

.risk-item.critical {
  border-left-color: var(--danger);
}
.risk-item.high {
  border-left-color: var(--warning);
}
.risk-item.medium {
  border-left-color: #f59e0b;
}
.risk-item.low {
  border-left-color: var(--gray-400);
}

.risk-item h4 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.risk-item p {
  font-size: 0.9375rem;
  color: var(--gray-600);
  margin: 0;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading p {
  margin-top: var(--space-md);
  color: var(--gray-600);
}

/* ============================================================================
   Utilities
   ============================================================================ */
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mb-0 {
  margin-bottom: 0 !important;
}
.mb-sm {
  margin-bottom: var(--space-sm) !important;
}
.mb-md {
  margin-bottom: var(--space-md) !important;
}
.mb-lg {
  margin-bottom: var(--space-lg) !important;
}
.mb-xl {
  margin-bottom: var(--space-xl) !important;
}

.mt-0 {
  margin-top: 0 !important;
}
.mt-sm {
  margin-top: var(--space-sm) !important;
}
.mt-md {
  margin-top: var(--space-md) !important;
}
.mt-lg {
  margin-top: var(--space-lg) !important;
}
.mt-xl {
  margin-top: var(--space-xl) !important;
}

/* P3.2: Virtualized findings list lazy loading indicator */
.findings-sentinel {
  padding: 1rem;
  text-align: center;
}
.loading-more {
  color: var(--text-muted, #6b7280);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.loading-more::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Performance Metrics Dashboard */
.performance-metrics {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #e2e8f0;
  font-size: 0.875rem;
}
.perf-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.perf-icon {
  font-size: 1.25rem;
}
.perf-title {
  flex: 1;
  font-weight: 500;
}
.perf-toggle {
  background: rgba(0, 102, 255, 0.2);
  border: 1px solid rgba(0, 102, 255, 0.3);
  color: #a5b4fc;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.perf-toggle:hover {
  background: rgba(0, 102, 255, 0.3);
}
.perf-details {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 102, 255, 0.2);
}
.performance-metrics.expanded .perf-details {
  display: block;
}
.perf-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}
.perf-segment {
  transition: width 0.3s ease;
}
.perf-segment.ai {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.perf-segment.extract {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.perf-segment.other {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.perf-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.75rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #94a3b8;
}
.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-item .dot.ai {
  background: #8b5cf6;
}
.legend-item .dot.extract {
  background: #3b82f6;
}
.legend-item .dot.other {
  background: #64748b;
}
.perf-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}
.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}
.breakdown-item .label {
  color: #94a3b8;
  font-size: 0.75rem;
}
.breakdown-item .value {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v5.1 Walk Away Calculator Styles
   ═══════════════════════════════════════════════════════════════════════════ */
.walkaway-calculator {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.walkaway-recommendation {
  padding: 1.25rem;
  border-radius: 12px;
}
.rec-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.rec-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}
.rec-text h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.rec-text p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #6b7280;
}
.rec-confidence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.confidence-label {
  color: #9ca3af;
}
.confidence-dots {
  display: flex;
  gap: 4px;
}
.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.confidence-text {
  color: #6b7280;
  font-weight: 500;
  text-transform: capitalize;
}
.walkaway-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .walkaway-comparison {
    grid-template-columns: 1fr;
  }
}
.comparison-column {
  background: var(--card-bg, #fff);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e5e7eb);
}
.comparison-column h4 {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: rgba(0, 0, 0, 0.02);
}
.comp-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.comp-item .comp-label {
  color: #6b7280;
}
.comp-item .comp-value {
  font-weight: 600;
}
.comp-item.success .comp-value {
  color: #059669;
}
.comp-item.warning .comp-value {
  color: #d97706;
}
.comp-item.danger .comp-value {
  color: #dc2626;
}
.walkaway-triggers,
.walkaway-alternatives {
  background: rgba(239, 68, 68, 0.05);
  border-radius: 8px;
  padding: 1rem;
}
.walkaway-triggers h4,
.walkaway-alternatives h4 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.walkaway-triggers ul,
.walkaway-alternatives ol {
  margin: 0;
  padding-left: 1.25rem;
}
.walkaway-triggers li,
.walkaway-alternatives li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.walkaway-alternatives {
  background: rgba(16, 185, 129, 0.05);
}
.walkaway-advice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1d4ed8;
}
.advice-icon {
  flex-shrink: 0;
}

/* v5.1 Pre-Signing Checklist improvements */
.top-questions {
  margin-bottom: 1.25rem;
}
.top-questions-header {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary, #3b82f6);
}
.top-question-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.top-question-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.top-question-text {
  font-size: 0.9375rem;
  line-height: 1.5;
}
.detailed-questions.with-top {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}
.detailed-questions-header {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
}
.question-ref {
  display: inline-block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 0.5rem;
}
.question-urgency {
  display: inline-block;
  font-size: 0.75rem; /* WCAG: Min readable size (was 0.625rem/10px) */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}
.question-urgency.urgency-urgent {
  background: #fee2e2;
  color: #991b1b;
}
.question-urgency.urgency-before_signing {
  background: #fef3c7;
  color: #92400e;
}
.question-urgency.urgency-at_move_in {
  background: #dbeafe;
  color: #1e40af;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Processing Precheck Metadata Styles
   ═══════════════════════════════════════════════════════════════════════════ */
.processing-precheck {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.precheck-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.precheck-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}
.precheck-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.precheck-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}
.precheck-label {
  font-size: 0.6875rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.precheck-routing {
  margin-top: 0.75rem;
  text-align: center;
}
.routing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
.routing-badge.ocr {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.routing-badge.vlm {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

/* Processing Stats */
.processing-stats {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-radius: 999px;
}
.stat-badge svg {
  flex-shrink: 0;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .processing-precheck {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
  }
  .precheck-value {
    color: #f3f4f6;
  }
  .stat-badge {
    background: rgba(16, 185, 129, 0.2);
  }
}

/* HARDENING: Smooth transitions for precheck displays */
.processing-precheck,
.processing-stats {
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}
.processing-precheck.visible,
.processing-stats.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Security Warnings Styles */
.precheck-security-warnings {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}
.security-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  margin-bottom: 0.375rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}
.security-warning:last-child {
  margin-bottom: 0;
}
.security-warning .warning-icon {
  flex-shrink: 0;
}
.security-warning .warning-text {
  flex: 1;
  line-height: 1.3;
}
.security-warning.severity-info {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}
.security-warning.severity-warning {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
}
.security-warning.severity-concern {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}
.security-warning.severity-critical {
  background: rgba(190, 18, 60, 0.12);
  color: #be123c;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .precheck-security-warnings {
    border-top-color: rgba(239, 68, 68, 0.3);
  }
  .security-warning {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
  }
  .security-warning.severity-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
  }
  .security-warning.severity-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
  }
  .security-warning.severity-critical {
    background: rgba(190, 18, 60, 0.2);
    color: #fda4af;
  }
}

/* ACCESSIBILITY: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .processing-precheck,
  .processing-stats,
  .security-warning,
  .precheck-quality {
    transition: none;
    animation: none;
  }
  .processing-precheck.visible,
  .processing-stats.visible {
    opacity: 1;
    transform: none;
  }
}

/* Document Quality Indicator Styles */
.precheck-quality {
  margin-top: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  transition: opacity 0.2s ease-out;
}
.precheck-quality.quality-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.precheck-quality.quality-low {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

@media (prefers-color-scheme: dark) {
  .precheck-quality.quality-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
  }
  .precheck-quality.quality-low {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.3);
  }
}

/* ============================================================================
   PRINT STYLES - Fix PDF Generation Hang
   Solves: Animation loops, page-break issues, font loading timeouts
   ============================================================================ */
@media print {
  /* 1. Kill ALL animations to satisfy PDF renderer "networkidle0" wait */
  *,
  *::before,
  *::after {
    animation-play-state: paused !important;
    transition: none !important;
    animation: none !important;
    animation-duration: 0s !important;
  }

  /* 2. Flatten layouts to prevent page-break calculation loops */
  body,
  .app-container,
  .main-content,
  .results-container,
  .analysis-results {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
    color: black !important;
  }

  /* 3. Hide interactive UI elements not needed in PDF */
  .nav,
  .navigation,
  .hero-actions,
  .advanced-toggle,
  .export-section,
  .new-analysis-btn,
  .floating-cta,
  #roastToggle,
  .roast-toggle,
  .radar-spinner,
  .spinner,
  .loading-spinner,
  .pulse-animation,
  .connection-status,
  .upload-zone,
  .file-input,
  .btn--secondary,
  .share-buttons,
  .copy-btn,
  .toast,
  .modal,
  .modal-overlay,
  footer,
  .footer {
    display: none !important;
  }

  /* 4. Prevent risk cards from being cut across pages */
  .risk-card,
  .finding-card,
  .red-flag-card,
  .good-term-card,
  .recommendation-card,
  .battle-card,
  .priority-fix,
  section,
  article {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
  }

  /* 5. Force system fonts for faster PDF rendering */
  body,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  div,
  li,
  td,
  th {
    font-family: Helvetica, Arial, sans-serif !important;
  }

  /* 6. Ensure readable contrast for printing */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #000 !important;
  }

  p,
  span,
  li,
  td {
    color: #333 !important;
  }

  /* 7. Fix severity badges for print */
  .severity-badge,
  .risk-level,
  .severity {
    border: 1px solid currentColor !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 8. Ensure links are visible but not clickable blue */
  a {
    color: #333 !important;
    text-decoration: underline !important;
  }

  /* 9. Page margins and headers */
  @page {
    margin: 1.5cm;
    size: A4;
  }

  /* 10. Force content width for consistent PDF output */
  .container,
  .content-wrapper,
  .results-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* =====================================================================
     v17.1 ENHANCED PRINT STYLES - Magazine-Style Layout
     Fixes: Gemini gap analysis - "Boring PDF" issue
     ===================================================================== */

  /* REPORT HEADER - Professional header with metadata */
  .report-header,
  .analysis-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
  }

  .report-header h1,
  .analysis-header h1 {
    font-size: 28pt !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
  }

  .report-meta,
  .analysis-meta {
    text-align: right;
    font-size: 10pt;
    color: #64748b;
  }

  /* SCORE DASHBOARD - Visual score presentation */
  .score-hero,
  .verdict-section,
  .score-section {
    display: flex !important;
    gap: 20px;
    margin-bottom: 30px;
    background: #f8fafc !important;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .score-circle,
  .verdict-score,
  .risk-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #0f172a !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24pt;
    font-weight: 800;
    flex-shrink: 0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* GRID LAYOUT FOR FINDINGS - Two Column Layout */
  .risk-grid,
  .findings-grid,
  .red-flags-list,
  .good-terms-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  /* CARDS - Styled risk cards */
  .risk-card,
  .finding-card,
  .red-flag-card,
  .good-term-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1px solid #cbd5e1 !important;
    padding: 15px;
    border-radius: 8px;
    background: white !important;
  }

  .risk-card.critical,
  .finding-card.critical,
  .red-flag-card.critical {
    border-left: 6px solid #ef4444 !important;
  }

  .risk-card.high,
  .finding-card.high {
    border-left: 6px solid #f97316 !important;
  }

  .risk-card.medium,
  .finding-card.medium {
    border-left: 6px solid #f59e0b !important;
  }

  /* BATTLE DECK VISUALS - Negotiation Cards */
  .battle-card,
  .negotiation-card {
    display: flex !important;
    margin-bottom: 15px;
    break-inside: avoid !important;
    border: 1px solid #000;
    background: white !important;
  }

  .battle-left,
  .current-term {
    flex: 1;
    padding: 10px;
    background: #fee2e2 !important;
    border-right: 1px solid #000;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .battle-right,
  .suggested-term {
    flex: 1;
    padding: 10px;
    background: #dcfce7 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* FINANCIAL SECTION - Table styling */
  .financial-breakdown,
  .financials-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
  }

  .financial-breakdown td,
  .financials-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  /* SECTION HEADERS - Clear section separation */
  .section-title,
  .analysis-section h2,
  .findings-section h3 {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* VERDICT STAMP - Visual stamp effect */
  .verdict-stamp,
  .risk-stamp {
    position: relative;
    border: 3px solid currentColor;
    padding: 8px 16px;
    font-weight: 800;
    text-transform: uppercase;
    transform: rotate(-5deg);
    display: inline-block;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .verdict-stamp.danger,
  .risk-stamp.danger {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
  }

  .verdict-stamp.caution,
  .risk-stamp.caution {
    color: #f59e0b !important;
    border-color: #f59e0b !important;
  }

  .verdict-stamp.safe,
  .risk-stamp.safe {
    color: #059669 !important;
    border-color: #059669 !important;
  }

  /* QUESTIONS SECTION - Numbered list */
  .questions-list ol {
    counter-reset: question-counter;
  }

  .questions-list li {
    counter-increment: question-counter;
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
  }

  .questions-list li::before {
    content: counter(question-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: #0066ff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ============================================================================
   v18.0: Mobile Browser Compatibility (iOS/Android App Store Standards)
   ============================================================================ */

/* === Touch Target Enforcement === */
/* WCAG 2.5.5 / Apple HIG 44pt / Material Design 48dp */
@media (pointer: coarse) {
  .btn,
  button,
  a.btn,
  input[type="submit"],
  input[type="button"],
  .nav-link,
  .footer-link {
    min-height: 44px;
    min-width: 44px;
  }

  /* Increase spacing between tappable elements */
  .btn + .btn,
  .nav-link + .nav-link {
    margin-left: 8px;
  }
}

/* === Safe Area Insets (Notch/Dynamic Island Support) === */
@supports (padding: env(safe-area-inset-top)) {
  .nav,
  .header,
  .nav-enterprise {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .footer,
  .footer-enterprise {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Full-width elements need horizontal safe areas */
  .hero,
  .section,
  .container {
    padding-left: max(var(--space-md), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-md), env(safe-area-inset-right, 0px));
  }
}

/* === Mobile Font Size Minimums (iOS 11pt / Android 12sp) === */
@media (max-width: 768px) {
  body {
    font-size: max(16px, 1rem); /* Prevents auto-zoom on iOS inputs */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Ensure readable text on small screens */
  p,
  li,
  td,
  th,
  label {
    font-size: max(14px, 0.875rem);
    line-height: 1.5;
  }

  /* Form inputs must be 16px+ to prevent iOS zoom */
  input,
  textarea,
  select {
    font-size: max(16px, 1rem);
  }

  .text-xs,
  .text-sm {
    font-size: max(12px, 0.75rem);
  }
}

/* === Tablet Responsive (iPad/Android Tablets) === */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }

  /* Two-column layouts for tablets */
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Reduced Motion (Accessibility) === */
@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;
  }

  .btn:hover,
  .btn:active {
    transform: none !important;
  }
}

/* === Touch-Specific Interactions === */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects that don't work on touch */
  .btn:hover {
    transform: none;
  }

  /* Enhanced active states for touch feedback */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .btn-primary:active {
    background: var(--primary-dark);
  }

  .btn-secondary:active {
    background: var(--gray-200);
  }

  /* Cards should have tap feedback */
  .card:active,
  .feature-card:active,
  .pricing-card:active {
    transform: scale(0.99);
    box-shadow: var(--shadow-sm);
  }
}

/* === iOS-Specific Fixes === */
@supports (-webkit-touch-callout: none) {
  /* Prevent text selection on buttons */
  .btn,
  button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Smooth scrolling in scroll containers */
  .scroll-container,
  .overflow-auto,
  .overflow-scroll {
    -webkit-overflow-scrolling: touch;
  }

  /* Fix for 100vh on iOS */
  .min-h-screen,
  .h-screen {
    min-height: -webkit-fill-available;
  }
}

/* === Android-Specific Fixes === */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  /* Prevent input zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  textarea {
    font-size: 16px;
  }
}

/* === Mobile-First Input Improvements === */
@media (max-width: 768px) {
  /* Larger touch targets for form elements */
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 48px;
    padding: var(--space-md);
  }

  /* Checkbox and radio minimum size */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
  }

  /* Stack form buttons on mobile */
  .form-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* === Landscape Phone Handling === */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-xl) 0;
  }

  .nav {
    padding: var(--space-sm) var(--space-md);
  }
}

/* === High Contrast Mode Support === */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .btn-primary {
    border-color: white;
  }

  .card,
  .feature-card {
    border: 2px solid var(--text);
  }
}

/* === Dark Mode System Preference === */
@media (prefers-color-scheme: dark) {
  /* Ensure proper contrast in system dark mode */
  img {
    filter: brightness(0.95);
  }
}

/* ==========================================================================
   PRINT / PDF GENERATION STYLES
   Applied when JavaScript adds 'is-printing' class before PDF generation
   ========================================================================== */

/* Base print mode styling */
body.is-printing {
  background: #ffffff !important;
  color: #000000 !important;
}

/* HIDE UI ELEMENTS IN PDF */
body.is-printing .nav,
body.is-printing .export-section,
body.is-printing .advanced-toggle,
body.is-printing .v2-show-more-btn,
body.is-printing .actions-checkbox,
body.is-printing .fab-container,
body.is-printing .toast,
body.is-printing .modal-overlay,
body.is-printing #cookieConsent,
body.is-printing .skip-link {
  display: none !important;
}

/* Keep buttons in results for context but style them for print */
body.is-printing .export-actions button,
body.is-printing .action-buttons button {
  display: none !important;
}

/* FORCE WHITE BACKGROUNDS (No dark mode cards) */
body.is-printing .card,
body.is-printing .score-card,
body.is-printing .finding-card,
body.is-printing .risk-card,
body.is-printing .clause-card,
body.is-printing .battle-card,
body.is-printing .priority-fix-card {
  background: #ffffff !important;
  border: 1px solid #ccc !important;
  box-shadow: none !important;
  color: #000 !important;
  margin-bottom: 20px !important;
}

/* FIX PAGE BREAKS - Prevent content from splitting across pages */
body.is-printing .finding-card,
body.is-printing .risk-card,
body.is-printing .action-item,
body.is-printing .clause-card,
body.is-printing .battle-card,
body.is-printing .priority-fix-card,
body.is-printing h2,
body.is-printing h3 {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

/* TYPOGRAPHY CLEANUP - Professional legal document appearance */
body.is-printing {
  font-family: "Georgia", "Times New Roman", serif !important;
  font-size: 11pt !important;
  line-height: 1.5 !important;
}

body.is-printing h1,
body.is-printing h2,
body.is-printing h3 {
  font-family: "Arial", "Helvetica", sans-serif !important;
  color: #000 !important;
  page-break-after: avoid !important;
}

/* EXPAND GRID LAYOUTS - Stack content vertically for consistent printing */
body.is-printing .grid,
body.is-printing .results-grid,
body.is-printing .findings-grid {
  display: block !important;
}

/* Force accordions/details to show content */
body.is-printing details {
  display: block !important;
}

body.is-printing details[open] > summary ~ * {
  display: block !important;
}

/* PDF-only elements (hidden by default, shown in print) */
#pdf-only-header,
#pdf-footer,
.print-only-signature {
  display: none;
}

body.is-printing #pdf-only-header {
  display: block !important;
  border-bottom: 2px solid #000;
  padding-bottom: 20px;
  margin-bottom: 30px;
  text-align: center;
}

body.is-printing #pdf-footer {
  display: block !important;
}

body.is-printing .print-only-signature {
  display: block !important;
  margin-top: 50px;
  page-break-inside: avoid !important;
}

/* Ensure proper link styling in print */
body.is-printing a {
  color: #000 !important;
  text-decoration: underline !important;
}

/* Score badges - make readable in B&W */
body.is-printing .score-badge,
body.is-printing .risk-level,
body.is-printing .severity-badge {
  border: 2px solid #333 !important;
  background: transparent !important;
  color: #000 !important;
}
