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

/* ===================================
   MODERN DESIGN SYSTEM
   Clean, Professional Clinical Research Platform
   =================================== */

:root {
    /* Brand Colors - Clinical Blue & Fresh Accent */
    --brand-primary: #0066CC;
    --brand-secondary: #0052A3;
    --brand-accent: #00D4AA;
    --brand-dark: #001F3F;
    --brand-light: #E6F2FF;
    
    /* Neutral Palette */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-on-dark: #FFFFFF;
    
    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    
    /* Borders */
    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;
    --border-dark: #94A3B8;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --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);
}

/* ===================================
   BASE RESET
   =================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--brand-secondary);
}

strong { font-weight: 600; }

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--brand-dark);
}

/* ===================================
   FORM ELEMENTS
   =================================== */

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

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

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-dark);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===================================
   LAYOUT
   =================================== */

.page-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

main {
    position: relative;
}

/* ===================================
   NAVIGATION
   =================================== */

.global-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    margin: calc(var(--spacing-xl) * -1) calc(var(--spacing-lg) * -1) var(--spacing-2xl);
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.nav-brand strong {
    font-size: 1.125rem;
    color: var(--text-primary);
    display: block;
}

.nav-brand small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: -2px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.nav-links a {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.938rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.nav-cta {
    background: var(--brand-primary);
    color: var(--text-on-dark);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.938rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.nav-cta:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: var(--text-on-dark);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 212, 170, 0.1) 100%);
    pointer-events: none;
}

.hero-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-lg);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: var(--text-on-dark);
}

.hero-title-sub {
    display: block;
    font-size: 0.5em;
    font-weight: 500;
    opacity: 0.9;
    margin-top: var(--spacing-sm);
}

.lede {
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin-bottom: var(--spacing-xl);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-card span {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.metric-card strong {
    display: block;
    font-size: 1.5rem;
    color: var(--text-on-dark);
    font-weight: 700;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    background: var(--text-on-dark);
    color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-on-dark);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-on-dark);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn svg,
.btn i {
    width: 20px;
    height: 20px;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

/* ===================================
   CARDS
   =================================== */

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

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

.card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.card p {
    color: var(--text-secondary);
    font-weight: 500;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--brand-light);
    color: var(--brand-primary);
    border: 1px solid var(--border-light);
}

.stack-pill {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    border: 1px solid var(--border-light);
    font-size: 0.938rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.timeline {
    position: relative;
    padding-left: var(--spacing-xl);
    border-left: 2px solid var(--border-light);
}

.timeline-step {
    position: relative;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: calc(var(--spacing-xl) * -1 - 10px);
    top: var(--spacing-lg);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand-primary);
    border: 3px solid var(--bg-secondary);
}

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

@media (max-width: 768px) {
    .global-nav {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links.is-open {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .cta-row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   FOOTER
   =================================== */

footer {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.938rem;
}

/* ===================================
   PAGE-SPECIFIC COMPONENTS
   =================================== */

/* Backend Demo - API Components */
.endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmin(260px, 1fr));
    gap: var(--spacing-lg);
}

.endpoint-card {
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: all var(--transition-base);
}

.endpoint-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.method-pill {
    align-self: flex-start;
    border-radius: var(--radius-full);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method-post {
    background: rgba(139, 92, 246, 0.15);
    color: #7C3AED;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.method-get {
    background: rgba(59, 130, 246, 0.15);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.method-put {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.method-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid var(--gray-700);
}

.request-lab {
    display: grid;
    gap: var(--spacing-lg);
}

.log-window {
    background: var(--gray-900);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    font-family: 'JetBrains Mono', monospace;
    min-height: 180px;
    border: 1px solid var(--gray-700);
    overflow-x: auto;
}

.log-line {
    color: var(--gray-100);
    font-size: 0.875rem;
    line-height: 1.8;
    font-family: 'JetBrains Mono', monospace;
}

.contract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.contract-grid article {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

/* Screening Demo Components */
.scenario-chip {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 500;
}

.scenario-chip:hover {
    border-color: var(--brand-primary);
    background: var(--brand-light);
    color: var(--brand-primary);
}

.screening-form {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.screening-form {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.result-panel {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-medium);
    background: var(--bg-primary);
}

.result-panel.pending {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.result-panel.eligible {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.result-panel.ineligible {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.log-entry {
    margin-bottom: var(--spacing-xs);
    color: var(--gray-100);
    font-weight: 500;
    font-size: 0.875rem;
}

.criteria-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: var(--spacing-lg);
    font-family: 'JetBrains Mono', monospace;
    margin-top: var(--spacing-lg);
}

.step-list {
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: var(--spacing-md);
}

.step-list li {
    counter-increment: step;
    padding-left: 3rem;
    position: relative;
    line-height: 1.6;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    background: var(--brand-light);
    color: var(--brand-primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid var(--brand-primary);
}

/* File Upload Components */
.status-banner {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
}

.status-banner.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.status-banner.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

