:root {
    /* Design System - A11y Avaliator */
    /* Cores principais */
    --primary: #001f3f;
    --primary-dark: #001529;
    --secondary: #2E7D32;
    --secondary-light: #A5D6A7;
    
    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-gradient-start: #002147;
    --bg-gradient-end: #003d82;
    
    /* Texto */
    --text-primary: #222222;
    --text-secondary: #222222;
    --text-muted: #666666;
    --text-on-primary: #ffffff;
    
    /* Bordas e sombras */
    --border-color: #e0e0e0;
    --border-color-light: #e5e5e5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(13, 71, 161, 0.15);
    
    /* Cards */
    --card-bg: #ffffff;
    
    /* Status colors */
    --success-bg: #E8F5E9;
    --success-border: #A5D6A7;
    --success-text: #2E7D32;
    
    --error-bg: #FFEBEE;
    --error-border: #EF9A9A;
    --error-text: #C62828;
    
    --warning-bg: #FFF3E0;
    --warning-border: #FFCC80;
    --warning-text: #E65100;
    
    --info-bg: #E3F2FD;
    --info-border: #1976D2;
    --info-text: #0D47A1;
    
    /* Links */
    --link-color: #1e40af;
    --link-hover: #1e3a8a;
    
    /* Code */
    --code-bg: #f9f9f9;
    --code-border: #1e40af;
    --code-text: #333333;
    
    /* Buttons */
    --button-primary-bg: #0D47A1;
    --button-primary-hover: #01579B;
    --button-secondary-bg: #ffffff;
    --button-secondary-border: #0D47A1;
    
    /* Skip Links */
    --skip-link-bg: #000000;
    --skip-link-text: #ffffff;
    --button-secondary-hover-bg: #0D47A1;
    --button-secondary-hover-text: #ffffff;
    
    /* Focus indicators - WCAG 2.1 AA compliant */
    --focus-outline-color: #0D47A1;
    --focus-outline-width: 3px;
    --focus-outline-offset: 2px;
    --focus-shadow: 0 0 0 3px rgba(13, 71, 161, 0.25);
}

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

/* ========================================
   SKIP LINKS - WCAG 2.4.1 BYPASS BLOCKS (LEVEL A)
   ======================================== */

.skip-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

.skip-links a {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    white-space: nowrap;
    border: 0;
}

.skip-links a:focus,
.skip-links a:focus-visible,
.skip-links a:active {
    position: absolute;
    top: 0;
    left: 0;
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    margin: 0;
    overflow: visible;
    padding: 12px 20px;
    background: var(--skip-link-bg);
    color: var(--skip-link-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    border: none;
    border-radius: 0 0 4px 0;
    white-space: nowrap;
    outline: 3px solid var(--skip-link-text);
    outline-offset: -3px;
    z-index: 10000;
}

.skip-links a:nth-child(2):focus,
.skip-links a:nth-child(2):focus-visible,
.skip-links a:nth-child(2):active {
    left: 200px;
}

.skip-links a:nth-child(3):focus,
.skip-links a:nth-child(3):focus-visible,
.skip-links a:nth-child(3):active {
    left: 400px;
}

/* ========================================
   FOCUS INDICATORS - WCAG 2.1 AA COMPLIANT
   ======================================== */

/* Global focus styles for all interactive elements */
a:focus-visible,
a:focus-within,
a:focus,
button:focus-visible,
button:focus-within,
button:focus,
input:focus-visible,
input:focus-within,
input:focus,
select:focus-visible,
select:focus-within,
select:focus,
textarea:focus-visible,
textarea:focus-within,
textarea:focus,
[tabindex]:focus-visible,
[tabindex]:focus-within,
[tabindex]:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Ensure hover doesn't remove focus styles */
a:hover:focus-visible,
a:hover:focus-within,
a:hover:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-on-primary);
    padding: 3rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-on-primary);
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 1;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.98);
}

nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    display: flex;
    gap: 2rem;
    padding: 1rem 2rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

main {
    padding: 3rem 0;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #000000;
    font-weight: 700;
}


h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.btn {
    display: inline-block;
    background: var(--button-primary-bg);
    color: var(--text-on-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--button-primary-hover);
}

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--code-text);
    border: 1px solid var(--border-color-light);
}

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    background: transparent;
    padding: 0;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.feature h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

ol, ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:focus-visible,
a:focus-within,
a:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(to bottom, #f0f9ff, #ffffff);
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    color: #001f3f;
    margin-bottom: 1rem;
    font-weight: 700;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333333;
    max-width: 800px;
    margin: 0 auto 2rem;
    font-weight: 600;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--button-primary-bg);
    color: var(--text-on-primary);
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--button-primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--primary);
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--button-secondary-border);
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--button-secondary-hover-bg);
    color: var(--button-secondary-hover-text);
    text-decoration: none;
}

/* Highlight Section */
.highlight-section {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    padding: 2rem;
    border-radius: 8px;
    margin: 3rem 0;
}

.highlight-section h2 {
    color: #8B3A00;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Stats Grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color-light);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #222222;
    font-size: 1rem;
    font-weight: 500;
}

.text-center {
    text-align: center;
    margin-top: 1.5rem;
}

