.auth-pagina {
    display: grid;
    place-items: center;
    min-height: 62vh;
    padding: 36px 0;
}

.auth-panel,
.auth-tarjeta {
    width: min(100%, 460px);
    padding: 28px;
    border: 1px solid #dce4ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(23, 50, 77, .10);
}

.auth-panel-ancho {
    width: min(100%, 650px);
}

.auth-etiqueta {
    margin: 0;
    color: #0b5fa5;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.auth-panel h1,
.auth-cabecera h1,
.auth-tarjeta h2 {
    color: #17324d;
}

.auth-panel h1 {
    margin: 6px 0 10px;
}

.auth-descripcion,
.auth-ayuda,
.auth-tarjeta p {
    color: #64748b;
}

.auth-formulario {
    display: grid;
    gap: 15px;
    margin-top: 22px;
}

.auth-formulario label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: .88rem;
    font-weight: 700;
}

.auth-formulario input {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #17324d;
}

.auth-formulario select,
.auth-acciones select,
.auth-acciones input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #17324d;
}

.auth-formulario button,
.auth-boton-enlace,
.auth-salir button {
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: #0b5fa5;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.auth-boton-enlace {
    display: inline-block;
    text-decoration: none;
}

.auth-mensaje {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
}

.auth-mensaje-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.auth-admin {
    padding: 32px 0;
}

.auth-admin-alta {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.auth-admin-alta summary,
.auth-acciones summary {
    color: #17324d;
    font-weight: 800;
    cursor: pointer;
}

.auth-formulario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-tabla-contenedor {
    overflow-x: auto;
    border: 1px solid #dce4ec;
    border-radius: 12px;
    background: #fff;
}

.auth-tabla {
    width: 100%;
    border-collapse: collapse;
    color: #334155;
    font-size: .88rem;
}

.auth-tabla th,
.auth-tabla td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.auth-tabla th {
    background: #f8fafc;
    color: #17324d;
}

.auth-insignia {
    display: inline-block;
    margin: 2px 0;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: .68rem;
    font-weight: 800;
}

.auth-rol-admin {
    background: #fee2e2;
    color: #991b1b;
}

.auth-rol-analyst {
    background: #dbeafe;
    color: #1e40af;
}

.auth-rol-viewer {
    background: #dcfce7;
    color: #166534;
}

.auth-acciones {
    min-width: 225px;
}

.auth-acciones form {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.auth-acciones label {
    display: grid;
    gap: 4px;
}

.auth-acciones button,
.auth-enlace-accion {
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: #0b5fa5;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.auth-acciones .auth-boton-secundario {
    background: #475569;
}

.auth-cuenta {
    padding: 32px 0;
}

.auth-cabecera {
    margin-bottom: 22px;
}

.auth-columnas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.auth-tarjeta {
    width: auto;
}

.auth-secreto,
.auth-codigos {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #eff6ff;
}

.auth-secreto span,
.auth-secreto code,
.auth-codigos code {
    display: block;
}

.auth-secreto code,
.auth-codigos code,
.auth-uri {
    overflow-wrap: anywhere;
    margin-top: 6px;
    color: #17324d;
    font-size: .95rem;
}

.auth-codigos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.auth-pasos {
    color: #475569;
}

.auth-usuario-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 12px;
}

.auth-usuario-menu span {
    font-size: .82rem;
    white-space: nowrap;
}

.auth-usuario-menu a,
.auth-usuario-menu span,
.auth-salir button {
    color: #fff !important;
    font-weight: 700;
}

.auth-salir {
    margin: 0;
}

.auth-salir button {
    min-height: 34px;
    padding: 6px 11px;
    background: #475569;
}

@media (max-width: 780px) {
    .auth-columnas {
        grid-template-columns: 1fr;
    }

    .auth-usuario-menu span {
        display: none;
    }

    .auth-codigos {
        grid-template-columns: 1fr;
    }

    .auth-formulario-grid {
        grid-template-columns: 1fr;
    }
}

/* Módulos habilitados por usuario (src/dncp/modulos.py). */
.auth-modulos fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.auth-modulos legend {
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-modulos-grupo {
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5b6f82;
}

.auth-modulos .auth-modulo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.auth-modulos .auth-modulo input {
    width: auto;
}

.auth-modulos-nota,
.auth-modulos-apagados {
    display: block;
    color: #5b6f82;
    font-size: 12px;
}

/* Código QR del segundo factor (MP3-CC-022): fondo blanco para que la cámara lo lea también en modo oscuro. */
.auth-qr {
    display: block;
    width: 250px;
    max-width: 100%;
    height: auto;
    margin: 18px auto;
    padding: 8px;
    border-radius: 9px;
    background: #ffffff;
}
