/*
 * EduTeste — Pacote 01
 * Camada de paridade visual global com o sistema legado.
 * Mantida separada de eduteste-legado.css para facilitar rollback e auditoria.
 */

:root{
    --p01-bg:#f3f6fb;
    --p01-bg-2:#eef2ff;
    --p01-white:#ffffff;
    --p01-text:#0f172a;
    --p01-muted:#475569;
    --p01-border:#e5e7eb;
    --p01-blue:#3b82f6;
    --p01-blue-dark:#2563eb;
    --p01-green:#10b981;
    --p01-green-dark:#059669;
    --p01-red:#ef4444;
    --p01-red-soft:#fee2e2;
    --p01-red-text:#b91c1c;
    --p01-amber:#f59e0b;
}

body.role-teacher,
body.role-student,
body.role-master{
    color:var(--p01-text);
    background:linear-gradient(180deg,var(--p01-bg),var(--p01-bg-2));
}

/* Cabeçalho: reproduz a composição simples do sistema antigo. */
.legacy-topbar.legacy-topbar-parity{
    position:sticky;
    top:0;
    z-index:100;
    min-height:61px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:1.5rem;
    padding:.75rem 1rem;
    border-bottom:1px solid var(--p01-border);
    background:#fff;
    box-shadow:none;
}

.legacy-header-left{
    display:flex;
    flex:0 0 auto;
    min-width:210px;
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
}

