/* Skip link (acessibilidade) */
        .skip-link { position: absolute; top: -40px; left: 0; background: #0A4D68; color: #fff; padding: 8px 16px; z-index: 9999; font-size: 14px; border-radius: 0 0 4px 0; transition: top .2s; text-decoration: none; }
        .skip-link:focus { top: 0; }
        /* --- VARIABLES --- */
        :root {
            --primary: #0A4D68;       
            --primary-dark: #06384d;
            --accent: #047857;        
            --secondary: #D97706;     
            --bg-body: #FAFAF9;       
            --bg-card: #FFFFFF;
            --text-main: #1C1917;     
            --text-muted: #57534E;    
            --border-subtle: #E7E5E4; 
            --container-width: 1200px;
            --header-height: 90px;
        }

        [data-theme="dark"] {
            --bg-body: #0C0A09;
            --bg-card: #1C1917;
            --text-main: #F5F5F4;
            --text-muted: #A8A29E;
            --primary: #38BDF8;
            --accent: #34D399;
            --border-subtle: #292524;
        }

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

        body {
            font-family: 'Source Sans 3', sans-serif;
            background-color: var(--bg-body);
            color: var(--text-main);
            line-height: 1.7;
            -webkit-font-smoothing: antialiased;
            transition: background-color 0.5s ease, color 0.5s ease;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        h1, h2, h3, h4 {
            font-family: 'Playfair Display', serif;
            font-weight: 700;
            color: var(--primary);
            letter-spacing: -0.02em;
        }

        a { text-decoration: none; color: inherit; transition: 0.3s ease; }
        ul { list-style: none; }
        img { max-width: 100%; display: block; }

        /* --- LAYOUT --- */
        .container {
            max-width: var(--container-width);
            margin: 0 auto;
            padding: 0 24px;
        }

        /* --- HEADER --- */
        .top-bar {
            background-color: #0A4D68;
            color: #fff;
            padding: 8px 0;
            font-size: 0.85rem;
            position: relative;
            z-index: 1002;
        }
        
        .top-bar .container {
            display: flex;
            justify-content: flex-end;
            gap: 20px;
        }

        /* Lang Selector Styles */
        .lang-selector {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .lang-selector select {
            background: transparent;
            border: none;
            color: #fff;
            font-size: 0.85rem;
            cursor: pointer;
            outline: none;
        }
        .lang-selector select option {
            background-color: #0A4D68;
            color: #fff;
        }

        .main-header {
            background-color: var(--bg-card);
            border-bottom: 1px solid var(--border-subtle);
            position: sticky;
            top: 0;
            z-index: 1000;
            height: var(--header-height);
            box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        }

        .main-header .container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 100%;
        }

        .logo {
            font-family: 'Playfair Display', serif;
            font-size: 2rem;
            font-weight: 700; 
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .nav-menu { display: flex; gap: 32px; }
        .nav-link {
            font-family: 'Source Sans 3', sans-serif;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            position: relative;
        }
        .nav-link:hover, .nav-link.active { color: var(--primary); }
        
        .nav-link::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -4px;
            left: 0;
            background-color: var(--secondary);
            transition: width 0.3s;
        }
        .nav-link:hover::after, .nav-link.active::after { width: 100%; }

        .btn-outline {
            border: 1px solid var(--primary);
            color: var(--primary);
            padding: 8px 24px;
            border-radius: 2px;
            text-transform: uppercase;
            font-size: 0.85rem;
            font-weight: 600;
            letter-spacing: 0.05em;
        }
        .btn-outline:hover { background-color: var(--primary); color: #fff; }

        /* --- PAGE HEADER --- */
        .page-header {
            padding: 60px 0 40px;
            text-align: center;
            background-color: var(--bg-body);
        }

        .page-header h1 {
            font-size: 3.5rem;
            margin-bottom: 15px;
        }

        .page-header p {
            font-size: 1.2rem;
            color: var(--text-muted);
            max-width: 700px;
            margin: 0 auto;
        }

        /* --- CATEGORY FILTER --- */
        .category-filter-section {
            background-color: var(--bg-body);
            padding: 0 0 40px;
            position: sticky;
            top: var(--header-height);
            z-index: 900;
            border-bottom: 1px solid transparent;
            transition: border-color 0.3s;
        }
        
        .category-filter-section.is-pinned {
            border-bottom: 1px solid var(--border-subtle);
            background-color: var(--bg-card);
            padding-top: 20px;
            margin-bottom: 40px;
        }

        .category-scroll-container {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            padding: 10px 5px;
            scrollbar-width: none;
            -ms-overflow-style: none;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .category-scroll-container::-webkit-scrollbar { display: none; }

        .category-btn {
            white-space: nowrap;
            padding: 10px 24px;
            border-radius: 50px;
            border: 1px solid var(--border-subtle);
            background-color: var(--bg-card);
            color: var(--text-muted);
            font-family: 'Source Sans 3', sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .category-btn:hover {
            border-color: var(--secondary);
            color: var(--secondary);
            transform: translateY(-2px);
        }

        .category-btn.active {
            background-color: var(--secondary);
            color: #fff;
            border-color: var(--secondary);
            box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
        }

        /* --- QUIZZES GRID --- */
        .quizzes-section {
            padding-bottom: 100px;
        }

        .quizzes-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 40px;
        }

        /* CARD DESIGN */
        .quiz-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 4px;
            transition: transform 0.3s, box-shadow 0.3s;
            display: flex;
            flex-direction: column;
            padding: 30px 25px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .quiz-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.08);
            border-color: var(--secondary);
        }

        .quiz-card::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, transparent 50%, rgba(217, 119, 6, 0.1) 50%);
            border-bottom-left-radius: 60px;
        }

        .quiz-icon-wrapper {
            width: 80px;
            height: 80px;
            margin: 0 auto 25px;
            background-color: rgba(217, 119, 6, 0.05);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--secondary);
            border: 1px solid rgba(217, 119, 6, 0.2);
            transition: transform 0.3s;
        }

        .quiz-card:hover .quiz-icon-wrapper {
            transform: scale(1.1);
            background-color: var(--secondary);
            color: #fff;
        }

        .card-difficulty {
            font-family: 'Source Sans 3', sans-serif;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            color: var(--text-muted);
            margin-bottom: 10px;
            display: inline-block;
            border: 1px solid var(--border-subtle);
            padding: 4px 10px;
            border-radius: 20px;
        }

        .card-title {
            font-size: 1.6rem;
            line-height: 1.2;
            margin-bottom: 15px;
            color: var(--text-main);
        }
        
        .card-excerpt {
            font-family: 'Source Sans 3', sans-serif;
            font-size: 1rem;
            color: var(--text-muted);
            margin-bottom: 30px;
            flex-grow: 1;
        }

        .btn-quiz {
            background-color: transparent;
            color: var(--secondary);
            border: 2px solid var(--secondary);
            padding: 12px 0;
            width: 100%;
            border-radius: 2px;
            font-family: 'Source Sans 3', sans-serif;
            font-weight: 700;
            text-transform: uppercase;
            font-size: 0.9rem;
            letter-spacing: 0.05em;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-quiz:hover {
            background-color: var(--secondary);
            color: #fff;
        }

        /* --- FOOTER --- */
        footer {
            background-color: #1C1917;
            color: #A8A29E;
            padding: 80px 0 0;
            font-size: 0.95rem;
            font-family: 'Source Sans 3', sans-serif;
            border-top: 4px solid var(--accent);
            margin-top: auto;
        }
        
        .footer-grid {
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
            gap: 50px;
            padding-bottom: 60px;
        }

        .footer h4 {
            color: #fff;
            font-size: 1.3rem;
            margin-bottom: 25px;
            letter-spacing: 0.05em;
            position: relative;
        }
        
        .footer h4::after {
            content: '';
            display: block;
            width: 30px;
            height: 2px;
            background-color: var(--accent);
            margin-top: 10px;
        }
        
        .footer ul li { margin-bottom: 12px; }
        .footer ul li a { 
            color: #A8A29E; 
            transition: 0.2s;
            display: inline-block;
        }
        .footer ul li a:hover { 
            color: #fff; 
            transform: translateX(5px); 
        }

        .footer-bottom {
            border-top: 1px solid #333;
            padding: 30px 0;
            text-align: center;
            font-size: 0.85rem;
            background-color: #151312;
        }

        @media (max-width: 1024px) {
            .quizzes-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 768px) {
            .quizzes-grid { grid-template-columns: 1fr; }
            .nav-menu { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
            .page-header h1 { font-size: 2.5rem; }
            .category-scroll-container { justify-content: flex-start; flex-wrap: nowrap; padding-left: 24px; padding-right: 24px; }
        }
