/* ================================================================
   MANUAL PRÁTICO WCAG 2.2 - DESIGN SYSTEM COMPLETO
   ================================================================ */

:root {
    /* --- Cores Base (Light Mode) --- */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;
    --header-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    
    /* --- Cores de Conformidade (WCAG 1.4.3) --- */
    --level-a-bg: #e0f2fe;    --level-a-text: #0369a1;
    --level-aa-bg: #dcfce7;   --level-aa-text: #15803d;
    --level-aaa-bg: #fef3c7;  --level-aaa-text: #b45309;

    /* --- Sombras (Material Design) --- */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- CONFIGURAÇÃO MODO DARK (SC 1.4.3) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-page: #0f172a;
        --bg-card: #1e293b;
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --primary: #60a5fa;
        --header-gradient: linear-gradient(135deg, #020617 0%, #1e3a8a 100%);
        
        /* Ajuste de Badges para Dark Mode */
        --level-a-bg: rgba(56, 189, 248, 0.2);     --level-a-text: #7dd3fc;
        --level-aa-bg: rgba(74, 222, 128, 0.2);    --level-aa-text: #86efac;
        --level-aaa-bg: rgba(251, 191, 36, 0.2);   --level-aaa-text: #fcd34d;
    }
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

button {
    background: rgba(128, 128, 128, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    border-radius: 12px;
    min-height: 40px;
    padding: 8px 12px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- ACESSIBILIDADE --- */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* --- HEADER --- */
.main-header {
    background: var(--header-gradient);
    color: white !important;
    padding: 80px 0;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}
.main-header h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: white; }

.main-header .version {
    font-size:0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px 12px;
    vertical-align: middle;
}

/* --- SECÇÕES DE INFORMAÇÃO --- */
.info-section { padding: 40px 0; }
.section-title { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.section-title h2 { font-size: clamp(1.6rem, 5vw, 2.5rem); font-weight: 800; color: var(--text-main); }

.intro-text { 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    line-height: 1.8; 
}

.gray-bg {
    background-color: var(--bg-card);
    padding: 40px 24px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin: 40px 0;
}

/* Info Grid (Princípios POUR) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.info-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    border-top: 5px solid var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--text-main);
}
.info-card h3 { margin-bottom: 10px; }
.info-card h3 span { color: var(--primary); font-size:2rem; font-weight: 900; }

/* Role Boxes */
.roles-explanation {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.role-box {
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
    color: var(--text-main);
}

.role-box:last-child {
    grid-column: 1 / -1;
    max-width: 100%;
}

.role-box::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.role-box.design::before { background: #ec4899; }
.role-box.development::before { background: #3b82f6; }
.role-box.content::before { background: #8b5cf6; }
.role-box.product::before { background: #06b6d4; }
.role-box.qa::before { background: #10b981; }

.role-box strong { display: block; margin-bottom: 8px; font-size: 1.1rem; color: var(--text-main); }

.role-box ul { list-style-type: disc; padding-left: 20px; margin-block: 1.5rem; }
.role-box ul li { margin-bottom: 8px; line-height: 1.5 }

.footnote {
    border: 1px solid var(--border-color);
    background-color: rgba(96, 165, 250, 0.1);
    color: var(----level-aaa-text);
    font-size: 0.9rem;
    margin-top: 10px;
    border-radius: 8px;
    padding: 12px 16px;
}

/* --- EXPLORER & FILTROS (STICKY) --- */
.controls {
    display: flex; flex-wrap: wrap; gap: 20px;
    background: var(--bg-card); padding: 24px;
    border-radius: 20px; margin-bottom: 50px;
    position: sticky; top: 20px; z-index: 100;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.search-box { flex: 2; min-width: 300px; position: relative; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input, .filters select {
    width: 100%; padding: 14px; background: var(--bg-page);
    border: 2px solid var(--border-color); border-radius: 12px;
    color: var(--text-main); font-size: 1rem;
}
.search-box input { padding-left: 48px; }
.filters { flex: 1; display: flex; gap: 12px; min-width: 300px; }

/* --- GRID DE CARTÕES WCAG --- */
.wcag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}
.wcag-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 20px; padding: 30px; display: flex; flex-direction: column;
    transition: var(--transition); box-shadow: var(--shadow-sm);
    color: var(--text-main);
}
.wcag-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--primary); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.sc-number { font-weight: 800; font-size: 0.85rem; color: var(--text-muted); background: rgba(128,128,128,0.1); padding: 4px 10px; border-radius: 8px; }
.sc-principle { font-weight: 600; font-size: 0.85rem; color: var(--primary); background: rgba(96, 165, 250, 0.1); padding: 4px 10px; border-radius: 8px; }

.card-footer .tags {
    display:flex; gap: 8px; flex-wrap: wrap;
}

.level-badge { padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 0.7rem; text-transform: uppercase; }

.level-A { background: var(--level-a-bg); color: var(--level-a-text); }
.level-AA { background: var(--level-aa-bg); color: var(--level-aa-text); }
.level-AAA { background: var(--level-aaa-bg); color: var(--level-aaa-text); }

.short-desc { color: var(--primary); font-weight: 700; margin: 10px 0; font-size: 1.1rem; }
.all-roles-summary { 
    background: rgba(128,128,128,0.05); 
    padding: 16px; border-radius: 12px; 
    margin-top: 15px; border: 1px solid var(--border-color); 
}
.all-roles-summary p { font-size: 0.85rem; padding: 8px 0; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.all-roles-summary p:last-child { border: none; }
.all-roles-summary strong { color: var(--primary); }

.doc-link { margin-top: auto; color: var(--primary); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.doc-link:hover { text-decoration: underline; }

.no-results {
    text-align: center;
    grid-column: 1 / -1;
}

.no-results p {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

.no-results button {
    font-size: 1rem;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .controls { position: static; padding: 16px; }
    .filters { flex-direction: column; }
    .main-header { padding: 60px 0; }
    .wcag-grid { grid-template-columns: 1fr; }
}

/* --- FOOTER --- */
.main-footer {
    padding: 30px 0;
    text-align: center;
    margin-top: 30px;
}

.main-footer a:hover {
    text-decoration: underline;
}

.main-footer a {
    color: var(--level-a-text);
}

