/* institutional.css - Estilo unificado para páginas institucionais */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --dark-text: #f8fafc;
    --dark-subtext: #94a3b8;
    --light-bg: #f8fafc;
    --light-card: #ffffff;
    --light-border: #e2e8f0;
    --light-text: #1e293b;
    --light-subtext: #64748b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--dark-text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.light-theme {
    background: var(--light-bg);
    color: var(--light-text);
}

/* ============ HEADER ============ */
.institutional-header {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-card) 100%);
    height: 70px;
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .institutional-header {
    background: linear-gradient(135deg, var(--light-card) 0%, #f1f5f9 100%);
    border-bottom-color: var(--light-border);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.light-theme .logo {
    color: var(--light-text);
}

.logo-icon {
    color: var(--primary);
    font-size: 28px;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-subtext);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.light-theme .back-button {
    color: var(--light-subtext);
}

.back-button:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

/* ============ MAIN CONTENT ============ */
.institutional-main {
    flex: 1;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}

.institutional-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.institutional-subtitle {
    color: var(--dark-subtext);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.light-theme .institutional-subtitle {
    color: var(--light-subtext);
}

.institutional-section {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 14px;
    padding: 1.8rem;
    margin-bottom: 1.6rem;
}

.light-theme .institutional-section {
    background: var(--light-card);
    border: 1px solid var(--light-border);
}

.section-title {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
}

.light-theme .section-title {
    color: var(--light-text);
}

.institutional-text {
    margin: 0.6rem 0 1rem;
    color: var(--dark-subtext);
}

.light-theme .institutional-text {
    color: var(--light-subtext);
}

/* ============ LISTS ============ */
.institutional-list {
    padding-left: 1.25rem;
    color: var(--dark-subtext);
}

.light-theme .institutional-list {
    color: var(--light-subtext);
}

.list-item {
    margin-bottom: 0.45rem;
}

/* ============ NOTICE BOXES ============ */
.notice-box {
    background: rgba(90, 140, 255, 0.08);
    border-left: 4px solid #5a8cff;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin: 1rem 0;
}

/* ============ FOOTER ============ */
.institutional-footer {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-card) 100%);
    border-top: 1px solid var(--dark-border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-subtext);
}

.light-theme .institutional-footer {
    background: linear-gradient(135deg, var(--light-card) 0%, #f1f5f9 100%);
    border-top: 1px solid var(--light-border);
    color: var(--light-subtext);
}

/* ============ LANGUAGE SELECTOR & HEADER CONTROLS ============ */
.language-selector {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.language-selector:hover {
    border-color: var(--primary);
    background: var(--dark-bg);
}

.light-theme .language-selector {
    background: var(--light-card);
    border: 1px solid var(--light-border);
    color: var(--light-text);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============ TEAM SECTION ============ */
.team-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.team-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 1.5rem;
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.light-theme .team-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid var(--light-border);
}

.avatar {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    color: var(--primary);
}

/* ============ FEATURE GRID ============ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s;
}

.light-theme .feature-card {
    background: var(--light-card);
    border: 1px solid var(--light-border);
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ============ STEP BOX ============ */
.step-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.step-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

/* ============ TIP BOX ============ */
.tip-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    color: var(--dark-subtext);
}

.light-theme .tip-box {
    color: var(--light-subtext);
}

/* ============ TECH STACK BADGES ============ */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0;
}

.tech-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary-light);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.light-theme .tech-badge {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.3);
    color: var(--primary-dark);
}

/* ============ ACTION LINKS ============ */
.action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s;
}

.action-link-primary {
    background: var(--primary);
    color: #fff;
}

.action-link-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.action-link-secondary {
    background: rgba(122, 162, 255, 0.1);
    border: 1px solid rgba(122, 162, 255, 0.3);
    color: #7aa2ff;
}

.action-link-secondary:hover {
    background: rgba(122, 162, 255, 0.2);
    transform: translateY(-2px);
}

.light-theme .action-link-secondary {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
    color: #1d4ed8;
}

.light-theme .action-link-secondary:hover {
    background: rgba(37, 99, 235, 0.15);
}

/* ============ LINK CARDS ============ */
a.link-card {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.link-card:hover {
    transform: translateY(-4px);
}

/* ============ FOOTER NAVIGATION ============ */
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.footer-nav a {
    color: var(--dark-subtext);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.25s;
}

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

.light-theme .footer-nav a {
    color: var(--light-subtext);
}

/* ============ FOOTER — SHARED WITH MAIN PAGE ============ */
.institutional-footer {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-card) 100%);
    border-top: 1px solid var(--dark-border);
    padding: 0 0;
    display: flex;
    align-items: center;
    min-height: 56px;
    flex-shrink: 0;
}

.light-theme .institutional-footer {
    background: linear-gradient(135deg, var(--light-card) 0%, #f1f5f9 100%);
    border-top: 1px solid var(--light-border);
}

.footer-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dark-subtext);
    font-size: 13px;
}

.light-theme .footer-text {
    color: var(--light-subtext);
}