.legacy-dashboard-title{
    display:flex;
    align-items:baseline;
    gap:7px;
    color:#111827;
    font-size:1.25rem;
    font-weight:600;
    line-height:1.1;
    white-space:nowrap;
}
.legacy-dashboard-title:hover{color:#111827}
.legacy-dashboard-title small{
    color:#dc2626;
    font-size:.72rem;
    font-weight:700;
}

.legacy-header-controls{
    align-items:center;
    gap:1.25rem;
}
.legacy-controls-desktop{
    display:flex;
    flex:1;
    justify-content:space-between;
}
.legacy-controls-mobile{display:none}
.legacy-controls-password-only{
    display:flex;
    margin-left:auto;
}
.legacy-controls-group{
    display:flex;
    align-items:center;
    gap:.5rem;
}
.legacy-header-controls form{display:inline-flex;margin:0}

.legacy-topbar.legacy-topbar-parity .btn-header-link{
    display:inline-flex;
    min-height:0;
    width:auto;
    align-items:center;
    justify-content:center;
    padding:.4em .9em;
    border:1px solid transparent;
    border-radius:999px;
    background:#f9fafb;
    color:#374151;
    font-size:.85rem;
    font-weight:500;
    line-height:1.35;
    text-decoration:none;
    box-shadow:none;
    transition:background-color .15s,color .15s,border-color .15s,filter .15s;
}
.legacy-topbar.legacy-topbar-parity .btn-header-link:hover{
    transform:none;
    filter:none;
    background:#e5e7eb;
}
.legacy-topbar.legacy-topbar-parity .btn-header-primary{
    background:var(--p01-green)!important;
    color:#fff!important;
    border-color:var(--p01-green-dark)!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-primary:hover{filter:brightness(.95)}
.legacy-topbar.legacy-topbar-parity .btn-header-secondary{
    background:var(--p01-blue)!important;
    color:#fff!important;
    border-color:var(--p01-blue)!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-secondary:hover{filter:brightness(.92)}
.legacy-topbar.legacy-topbar-parity .btn-header-ghost{
    background:transparent!important;
    color:#4b5563!important;
    border-color:transparent!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-ghost:hover,
.legacy-topbar.legacy-topbar-parity .btn-header-ghost.is-active{
    background:#f3f4f6!important;
    border-color:#e5e7eb!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-danger{
    background:var(--p01-red-soft)!important;
    color:var(--p01-red-text)!important;
    border-color:#fecaca!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-danger:hover{
    background:var(--p01-red)!important;
    color:#fff!important;
    border-color:#b91c1c!important;
}
.legacy-topbar.legacy-topbar-parity .btn-header-secondary.is-active{
    box-shadow:0 0 0 2px rgba(59,130,246,.16);
}

/* Área principal: densidade próxima ao sistema anterior. */
.role-teacher .legacy-container,
.role-student .legacy-container,
.role-master .legacy-container{
    padding:1rem 1rem 88px;
}
.legacy-alert{
    max-width:1500px;
    border-radius:8px;
    box-shadow:none;
}

/* Componentes globais deixam de parecer um segundo produto. */
.card,
.legacy-panel{
    border-color:#dde4ee;
    box-shadow:0 2px 8px rgba(15,23,42,.06);
}
.button,
.legacy-btn,
.btn{
    border-radius:10px;
}
input,
select,
textarea{
    border-radius:8px;
}

/* Modais: compactos, claros e sem efeitos visuais excessivos. */
.app-dialog{
    border:1px solid #d9e0e9;
    border-radius:12px;
    box-shadow:0 18px 44px rgba(15,23,42,.22);
}
.app-dialog::backdrop{background:rgba(15,23,42,.52)}
.dialog-panel{gap:12px;padding:18px}
.dialog-heading{
    align-items:center;
    padding-bottom:10px;
    border-bottom:1px solid #e5e7eb;
}
.dialog-heading h2{color:#111827;font-size:1.1rem;font-weight:600}
.dialog-heading p{color:#64748b}
.dialog-x{line-height:1;color:#6b7280}
.dialog-actions{padding-top:2px}

/* O botão de correção impressa no legado era uma ação móvel, não um FAB desktop. */
@media (min-width:901px){
    .legacy-floating-correction{display:none!important}
}

@media (max-width:900px){
    body.role-teacher,
    body.role-student,
    body.role-master{
        overflow-x:hidden;
    }
    .legacy-topbar.legacy-topbar-parity{
        position:sticky;
        display:flex;
        flex-wrap:wrap;
        gap:.55rem .75rem;
        min-height:0;
        padding:.62rem .7rem;
    }
    .legacy-header-left{
        min-width:0;
        width:100%;
    }
    .legacy-dashboard-title{
        font-size:1.05rem;
    }
    .legacy-controls-desktop{display:none!important}
    .legacy-controls-mobile{
        display:flex;
        width:100%;
        justify-content:space-between;
        gap:.45rem;
    }
    .legacy-controls-group{
        gap:.35rem;
        min-width:0;
    }
    .legacy-topbar.legacy-topbar-parity .btn-header-link{
        padding:.38em .65em;
        font-size:.78rem;
        white-space:nowrap;
    }
    .role-teacher .legacy-container,
    .role-student .legacy-container,
    .role-master .legacy-container{
        padding:.7rem .55rem 82px;
    }
    .legacy-floating-correction{
        position:fixed!important;
        left:12px!important;
        right:12px!important;
        bottom:12px!important;
        z-index:9999!important;
        display:flex!important;
        width:auto!important;
        align-items:center!important;
        justify-content:center!important;
        gap:.5rem!important;
        padding:14px 16px!important;
        border-radius:999px!important;
        background:var(--p01-amber)!important;
        color:#fff!important;
        font-size:.9rem!important;
        font-weight:800!important;
        box-shadow:0 12px 28px rgba(15,23,42,.20)!important;
    }
}

@media (max-width:520px){
    .legacy-controls-mobile{
        align-items:center;
    }
    .legacy-controls-left,
    .legacy-controls-right{
        flex-wrap:wrap;
    }
    .legacy-topbar.legacy-topbar-parity .btn-header-link{
        font-size:.74rem;
    }
    .app-dialog{
        width:calc(100% - 18px);
        max-height:calc(100vh - 18px);
    }
}

@media print{
    .legacy-topbar.legacy-topbar-parity,
    .legacy-floating-correction{
        display:none!important;
    }
}
