/* AskHealth AI - Calm SaaS + Docs-Grade Readability */

:root {
    --color-primary: #0070f3;
    --color-text: #1a1a1a;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    --color-background: #fdfdfd;
    --color-surface: #ffffff;
    --color-border: #e1e1e1;
    --color-border-light: #f5f5f5;
    --color-success: #0070f3;
    --color-warning: #f59e0b;
    --radius-sm: 6px;
    --radius-lg: 8px;
    --container-width: 1120px;
    --content-width: 760px;
    --section-spacing: 64px;
    --section-spacing-sm: 48px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Base Typography & Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    margin: 0;
    padding: 0;
    color: var(--color-text);
    background: var(--color-background);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip to main content for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 6px;
}

/* Layout Primitives */
.page {
    min-height: 100vh;
    background: var(--color-background);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    background: var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-border);
    min-height: 100vh;
}

.content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--section-spacing) 40px;
}

.section {
    margin-bottom: var(--section-spacing);
}

.section:last-child {
    margin-bottom: 0;
}

/* Page Hero */
.page-hero {
    text-align: center;
    padding: var(--section-spacing) 40px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.page-hero h1 {
    margin: 0 0 16px 0;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--color-text);
}

.page-hero p {
    margin: 0 0 32px 0;
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Homepage Hero with Gradient */
.hero {
    background: linear-gradient(135deg, #0070f3 0%, #0051cc 100%);
    color: white;
    text-align: center;
    padding: 96px 40px;
}

.hero h1 {
    margin: 0 0 24px 0;
    font-size: 3.25rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
    color: white;
}

.hero p {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: white;
}

/* Inner Page Headers */
header {
    text-align: center;
    padding: var(--section-spacing-sm) 40px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

header h1 {
    margin: 0 0 12px 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--color-text);
}

header p {
    margin: 0;
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    max-width: none;
}

/* Typography System - Docs Grade */
h1 {
    color: var(--color-text);
    margin: 0 0 32px 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

h2 {
    color: var(--color-text);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 48px 0 24px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

h2:first-child {
    margin-top: 0;
}

h3 {
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 16px 0;
    line-height: 1.4;
}

h3:first-child {
    margin-top: 0;
}

p {
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin: 0 0 20px 0;
    font-size: 16px;
    max-width: 70ch;
}

/* Remove max-width constraint for card/grid content */
.feature-item p,
.feature-card p,
.trust-item p,
.step p {
    max-width: none;
}

ul, ol {
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin: 0 0 20px 0;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: var(--color-text);
    font-weight: 600;
}

em {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Focus indicators for accessibility */
a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Icon System */
.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    flex: 0 0 auto;
    vertical-align: -0.125em;
    color: var(--color-primary);
}

.icon-lg {
    width: 22px;
    height: 22px;
}

.icon-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.icon-warning {
    color: var(--color-warning);
}

.icon-invert {
    color: #fff;
}

.icon-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
}

.icon-block .icon {
    margin-right: 0;
    color: var(--color-primary);
}

/* Navigation */
.primary-nav {
    background: var(--color-surface);
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.primary-nav a {
    margin: 0 16px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
}

.primary-nav a:hover, .primary-nav a:focus {
    background: var(--color-border-light);
    color: var(--color-text);
}

.primary-nav a[aria-current="page"] {
    background: var(--color-primary);
    color: white;
}

@media (max-width: 768px) {
    .primary-nav a {
        margin: 6px;
        display: inline-block;
        min-height: 44px;
        line-height: 28px;
        padding: 8px 16px;
    }
}

/* Content Areas */
main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--section-spacing) 40px;
}

/* Callouts */
.callout {
    background: #fffbf0;
    border: 1px solid #e5e5e5;
    border-left: 3px solid var(--color-warning);
    padding: 20px;
    margin: 32px 0;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.callout strong {
    color: var(--color-text);
    font-weight: 600;
}

.callout p {
    margin-bottom: 12px;
}

.callout p:last-child {
    margin-bottom: 0;
}

/* Specific callout types */
.disclaimer {
    background: #fffbf0;
    border: 1px solid #e5e5e5;
    border-left: 3px solid var(--color-warning);
    padding: 20px;
    margin: 32px 0;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.alert {
    background: #fef2f2;
    border: 1px solid #e5e5e5;
    border-left: 3px solid #dc2626;
    padding: 20px;
    margin: 32px 0;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 15px;
}

/* Navigation Buttons */
.nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 48px 0;
}

.nav-buttons a {
    display: block;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-buttons a:hover, .nav-buttons a:focus {
    border-color: var(--color-primary);
    color: var(--color-text);
}

/* Footer */
footer {
    text-align: center;
    padding: 48px 40px;
    border-top: 1px solid var(--color-border);
    margin-top: var(--section-spacing);
    color: var(--color-text-muted);
    font-size: 14px;
    background: var(--color-surface);
}

footer p {
    margin: 8px 0;
    max-width: none;
}

footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
    margin: 0 12px;
    font-weight: 500;
}

footer a:hover, footer a:focus {
    color: var(--color-text);
}

/* CTA Row */
.cta-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin: 32px 0;
    flex-wrap: wrap;
}

/* CTA Components */
.cta {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.5;
}

.cta-primary {
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
}

.cta-primary:hover, .cta-primary:focus {
    background: #0051cc;
    border-color: #0051cc;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cta-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.cta-secondary:hover, .cta-secondary:focus {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Mobile CTA Requirements */
@media (max-width: 768px) {
    .cta-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta {
        min-height: 44px;
        min-width: 44px;
        padding: 14px 24px;
        width: 100%;
        max-width: 300px;
    }
}

/* Homepage Sections */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin: 32px 0;
}

.feature-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.feature-item h3 {
    margin: 0 0 12px 0;
    color: var(--color-text);
    font-size: 1.125rem;
    font-weight: 600;
}

.feature-item p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
    max-width: none;
}

.section-panel {
    background: var(--color-border-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 32px 0;
}

.how-it-works-brief {
    padding: 40px;
    background: var(--color-border-light);
    border-radius: var(--radius-lg);
    margin: var(--section-spacing) 0;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin: 32px 0;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    line-height: 40px;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 16px;
}

.step p {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: none;
}

.process-note {
    text-align: center;
    font-style: italic;
    color: var(--color-text-secondary);
    background: #fffbf0;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 24px;
    font-size: 14px;
    border: 1px solid #e5e5e5;
}

.trust-signals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin: var(--section-spacing) 0;
}

.trust-item {
    padding: 24px 0 24px 24px;
    border-left: 3px solid var(--color-success);
}

.trust-item strong {
    color: var(--color-text);
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.trust-item p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
    max-width: none;
}

.cta-section {
    text-align: center;
    margin: var(--section-spacing) 0;
    padding: 48px 40px;
    background: var(--color-border-light);
    border-radius: var(--radius-lg);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --section-spacing: 48px;
        --section-spacing-sm: 32px;
    }
    
    .hero {
        padding: 64px 24px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .page-hero {
        padding: var(--section-spacing-sm) 24px;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    header {
        padding: var(--section-spacing-sm) 24px;
    }
    
    header h1 {
        font-size: 1.875rem;
    }
    
    .content, main {
        padding: var(--section-spacing-sm) 24px;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin: 32px 0 20px 0;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .process-steps {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .trust-signals {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .how-it-works-brief {
        padding: 24px;
    }
    
    .cta-section {
        padding: 32px 24px;
    }
    
    footer {
        padding: 32px 24px;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Page-specific overrides for inner pages */
.feature-card, .step-detail {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin: 20px 0;
}

.feature-card h3, .step-detail h3 {
    color: var(--color-text);
    margin-top: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.privacy-highlight, .medical-reminder, .wellness-scope, .ai-highlight {
    background: #fffbf0;
    border: 1px solid #e5e5e5;
    border-left: 3px solid var(--color-warning);
    padding: 20px;
    margin: 32px 0;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.ai-highlight {
    background: linear-gradient(135deg, #0070f3 0%, #0051cc 100%);
    color: white;
    border: none;
    text-align: center;
}

.ai-highlight h2, .ai-highlight h3 {
    color: white;
    margin-top: 0;
}

.ai-highlight p {
    color: white;
    opacity: 0.95;
}