.footer-separator {
    color: var(--dark-border);
}

.light-theme .footer-separator {
    color: var(--light-border);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--dark-subtext);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.light-theme .footer-link {
    color: var(--light-subtext);
}

.footer-link:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

/* ============ RESPONSIVIDADE ============ */
@media (max-width: 768px) {
    .institutional-main {
        padding: 2rem 1rem;
    }
    
    .institutional-title {
        font-size: 1.8rem;
    }
    
    .institutional-section {
        padding: 1.2rem;
    }
    
    .header-container {
        padding: 0 15px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 16px;
        gap: 10px;
    }

    .footer-links {
        justify-content: center;
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .institutional-title {
        font-size: 1.5rem;
    }

    .institutional-header {
        height: auto;
        padding: 10px 0;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 0 12px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .language-selector {
        flex: 1;
        max-width: 140px;
    }

    .institutional-section {
        padding: 1rem;
    }

    .team-section {
        flex-direction: column;
    }

    .team-card {
        min-width: unset;
    }

    .action-link {
        width: 100%;
        justify-content: center;
    }

    .footer-links {
        gap: 10px;
        font-size: 12px;
    }

    .footer-link {
        font-size: 12px;
    }
}

/* ============ SVG ICONS ============ */
.svg-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.feature-icon .svg-icon {
    width: 2rem;
    height: 2rem;
}

.section-title .svg-icon {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: -0.2em;
}

.tip-box .svg-icon,
.notice-box .svg-icon {
    width: 1rem;
    height: 1rem;
    vertical-align: -0.15em;
}

/* ============ SCROLL PROGRESS BAR ============ */
#read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    z-index: 9999;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* ============ CHIP NAVIGATION ============ */
.chip-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--dark-border);
    background: var(--dark-card);
    color: var(--dark-subtext);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    user-select: none;
}

.chip:hover,
.chip.active {
    background: rgba(16, 185, 129, 0.14);
    border-color: var(--primary);
    color: var(--primary-light);
}

.light-theme .chip {
    background: var(--light-card);
    border-color: var(--light-border);
    color: var(--light-subtext);
}

.light-theme .chip:hover,
.light-theme .chip.active {
    background: rgba(5, 150, 105, 0.08);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* ============ SKIP TO TOP BUTTON ============ */
#skip-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    color: var(--dark-subtext);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 200;
    pointer-events: none;
    text-decoration: none;
}

#skip-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#skip-to-top:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: var(--primary);
    color: var(--primary);
}

.light-theme #skip-to-top {
    background: var(--light-card);
    border-color: var(--light-border);
    color: var(--light-subtext);
}

.light-theme #skip-to-top:hover {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* ============ THEME TOGGLE BUTTON ============ */
.theme-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--dark-border);
    background: var(--dark-card);
    color: var(--dark-subtext);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    flex-shrink: 0;
    padding: 0;
}

.theme-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.light-theme .theme-toggle-btn {
    background: var(--light-card);
    border-color: var(--light-border);
    color: var(--light-subtext);
}

.light-theme .theme-toggle-btn:hover {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* ============ DARK/LIGHT THEME TEXT FIX ============ */
/* Ensure all text inside cards and containers follows the theme */
.light-theme .feature-card h3,
.light-theme .feature-card h4,
.light-theme .team-card h3 {
    color: var(--light-text);
}

.light-theme .step-box {
    background: rgba(5, 150, 105, 0.07);
    color: var(--light-text);
}

.light-theme .step-box strong {
    color: var(--light-text);
}

.light-theme .notice-box {
    color: var(--light-text);
}

.light-theme h3[style*="color: var(--dark-text)"],
.light-theme h3[style] {
    color: var(--light-text) !important;
}

/* Feature card and team card text in light mode */
.light-theme .team-card p,
.light-theme .feature-card p {
    color: var(--light-subtext);
}

.light-theme .team-card {
    color: var(--light-text);
}

/* Section title color in both themes */
.section-title {
    color: var(--dark-text);
}

.light-theme .section-title {
    color: var(--light-text);
}

/* ============ THEME-AWARE LINK HELPERS ============ */
/* Replaces inline color:#7aa2ff for proper contrast in both themes */
.theme-link {
    color: #7aa2ff;
    text-decoration: none;
}

.theme-link:hover {
    text-decoration: underline;
}

.light-theme .theme-link {
    color: #1d4ed8;
}

/* Team card social links */
.team-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.75rem;
    color: #7aa2ff;
    text-decoration: none;
    font-size: 0.85rem;
}

.team-link:hover {
    text-decoration: underline;
}

.light-theme .team-link {
    color: #1d4ed8;
}

/* ============ RESPONSIVIDADE — CHIPS ============ */
@media (max-width: 480px) {
    .chip-nav {
        gap: 0.4rem;
    }

    .chip {
        font-size: 0.78rem;
        padding: 0.3rem 0.75rem;
    }

    #skip-to-top {
        bottom: 1.25rem;
        right: 1rem;
        width: 34px;
        height: 34px;
    }
}
