/**
 * ========================================================================
 * ARQUIVO DE ESTILOS PERSONALIZADOS - PORTAL MPDFT
 * ========================================================================
 * ESTRUTURA:
 * 1. ESTILOS GLOBAIS E DE COMPONENTES
 * 2. MODAL, VIEWS E FORMULÁRIOS
 * 3. UTILITÁRIOS E IMPRESSÃO
 * 4. COMPONENTES CUSTOMIZADOS
 * 5. TOOLTIPS
 * ========================================================================
 */

/* --- 1. ESTILOS GLOBAIS E DE COMPONENTES --- */
html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { 
    flex-grow: 1; 
}

.card {
    background-color: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-5px);
    border-color: #c8102e;
    box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.1);
}

.card-content {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.institutional-card {
    background-color: #FFFFFF;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    text-align: left;
}

.institutional-card:hover,
.institutional-card:focus-visible {
     border-color: #c8102e;
     background-color: #fdf2f2;
}

.institutional-card .card-content {
    padding: 0;
    align-items: flex-start;
    text-align: left;
}

.report-button {
    background-color: white; 
    border-radius: 0.75rem; 
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease-in-out; 
    text-decoration: none; 
    display: flex;
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    padding: 1.5rem; 
    height: 100%; 
    cursor: pointer;
}

.report-button:hover,
.report-button:focus-visible {
    transform: translateY(-5px); 
    border-color: #c8102e;
    box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.1);
}

.featured-card {
    background: linear-gradient(135deg, #c8102e 0%, #a00d25 100%);
    color: white;
    border-radius: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.featured-card:hover,
.featured-card:focus-visible {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* --- 2. MODAL, VIEWS E FORMULÁRIOS --- */
body.modal-open {
    overflow: hidden;
}

#modal-content-wrapper { 
    transition: all 0.3s ease-in-out; 
}

#modal-body > * {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

#modal-body a { 
    color: #c8102e; 
    text-decoration: underline; 
}

#modal-body details { 
    margin-top: 1rem; 
    background-color: #f8fafc; 
    border-radius: 0.5rem; 
    border: 1px solid #e2e8f0; 
}

#modal-body details summary { 
    cursor: pointer; 
    font-weight: 600; 
    padding: 0.75rem 1rem; 
    transition: background-color 0.2s; 
    display: flex; 
    align-items: center; 
}

#modal-body details summary:hover,
#modal-body details summary:focus-visible { 
    background-color: #e2e8f0; 
}

#modal-body details div { 
    padding: 1rem; 
    background-color: #ffffff; 
    border-top: 1px solid #e2e8f0; 
}

#modal-body ul { 
    list-style-position: inside; 
    margin-left: 0.5rem; 
}

.promotoria-tab-button.active { 
    background-color: white; 
    color: #c8102e; 
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); 
}

.view { 
    display: none; 
}

.view.active { 
    display: block; 
    animation: fadeIn 0.5s ease-in-out; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.progress-bar-container { 
    background-color: #e2e8f0; 
    border-radius: 9999px; 
    overflow: hidden; 
    height: 0.75rem; 
}

.progress-bar-fill { 
    background-color: #22c55e;
    height: 100%; 
    transition: width 0.4s ease-in-out; 
}

.spinner {
    animation: spin 1s linear infinite;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 1rem; 
    height: 1rem;
    display: inline-block;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}
        
.injected-section { 
    margin-bottom: 2.5rem; 
}

.injected-section h2 { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: #1e293b; 
    border-bottom: 2px solid #e2e8f0; 
    padding-bottom: 0.5rem; 
    margin-bottom: 1rem; 
}

.injected-section h3 { 
    font-size: 1.25rem; 
    font-weight: bold; 
    color: #334155; 
    margin-top: 1.5rem; 
    margin-bottom: 0.75rem; 
}

.injected-section p, .injected-section ul { 
    color: #475569; 
    margin-bottom: 1rem; 
}

.injected-section ul { 
    list-style: disc; 
    padding-left: 1.5rem; 
}

.injected-section a { 
    color: #c8102e; 
    text-decoration: underline; 
}

.injected-tabs button.active { 
    border-color: #c8102e; 
    color: #c8102e; 
    background-color: #fef2f2; 
}

/* --- 3. UTILITÁRIOS E IMPRESSÃO --- */
@media print {
    .no-print { 
        display: none !important; 
    }
    body { 
        background-color: #fff; 
    }
}

/* --- 4. COMPONENTES CUSTOMIZADOS --- */
.video-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    width: 100%;
}

.video-button:hover,
.video-button:focus-visible {
    background-color: #fee2e2;
    color: #7f1d1d;
}

/* --- 5. TOOLTIPS --- */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.tooltip-icon {
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #A0AEC0;
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    user-select: none;
}

.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #2D3748;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 140%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2D3748 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-container.tooltip-active .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-icon:active,
.tooltip-icon:focus {
    outline: 2px solid #60A5FA;
    outline-offset: 2px;
}

/* Responsivo Mobile */
@media (max-width: 768px) {
    .tooltip-text {
        width: calc(100vw - 40px);
        max-width: 320px;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
        bottom: 140%;
    }
    
    label:has(input[type="datetime-local"]) .tooltip-text,
    label:has(input[type="date"]) .tooltip-text,
    label:has(input[type="time"]) .tooltip-text {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        z-index: 10000;
    }
    
    .tooltip-text::after {
        left: 50%;
        margin-left: -5px;
    }
}