/* Guide Grid */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.guide-card {
    background: var(--card-bg);
    border: 2px solid #757575;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.guide-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.guide-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.guide-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.use-case {
    background: var(--info-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--info-border);
}

.use-case h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.use-case p {
    color: #0D47A1;
    font-size: 0.95rem;
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-on-primary);
    padding: 3rem 2rem;
    border-radius: 12px;
    margin: 3rem 0;
}

.cta-section h2 {
    color: var(--text-on-primary);
    margin-bottom: 1rem;
}

.cta-section .lead {
    color: rgba(255, 255, 255, 0.95);
}

.cta-steps {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cta-steps .step {
    text-align: center;
}

.step-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.cta-steps .step p {
    color: var(--text-on-primary);
    font-weight: 500;
}

.cta-steps .step a {
    color: var(--text-on-primary);
    text-decoration: underline;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: inline-block;
}

/* Learning Grid */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.learning-card {
    background: var(--card-bg);
    border: 2px solid #757575;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.learning-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.learning-card h3 {
    color: #1a5c1a;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.learning-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* ========================================
   SIDEBAR NAVIGATION FOR INTERNAL PAGES
   ======================================== */

/* Layout wrapper com sidebar */
body {
    display: flex;
    min-height: 100vh;
}

/* Esconder sidebar na página index */
body:has(.hero-section) .sidebar,
body:has(.hero) .sidebar {  
    display: none;
}

body:has(.hero-section) .main-content,
body:has(.hero) .main-content {
    margin-left: 0;
    max-width: 100%;
}

body.index-page{
    flex-direction: column;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 2rem 0;
    flex-shrink: 0;
}

.construction-badge {
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    display: inline-block;
    padding: 0.2rem 1rem;
    margin: 0 1rem 1rem 1rem;
    border: 1px solid #FF8C42;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.nav-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 0;
}

.sidebar a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background-color: var(--card-bg);
}

.sidebar a:hover {
    background-color: #E3F2FD;
    border-left-color: var(--primary);
    color: var(--text-primary);
}

.sidebar a.active {
    background-color: var(--primary);
    border-left-color: var(--primary-dark);
    color: var(--text-on-primary);
    font-weight: 600;
}

.nav-group {
    margin: 1.5rem 0;
}

.nav-group > strong {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-group ul {
    margin-top: 0.5rem;
}

.nav-group ul li a {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

.search-input {
    width: 50%;
    margin: 1.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

/* Main content with sidebar */
.main-content {
    flex: 1;
    min-height: 100vh;
    padding: 2rem;
    max-width: calc(100% - 280px);
}

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-on-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header .subtitle {
    font-size: 1.2rem;
    color: var(text-on-primary);
    font-weight: 500;
}

.content {
    max-width: 900px;
}

.page-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* Sidebar focus styles */
.sidebar a:focus-visible,
.sidebar a:focus-within,
.sidebar a:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: -2px;
    background: #E3F2FD;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Mobile sidebar */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
        min-width: 250px;
    }
    
    .main-content {
        max-width: calc(100% - 250px);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        min-width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        max-width: 100%;
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

/* ========================================
   SPECIFIC FOCUS STYLES FOR COMPONENTS
   WCAG 2.1 AA - Keyboard Navigation
   ======================================== */

/* Buttons - Primary, Secondary, and Generic */
.btn:focus-visible,
.btn:focus-within,
.btn:focus,
.btn-primary:focus-visible,
.btn-primary:focus-within,
.btn-primary:focus,
.btn-secondary:focus-visible,
.btn-secondary:focus-within,
.btn-secondary:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Button hover states should preserve focus indicators */
.btn:hover:focus-visible,
.btn:hover:focus-within,
.btn:hover:focus,
.btn-primary:hover:focus-visible,
.btn-primary:hover:focus-within,
.btn-primary:hover:focus,
.btn-secondary:hover:focus-visible,
.btn-secondary:hover:focus-within,
.btn-secondary:hover:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Guide Cards */
.guide-card:focus-visible,
.guide-card:focus-within,
.guide-card:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
    border-color: var(--primary);
}

.guide-card:hover:focus-visible,
.guide-card:hover:focus-within,
.guide-card:hover:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Learning Cards */
.learning-card:focus-visible,
.learning-card:focus-within,
.learning-card:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
    border-color: var(--secondary);
}

.learning-card:hover:focus-visible,
.learning-card:hover:focus-within,
.learning-card:hover:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* Navigation Links */
nav a:focus-visible,
nav a:focus-within,
nav a:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    background: #E3F2FD;
    box-shadow: var(--focus-shadow);
}

/* Footer Links */
footer a:focus-visible,
footer a:focus-within,
footer a:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

/* CTA Section Links - High contrast for links on gradient background */
.cta-section a:focus-visible,
.cta-section a:focus-within,
.cta-section a:focus {
    outline: 3px solid var(--text-on-primary);
    outline-offset: var(--focus-outline-offset);
    box-shadow: 0 0 0 3px rgba(209, 17, 17, 0.3);
}

/* Stat Cards - if they become clickable */
.stat-card:focus-visible,
.stat-card:focus-within,
.stat-card:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-outline-offset);
    box-shadow: var(--focus-shadow);
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    nav .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cta-steps {
        gap: 1.5rem;
    }
}
